Skip to content

Commit

Permalink
Regenerate from the latest OpenAPI spec (#424)
Browse files Browse the repository at this point in the history
Internal source commit hash: c64090a5bd3c6a2c3db69ac226d6dd8febfe19d4
  • Loading branch information
nfx authored Jun 9, 2023
1 parent a67c588 commit fdf0bf4
Show file tree
Hide file tree
Showing 16 changed files with 327 additions and 34 deletions.
6 changes: 5 additions & 1 deletion .codegen/api.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ func (a *{{.Service.Name}}API) {{.PascalName}}AndWait(ctx context.Context{{if .R
if err != nil {
return nil, err
}
wait.timeout = {{.Wait.Timeout}}*time.Minute
tmp := &retries.Info[{{.Wait.Poll.Response.PascalName}}]{Timeout: {{.Wait.Timeout}}*time.Minute}
for _, o := range options {
o(tmp)
}
wait.timeout = tmp.Timeout
wait.callback = func(info *{{.Wait.Poll.Response.PascalName}}) {
for _, o := range options {
o(&retries.Info[{{.Wait.Poll.Response.PascalName}}]{
Expand Down
2 changes: 1 addition & 1 deletion openapi/code/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (svc *Service) newRequest(params []openapi.Parameter, op *openapi.Operation
panic(fmt.Errorf("%s request body is nil", op.OperationId))
}
if request.fields == nil && request.MapValue == nil {
panic(fmt.Errorf("%s request schema has no fields", op.OperationId))
return nil
}
for _, v := range params {
if v.In == "header" {
Expand Down
4 changes: 4 additions & 0 deletions retries/retries.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ import (
"github.com/databricks/databricks-sdk-go/logger"
)

// Deprecated: use return types from non-*AndWait methods
type Info[T any] struct {
Info *T
Timeout time.Duration
}

// Deprecated: use return types from non-*AndWait methods
type Option[T any] func(*Info[T])

// Deprecated: use return types from non-*AndWait methods
func Timeout[T any](dur time.Duration) Option[T] {
return func(i *Info[T]) {
i.Timeout = dur
}
}

// Deprecated: use return types from non-*AndWait methods
func OnPoll[T any](callback func(*T)) Option[T] {
return func(i *Info[T]) {
if i.Info == nil {
Expand Down
82 changes: 81 additions & 1 deletion service/catalog/api.go

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

24 changes: 24 additions & 0 deletions service/catalog/impl.go

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

26 changes: 26 additions & 0 deletions service/catalog/interface.go

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

60 changes: 60 additions & 0 deletions service/catalog/model.go

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

Loading

0 comments on commit fdf0bf4

Please sign in to comment.