From 3b08cdcdd337893e423dbd360b35b0d6ea63c458 Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Wed, 8 Jan 2025 15:06:35 +0100 Subject: [PATCH 1/2] [Release] Release v0.55.0 ### Internal Changes * Bump staticcheck to 0.5.1 and add go 1.23 test coverage ([#1106](https://github.com/databricks/databricks-sdk-go/pull/1106)). * Bump x/net, x/crypto dependencies ([#1107](https://github.com/databricks/databricks-sdk-go/pull/1107)). * Create custom codeql.yml ([#1114](https://github.com/databricks/databricks-sdk-go/pull/1114)). * Decouple serving and oauth2 package ([#1110](https://github.com/databricks/databricks-sdk-go/pull/1110)). * Migrate workflows that need write access to use hosted runners ([#1112](https://github.com/databricks/databricks-sdk-go/pull/1112)). * Move package credentials in config ([#1115](https://github.com/databricks/databricks-sdk-go/pull/1115)). * Update Queries test ([#1104](https://github.com/databricks/databricks-sdk-go/pull/1104)). ### API Changes: * Added `NoCompute` field for [apps.CreateAppRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#CreateAppRequest). * Added `HasMore` field for [jobs.BaseJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseJob). * Added `HasMore` field for [jobs.BaseRun](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun). * Added `PageToken` field for [jobs.GetJobRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#GetJobRequest). * Added `HasMore` and `NextPageToken` fields for [jobs.Job](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Job). * Added `HasMore` field for [jobs.Run](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run). * Added `RunAs` field for [pipelines.CreatePipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#CreatePipeline). * Added `RunAs` field for [pipelines.EditPipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#EditPipeline). * Added `AuthorizationDetails` and `EndpointUrl` fields for [serving.DataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#DataPlaneInfo). * Added . * Changed `Update` method for [a.AccountFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#AccountFederationPolicyAPI) account-level service with new required argument order. * Changed `Update` method for [a.ServicePrincipalFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#ServicePrincipalFederationPolicyAPI) account-level service with new required argument order. * Changed `UpdateMask` field for [oauth2.UpdateAccountFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateAccountFederationPolicyRequest) to no longer be required. * Changed `UpdateMask` field for [oauth2.UpdateServicePrincipalFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateServicePrincipalFederationPolicyRequest) to no longer be required. * Changed `DaysOfWeek` field for [pipelines.RestartWindow](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#RestartWindow) to type [pipelines.DayOfWeekList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#DayOfWeekList). OpenAPI SHA: 779817ed8d63031f5ea761fbd25ee84f38feec0d, Date: 2025-01-08 --- .codegen/_openapi_sha | 2 +- CHANGELOG.md | 33 +++++++++++++++ service/oauth2/model.go | 44 +++++++++++++++----- service/pipelines/model.go | 82 +++++++++++++++++++------------------- service/pkg.go | 2 +- version/version.go | 2 +- 6 files changed, 111 insertions(+), 54 deletions(-) diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index e43e9607f..dfe78790a 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -1668b0db17e23605f8c9d29fb3b674c01590732d \ No newline at end of file +779817ed8d63031f5ea761fbd25ee84f38feec0d \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ca019db9a..cdaf1b0a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,38 @@ # Version changelog +## [Release] Release v0.55.0 + +### Internal Changes + + * Bump staticcheck to 0.5.1 and add go 1.23 test coverage ([#1106](https://github.com/databricks/databricks-sdk-go/pull/1106)). + * Bump x/net, x/crypto dependencies ([#1107](https://github.com/databricks/databricks-sdk-go/pull/1107)). + * Create custom codeql.yml ([#1114](https://github.com/databricks/databricks-sdk-go/pull/1114)). + * Decouple serving and oauth2 package ([#1110](https://github.com/databricks/databricks-sdk-go/pull/1110)). + * Migrate workflows that need write access to use hosted runners ([#1112](https://github.com/databricks/databricks-sdk-go/pull/1112)). + * Move package credentials in config ([#1115](https://github.com/databricks/databricks-sdk-go/pull/1115)). + * Update Queries test ([#1104](https://github.com/databricks/databricks-sdk-go/pull/1104)). + + +### API Changes: + + * Added `NoCompute` field for [apps.CreateAppRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#CreateAppRequest). + * Added `HasMore` field for [jobs.BaseJob](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseJob). + * Added `HasMore` field for [jobs.BaseRun](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#BaseRun). + * Added `PageToken` field for [jobs.GetJobRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#GetJobRequest). + * Added `HasMore` and `NextPageToken` fields for [jobs.Job](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Job). + * Added `HasMore` field for [jobs.Run](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/jobs#Run). + * Added `RunAs` field for [pipelines.CreatePipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#CreatePipeline). + * Added `RunAs` field for [pipelines.EditPipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#EditPipeline). + * Added `AuthorizationDetails` and `EndpointUrl` fields for [serving.DataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#DataPlaneInfo). + * Added . + * Changed `Update` method for [a.AccountFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#AccountFederationPolicyAPI) account-level service with new required argument order. + * Changed `Update` method for [a.ServicePrincipalFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#ServicePrincipalFederationPolicyAPI) account-level service with new required argument order. + * Changed `UpdateMask` field for [oauth2.UpdateAccountFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateAccountFederationPolicyRequest) to no longer be required. + * Changed `UpdateMask` field for [oauth2.UpdateServicePrincipalFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateServicePrincipalFederationPolicyRequest) to no longer be required. + * Changed `DaysOfWeek` field for [pipelines.RestartWindow](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#RestartWindow) to type [pipelines.DayOfWeekList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#DayOfWeekList). + +OpenAPI SHA: 779817ed8d63031f5ea761fbd25ee84f38feec0d, Date: 2025-01-08 + ## [Release] Release v0.54.0 ### API Changes: diff --git a/service/oauth2/model.go b/service/oauth2/model.go index 08de08f93..a448d1690 100755 --- a/service/oauth2/model.go +++ b/service/oauth2/model.go @@ -625,11 +625,23 @@ type UpdateAccountFederationPolicyRequest struct { Policy *FederationPolicy `json:"policy,omitempty"` // The identifier for the federation policy. PolicyId string `json:"-" url:"-"` - // Field mask is required to be passed into the PATCH request. Field mask - // specifies which fields of the setting payload will be updated. The field - // mask needs to be supplied as single string. To specify multiple fields in - // the field mask, use comma as the separator (no space). - UpdateMask string `json:"-" url:"update_mask"` + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateAccountFederationPolicyRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateAccountFederationPolicyRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } type UpdateCustomAppIntegration struct { @@ -660,9 +672,21 @@ type UpdateServicePrincipalFederationPolicyRequest struct { PolicyId string `json:"-" url:"-"` // The service principal id for the federation policy. ServicePrincipalId int64 `json:"-" url:"-"` - // Field mask is required to be passed into the PATCH request. Field mask - // specifies which fields of the setting payload will be updated. The field - // mask needs to be supplied as single string. To specify multiple fields in - // the field mask, use comma as the separator (no space). - UpdateMask string `json:"-" url:"update_mask"` + // The field mask specifies which fields of the policy to update. To specify + // multiple fields in the field mask, use comma as the separator (no space). + // The special value '*' indicates that all fields should be updated (full + // replacement). If unspecified, all fields that are set in the policy + // provided in the update request will overwrite the corresponding fields in + // the existing policy. Example value: 'description,oidc_policy.audiences'. + UpdateMask string `json:"-" url:"update_mask,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *UpdateServicePrincipalFederationPolicyRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s UpdateServicePrincipalFederationPolicyRequest) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) } diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 04f110841..c3df70125 100755 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -140,6 +140,46 @@ func (s DataPlaneId) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Days of week in which the restart is allowed to happen (within a five-hour +// window starting at start_hour). If not specified all days of the week will be +// used. +type DayOfWeek string + +const DayOfWeekFriday DayOfWeek = `FRIDAY` + +const DayOfWeekMonday DayOfWeek = `MONDAY` + +const DayOfWeekSaturday DayOfWeek = `SATURDAY` + +const DayOfWeekSunday DayOfWeek = `SUNDAY` + +const DayOfWeekThursday DayOfWeek = `THURSDAY` + +const DayOfWeekTuesday DayOfWeek = `TUESDAY` + +const DayOfWeekWednesday DayOfWeek = `WEDNESDAY` + +// String representation for [fmt.Print] +func (f *DayOfWeek) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *DayOfWeek) Set(v string) error { + switch v { + case `FRIDAY`, `MONDAY`, `SATURDAY`, `SUNDAY`, `THURSDAY`, `TUESDAY`, `WEDNESDAY`: + *f = DayOfWeek(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"`, v) + } +} + +// Type always returns DayOfWeek to satisfy [pflag.Value] interface +func (f *DayOfWeek) Type() string { + return "DayOfWeek" +} + // Delete a pipeline type DeletePipelineRequest struct { PipelineId string `json:"-" url:"-"` @@ -1329,7 +1369,7 @@ type RestartWindow struct { // Days of week in which the restart is allowed to happen (within a // five-hour window starting at start_hour). If not specified all days of // the week will be used. - DaysOfWeek []RestartWindowDaysOfWeek `json:"days_of_week,omitempty"` + DaysOfWeek []DayOfWeek `json:"days_of_week,omitempty"` // An integer between 0 and 23 denoting the start hour for the restart // window in the 24-hour day. Continuous pipeline restart is triggered only // within a five-hour window starting at this hour. @@ -1350,46 +1390,6 @@ func (s RestartWindow) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// Days of week in which the restart is allowed to happen (within a five-hour -// window starting at start_hour). If not specified all days of the week will be -// used. -type RestartWindowDaysOfWeek string - -const RestartWindowDaysOfWeekFriday RestartWindowDaysOfWeek = `FRIDAY` - -const RestartWindowDaysOfWeekMonday RestartWindowDaysOfWeek = `MONDAY` - -const RestartWindowDaysOfWeekSaturday RestartWindowDaysOfWeek = `SATURDAY` - -const RestartWindowDaysOfWeekSunday RestartWindowDaysOfWeek = `SUNDAY` - -const RestartWindowDaysOfWeekThursday RestartWindowDaysOfWeek = `THURSDAY` - -const RestartWindowDaysOfWeekTuesday RestartWindowDaysOfWeek = `TUESDAY` - -const RestartWindowDaysOfWeekWednesday RestartWindowDaysOfWeek = `WEDNESDAY` - -// String representation for [fmt.Print] -func (f *RestartWindowDaysOfWeek) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *RestartWindowDaysOfWeek) Set(v string) error { - switch v { - case `FRIDAY`, `MONDAY`, `SATURDAY`, `SUNDAY`, `THURSDAY`, `TUESDAY`, `WEDNESDAY`: - *f = RestartWindowDaysOfWeek(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"`, v) - } -} - -// Type always returns RestartWindowDaysOfWeek to satisfy [pflag.Value] interface -func (f *RestartWindowDaysOfWeek) Type() string { - return "RestartWindowDaysOfWeek" -} - // Write-only setting, available only in Create/Update calls. Specifies the user // or service principal that the pipeline runs as. If not specified, the // pipeline runs as the user who created the pipeline. diff --git a/service/pkg.go b/service/pkg.go index b891a9547..0e5a53e7e 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -323,8 +323,8 @@ var ( _ *marketplace.ConsumerListingsAPI = nil _ *marketplace.ConsumerPersonalizationRequestsAPI = nil _ *marketplace.ConsumerProvidersAPI = nil - _ *provisioning.CredentialsAPI = nil _ *catalog.CredentialsAPI = nil + _ *provisioning.CredentialsAPI = nil _ *settings.CredentialsManagerAPI = nil _ *settings.CspEnablementAccountAPI = nil _ *iam.CurrentUserAPI = nil diff --git a/version/version.go b/version/version.go index bac14e8c6..142d27dac 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // Version of the SDK, updated manually before every tag -const Version = "0.54.0" +const Version = "0.55.0" From 6d6ee115b2400d712cc4e96f4143de37d90466dc Mon Sep 17 00:00:00 2001 From: Parth Bansal Date: Thu, 9 Jan 2025 14:19:26 +0100 Subject: [PATCH 2/2] address comments --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdaf1b0a4..a9036ffa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,12 +24,11 @@ * Added `RunAs` field for [pipelines.CreatePipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#CreatePipeline). * Added `RunAs` field for [pipelines.EditPipeline](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#EditPipeline). * Added `AuthorizationDetails` and `EndpointUrl` fields for [serving.DataPlaneInfo](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#DataPlaneInfo). - * Added . - * Changed `Update` method for [a.AccountFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#AccountFederationPolicyAPI) account-level service with new required argument order. - * Changed `Update` method for [a.ServicePrincipalFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#ServicePrincipalFederationPolicyAPI) account-level service with new required argument order. + * [Breaking] Changed `Update` method for [a.AccountFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#AccountFederationPolicyAPI) account-level service with new required argument order. + * [Breaking] Changed `Update` method for [a.ServicePrincipalFederationPolicy](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#ServicePrincipalFederationPolicyAPI) account-level service with new required argument order. * Changed `UpdateMask` field for [oauth2.UpdateAccountFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateAccountFederationPolicyRequest) to no longer be required. * Changed `UpdateMask` field for [oauth2.UpdateServicePrincipalFederationPolicyRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/oauth2#UpdateServicePrincipalFederationPolicyRequest) to no longer be required. - * Changed `DaysOfWeek` field for [pipelines.RestartWindow](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#RestartWindow) to type [pipelines.DayOfWeekList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#DayOfWeekList). + * [Breaking] Changed `DaysOfWeek` field for [pipelines.RestartWindow](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#RestartWindow) to type [pipelines.DayOfWeekList](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#DayOfWeekList). OpenAPI SHA: 779817ed8d63031f5ea761fbd25ee84f38feec0d, Date: 2025-01-08