Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from OpenAPI spec (19 may) #390

Merged
merged 5 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions account_client.go

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

2 changes: 1 addition & 1 deletion internal/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestUcAccStorageCredentials(t *testing.T) {
require.NoError(t, err)
assert.NotEqual(t, "", byName.Id)

all, err := w.StorageCredentials.List(ctx)
all, err := w.StorageCredentials.ListAll(ctx)
require.NoError(t, err)
assert.True(t, len(all) >= 1)
}
Expand Down
4 changes: 1 addition & 3 deletions internal/dbsql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ func TestAccDashboards(t *testing.T) {
ctx, w := workspaceTest(t)

created, err := w.Dashboards.Create(ctx, sql.CreateDashboardRequest{
Name: RandomName("go-sdk-"),
DashboardFiltersEnabled: false,
IsDraft: true,
Name: RandomName("go-sdk-"),
})
require.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion internal/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestMwsAccEncryptionKeys(t *testing.T) {
}

created, err := a.EncryptionKeys.Create(ctx, provisioning.CreateCustomerManagedKeyRequest{
AwsKeyInfo: provisioning.CreateAwsKeyInfo{
AwsKeyInfo: &provisioning.CreateAwsKeyInfo{
KeyArn: GetEnvOrSkipTest(t, "TEST_MANAGED_KMS_KEY_ARN"),
KeyAlias: GetEnvOrSkipTest(t, "TEST_STORAGE_KMS_KEY_ALIAS"),
},
Expand Down
11 changes: 11 additions & 0 deletions openapi/code/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ func (e *Entity) HasNameField() bool {
return false
}

// Does this type have a single x-databricks-name field?
func (e *Entity) HasSingleNameField() bool {
count := 0
for _, v := range e.fields {
if v.Entity.IsName {
count++
}
}
return (count == 1)
}

// Enum returns all entries for enum entities
func (e *Entity) Enum() (enum []EnumEntry) {
for _, v := range e.enum {
Expand Down
3 changes: 3 additions & 0 deletions openapi/code/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ func (m *Method) NamedIdMap() *NamedIdMap {
if !entity.HasIdentifierField() {
return nil
}
if !entity.HasSingleNameField() {
return nil
}
var id *Field
var namePath []*Field
for _, f := range entity.fields {
Expand Down
10 changes: 5 additions & 5 deletions service/billing/model.go

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

117 changes: 102 additions & 15 deletions service/catalog/api.go

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

Loading