diff --git a/.codegen/api.go.tmpl b/.codegen/api.go.tmpl index 1e8448b60..4c9e70e0c 100644 --- a/.codegen/api.go.tmpl +++ b/.codegen/api.go.tmpl @@ -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}}]{ diff --git a/openapi/code/service.go b/openapi/code/service.go index bb10616e5..ed77109ef 100644 --- a/openapi/code/service.go +++ b/openapi/code/service.go @@ -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" { diff --git a/retries/retries.go b/retries/retries.go index c56e85e35..77d0ae08f 100644 --- a/retries/retries.go +++ b/retries/retries.go @@ -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 { diff --git a/service/catalog/api.go b/service/catalog/api.go index 3f640772e..58d2437b5 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Catalogs, Connections, External Locations, Functions, Grants, Metastores, Schemas, Storage Credentials, Table Constraints, Tables, Volumes, Workspace Bindings, etc. +// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Catalogs, Connections, External Locations, Functions, Grants, Metastores, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Volumes, Workspace Bindings, etc. package catalog import ( @@ -1460,6 +1460,86 @@ func (a *StorageCredentialsAPI) Validate(ctx context.Context, request ValidateSt return a.impl.Validate(ctx, request) } +func NewSystemSchemas(client *client.DatabricksClient) *SystemSchemasAPI { + return &SystemSchemasAPI{ + impl: &systemSchemasImpl{ + client: client, + }, + } +} + +// A system schema is a schema that lives within the system catalog. A system +// schema may contain information about customer usage of Unity Catalog such as +// audit-logs, billing-logs, lineage information, etc. +type SystemSchemasAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(SystemSchemasService) + impl SystemSchemasService +} + +// WithImpl could be used to override low-level API implementations for unit +// testing purposes with [github.com/golang/mock] or other mocking frameworks. +func (a *SystemSchemasAPI) WithImpl(impl SystemSchemasService) *SystemSchemasAPI { + a.impl = impl + return a +} + +// Impl returns low-level SystemSchemas API implementation +func (a *SystemSchemasAPI) Impl() SystemSchemasService { + return a.impl +} + +// Disable a system schema. +// +// Disables the system schema and removes it from the system catalog. The caller +// must be an account admin or a metastore admin. +func (a *SystemSchemasAPI) Disable(ctx context.Context, request DisableRequest) error { + return a.impl.Disable(ctx, request) +} + +// Disable a system schema. +// +// Disables the system schema and removes it from the system catalog. The caller +// must be an account admin or a metastore admin. +func (a *SystemSchemasAPI) DisableByMetastoreIdAndSchemaName(ctx context.Context, metastoreId string, schemaName string) error { + return a.impl.Disable(ctx, DisableRequest{ + MetastoreId: metastoreId, + SchemaName: schemaName, + }) +} + +// Enable a system schema. +// +// Enables the system schema and adds it to the system catalog. The caller must +// be an account admin or a metastore admin. +func (a *SystemSchemasAPI) Enable(ctx context.Context) error { + return a.impl.Enable(ctx) +} + +// List system schemas. +// +// Gets an array of system schemas for a metastore. The caller must be an +// account admin or a metastore admin. +// +// This method is generated by Databricks SDK Code Generator. +func (a *SystemSchemasAPI) ListAll(ctx context.Context, request ListSystemSchemasRequest) ([]SystemSchemaInfo, error) { + response, err := a.impl.List(ctx, request) + if err != nil { + return nil, err + } + return response.Schemas, nil +} + +// List system schemas. +// +// Gets an array of system schemas for a metastore. The caller must be an +// account admin or a metastore admin. +func (a *SystemSchemasAPI) ListByMetastoreId(ctx context.Context, metastoreId string) (*ListSystemSchemasResponse, error) { + return a.impl.List(ctx, ListSystemSchemasRequest{ + MetastoreId: metastoreId, + }) +} + func NewTableConstraints(client *client.DatabricksClient) *TableConstraintsAPI { return &TableConstraintsAPI{ impl: &tableConstraintsImpl{ diff --git a/service/catalog/impl.go b/service/catalog/impl.go index 4afdbeac4..1a4014bcb 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -472,6 +472,30 @@ func (a *storageCredentialsImpl) Validate(ctx context.Context, request ValidateS return &validateStorageCredentialResponse, err } +// unexported type that holds implementations of just SystemSchemas API methods +type systemSchemasImpl struct { + client *client.DatabricksClient +} + +func (a *systemSchemasImpl) Disable(ctx context.Context, request DisableRequest) error { + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas/%v", request.MetastoreId, request.SchemaName) + err := a.client.Do(ctx, http.MethodDelete, path, request, nil) + return err +} + +func (a *systemSchemasImpl) Enable(ctx context.Context) error { + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores//systemschemas/") + err := a.client.Do(ctx, http.MethodPost, path, nil, nil) + return err +} + +func (a *systemSchemasImpl) List(ctx context.Context, request ListSystemSchemasRequest) (*ListSystemSchemasResponse, error) { + var listSystemSchemasResponse ListSystemSchemasResponse + path := fmt.Sprintf("/api/2.1/unity-catalog/metastores/%v/systemschemas", request.MetastoreId) + err := a.client.Do(ctx, http.MethodGet, path, request, &listSystemSchemasResponse) + return &listSystemSchemasResponse, err +} + // unexported type that holds implementations of just TableConstraints API methods type tableConstraintsImpl struct { client *client.DatabricksClient diff --git a/service/catalog/interface.go b/service/catalog/interface.go index c350665c4..a2065ad4e 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -582,6 +582,32 @@ type StorageCredentialsService interface { Validate(ctx context.Context, request ValidateStorageCredential) (*ValidateStorageCredentialResponse, error) } +// A system schema is a schema that lives within the system catalog. A system +// schema may contain information about customer usage of Unity Catalog such as +// audit-logs, billing-logs, lineage information, etc. +type SystemSchemasService interface { + + // Disable a system schema. + // + // Disables the system schema and removes it from the system catalog. The + // caller must be an account admin or a metastore admin. + Disable(ctx context.Context, request DisableRequest) error + + // Enable a system schema. + // + // Enables the system schema and adds it to the system catalog. The caller + // must be an account admin or a metastore admin. + Enable(ctx context.Context) error + + // List system schemas. + // + // Gets an array of system schemas for a metastore. The caller must be an + // account admin or a metastore admin. + // + // Use ListAll() to get all SystemSchemaInfo instances + List(ctx context.Context, request ListSystemSchemasRequest) (*ListSystemSchemasResponse, error) +} + // Primary key and foreign key constraints encode relationships between fields // in tables. // diff --git a/service/catalog/model.go b/service/catalog/model.go index 5c2bd51f0..eeacdfe9e 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -825,6 +825,14 @@ type Dependency struct { Table *TableDependency `json:"table,omitempty"` } +// Disable a system schema +type DisableRequest struct { + // The metastore ID under which the system schema lives. + MetastoreId string `json:"-" url:"-"` + // Full name of the system schema. + SchemaName string `json:"-" url:"-"` +} + type EffectiveAutoMaintenanceFlag struct { // The name of the object from which the flag was inherited. If there was no // inheritance, this field is left blank. @@ -1505,6 +1513,17 @@ type ListSummariesRequest struct { TableNamePattern string `json:"-" url:"table_name_pattern,omitempty"` } +// List system schemas +type ListSystemSchemasRequest struct { + // The ID for the metastore in which the system schema resides. + MetastoreId string `json:"-" url:"-"` +} + +type ListSystemSchemasResponse struct { + // An array of system schema information objects. + Schemas []SystemSchemaInfo `json:"schemas,omitempty"` +} + type ListTableSummariesResponse struct { // Opaque token for pagination. Omitted if there are no more results. NextPageToken string `json:"next_page_token,omitempty"` @@ -1877,6 +1896,47 @@ type StorageCredentialInfo struct { UsedForManagedStorage bool `json:"used_for_managed_storage,omitempty"` } +type SystemSchemaInfo struct { + // Name of the system schema. + Schema string `json:"schema,omitempty"` + // The current state of enablement for the system schema. An empty string + // means the system schema is available and ready for opt-in. + State SystemSchemaInfoState `json:"state,omitempty"` +} + +// The current state of enablement for the system schema. An empty string means +// the system schema is available and ready for opt-in. +type SystemSchemaInfoState string + +const SystemSchemaInfoStateDisableinitialized SystemSchemaInfoState = `DisableInitialized` + +const SystemSchemaInfoStateEnablecompleted SystemSchemaInfoState = `EnableCompleted` + +const SystemSchemaInfoStateEnableinitialized SystemSchemaInfoState = `EnableInitialized` + +const SystemSchemaInfoStateUnavailable SystemSchemaInfoState = `Unavailable` + +// String representation for [fmt.Print] +func (ssis *SystemSchemaInfoState) String() string { + return string(*ssis) +} + +// Set raw string value and validate it against allowed values +func (ssis *SystemSchemaInfoState) Set(v string) error { + switch v { + case `DisableInitialized`, `EnableCompleted`, `EnableInitialized`, `Unavailable`: + *ssis = SystemSchemaInfoState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "DisableInitialized", "EnableCompleted", "EnableInitialized", "Unavailable"`, v) + } +} + +// Type always returns SystemSchemaInfoState to satisfy [pflag.Value] interface +func (ssis *SystemSchemaInfoState) Type() string { + return "SystemSchemaInfoState" +} + // A table constraint, as defined by *one* of the following fields being set: // __primary_key_constraint__, __foreign_key_constraint__, // __named_table_constraint__. diff --git a/service/compute/api.go b/service/compute/api.go index 0a4720d3b..6d4ceaa0a 100755 --- a/service/compute/api.go +++ b/service/compute/api.go @@ -391,7 +391,11 @@ func (a *ClustersAPI) CreateAndWait(ctx context.Context, createCluster CreateClu if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -436,7 +440,11 @@ func (a *ClustersAPI) DeleteAndWait(ctx context.Context, deleteCluster DeleteClu if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -507,7 +515,11 @@ func (a *ClustersAPI) EditAndWait(ctx context.Context, editCluster EditCluster, if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -757,7 +769,11 @@ func (a *ClustersAPI) ResizeAndWait(ctx context.Context, resizeCluster ResizeClu if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -800,7 +816,11 @@ func (a *ClustersAPI) RestartAndWait(ctx context.Context, restartCluster Restart if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -857,7 +877,11 @@ func (a *ClustersAPI) StartAndWait(ctx context.Context, startCluster StartCluste if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ClusterInfo]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ClusterInfo) { for _, o := range options { o(&retries.Info[ClusterInfo]{ @@ -1148,7 +1172,11 @@ func (a *CommandExecutionAPI) CancelAndWait(ctx context.Context, cancelCommand C if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[CommandStatusResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *CommandStatusResponse) { for _, o := range options { o(&retries.Info[CommandStatusResponse]{ @@ -1210,7 +1238,11 @@ func (a *CommandExecutionAPI) CreateAndWait(ctx context.Context, createContext C if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ContextStatusResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ContextStatusResponse) { for _, o := range options { o(&retries.Info[ContextStatusResponse]{ @@ -1265,7 +1297,11 @@ func (a *CommandExecutionAPI) ExecuteAndWait(ctx context.Context, command Comman if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[CommandStatusResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *CommandStatusResponse) { for _, o := range options { o(&retries.Info[CommandStatusResponse]{ diff --git a/service/iam/model.go b/service/iam/model.go index adfd63801..593b5ae0d 100755 --- a/service/iam/model.go +++ b/service/iam/model.go @@ -186,8 +186,6 @@ type Group struct { Members []ComplexValue `json:"members,omitempty"` - Meta *ResourceMetadata `json:"meta,omitempty"` - Roles []ComplexValue `json:"roles,omitempty"` } @@ -584,10 +582,6 @@ type PrincipalOutput struct { UserName string `json:"user_name,omitempty"` } -type ResourceMetadata struct { - ResourceType string `json:"resourceType,omitempty"` -} - type RuleSetResponse struct { // Identifies the version of the rule set returned. Etag string `json:"etag,omitempty"` @@ -622,7 +616,7 @@ type ServicePrincipal struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks service principal ID. - Id string `json:"id,omitempty"` + Id string `json:"id,omitempty" url:"-"` Roles []ComplexValue `json:"roles,omitempty"` } @@ -667,7 +661,7 @@ type User struct { Groups []ComplexValue `json:"groups,omitempty"` // Databricks user ID. - Id string `json:"id,omitempty" url:"-"` + Id string `json:"id,omitempty"` Name *Name `json:"name,omitempty"` diff --git a/service/jobs/api.go b/service/jobs/api.go index 18bb5c9fb..14350ea12 100755 --- a/service/jobs/api.go +++ b/service/jobs/api.go @@ -163,7 +163,11 @@ func (a *JobsAPI) CancelRunAndWait(ctx context.Context, cancelRun CancelRun, opt if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Run]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Run) { for _, o := range options { o(&retries.Info[Run]{ @@ -447,7 +451,11 @@ func (a *JobsAPI) RepairRunAndWait(ctx context.Context, repairRun RepairRun, opt if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Run]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Run) { for _, o := range options { o(&retries.Info[Run]{ @@ -497,7 +505,11 @@ func (a *JobsAPI) RunNowAndWait(ctx context.Context, runNow RunNow, options ...r if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Run]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Run) { for _, o := range options { o(&retries.Info[Run]{ @@ -542,7 +554,11 @@ func (a *JobsAPI) SubmitAndWait(ctx context.Context, submitRun SubmitRun, option if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Run]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Run) { for _, o := range options { o(&retries.Info[Run]{ diff --git a/service/pipelines/api.go b/service/pipelines/api.go index 15a1afc9c..04b86ba24 100755 --- a/service/pipelines/api.go +++ b/service/pipelines/api.go @@ -376,7 +376,11 @@ func (a *PipelinesAPI) ResetAndWait(ctx context.Context, resetRequest ResetReque if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetPipelineResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetPipelineResponse) { for _, o := range options { o(&retries.Info[GetPipelineResponse]{ @@ -425,7 +429,11 @@ func (a *PipelinesAPI) StopAndWait(ctx context.Context, stopRequest StopRequest, if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetPipelineResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetPipelineResponse) { for _, o := range options { o(&retries.Info[GetPipelineResponse]{ diff --git a/service/pkg.go b/service/pkg.go index d43154050..75527a7ed 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -122,6 +122,8 @@ // // - [catalog.AccountStorageCredentialsAPI]: These APIs manage storage credentials for a particular metastore. // +// - [catalog.SystemSchemasAPI]: A system schema is a schema that lives within the system catalog. +// // - [catalog.TableConstraintsAPI]: Primary key and foreign key constraints encode relationships between fields in tables. // // - [catalog.TablesAPI]: A table resides in the third layer of Unity Catalog’s three-level namespace. @@ -235,6 +237,7 @@ var ( _ *provisioning.StorageAPI = nil _ *catalog.StorageCredentialsAPI = nil _ *catalog.AccountStorageCredentialsAPI = nil + _ *catalog.SystemSchemasAPI = nil _ *catalog.TableConstraintsAPI = nil _ *catalog.TablesAPI = nil _ *settings.TokenManagementAPI = nil diff --git a/service/provisioning/api.go b/service/provisioning/api.go index 491bf3992..bcef81a79 100755 --- a/service/provisioning/api.go +++ b/service/provisioning/api.go @@ -1089,7 +1089,11 @@ func (a *WorkspacesAPI) CreateAndWait(ctx context.Context, createWorkspaceReques if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Workspace]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Workspace) { for _, o := range options { o(&retries.Info[Workspace]{ @@ -1378,7 +1382,11 @@ func (a *WorkspacesAPI) UpdateAndWait(ctx context.Context, updateWorkspaceReques if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[Workspace]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *Workspace) { for _, o := range options { o(&retries.Info[Workspace]{ diff --git a/service/serving/api.go b/service/serving/api.go index 25852175c..70eb0c517 100755 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -153,7 +153,11 @@ func (a *ServingEndpointsAPI) CreateAndWait(ctx context.Context, createServingEn if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ServingEndpointDetailed]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ServingEndpointDetailed) { for _, o := range options { o(&retries.Info[ServingEndpointDetailed]{ @@ -281,7 +285,11 @@ func (a *ServingEndpointsAPI) UpdateConfigAndWait(ctx context.Context, endpointC if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[ServingEndpointDetailed]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *ServingEndpointDetailed) { for _, o := range options { o(&retries.Info[ServingEndpointDetailed]{ diff --git a/service/sql/api.go b/service/sql/api.go index 2c4b80a5b..0e3fa21b4 100755 --- a/service/sql/api.go +++ b/service/sql/api.go @@ -1206,7 +1206,11 @@ func (a *WarehousesAPI) CreateAndWait(ctx context.Context, createWarehouseReques if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetWarehouseResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetWarehouseResponse) { for _, o := range options { o(&retries.Info[GetWarehouseResponse]{ @@ -1264,7 +1268,11 @@ func (a *WarehousesAPI) EditAndWait(ctx context.Context, editWarehouseRequest Ed if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetWarehouseResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetWarehouseResponse) { for _, o := range options { o(&retries.Info[GetWarehouseResponse]{ @@ -1404,7 +1412,11 @@ func (a *WarehousesAPI) StartAndWait(ctx context.Context, startRequest StartRequ if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetWarehouseResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetWarehouseResponse) { for _, o := range options { o(&retries.Info[GetWarehouseResponse]{ @@ -1446,7 +1458,11 @@ func (a *WarehousesAPI) StopAndWait(ctx context.Context, stopRequest StopRequest if err != nil { return nil, err } - wait.timeout = 20 * time.Minute + tmp := &retries.Info[GetWarehouseResponse]{Timeout: 20 * time.Minute} + for _, o := range options { + o(tmp) + } + wait.timeout = tmp.Timeout wait.callback = func(info *GetWarehouseResponse) { for _, o := range options { o(&retries.Info[GetWarehouseResponse]{ diff --git a/workspace_client.go b/workspace_client.go index 7b660b288..ac218eb79 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -667,6 +667,11 @@ type WorkspaceClient struct { // ownership to another user or group to manage permissions on it. StorageCredentials *catalog.StorageCredentialsAPI + // A system schema is a schema that lives within the system catalog. A + // system schema may contain information about customer usage of Unity + // Catalog such as audit-logs, billing-logs, lineage information, etc. + SystemSchemas *catalog.SystemSchemasAPI + // Primary key and foreign key constraints encode relationships between // fields in tables. // @@ -811,6 +816,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Shares: sharing.NewShares(apiClient), StatementExecution: sql.NewStatementExecution(apiClient), StorageCredentials: catalog.NewStorageCredentials(apiClient), + SystemSchemas: catalog.NewSystemSchemas(apiClient), TableConstraints: catalog.NewTableConstraints(apiClient), Tables: catalog.NewTables(apiClient), TokenManagement: settings.NewTokenManagement(apiClient),