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

Regenerate from the latest OpenAPI spec #424

Merged
merged 1 commit into from
Jun 9, 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
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