From f3d472964910e285f993bd2c5454666464864210 Mon Sep 17 00:00:00 2001 From: "databricks-ci-ghec-2[bot]" <184307802+databricks-ci-ghec-2[bot]@users.noreply.github.com> Date: Thu, 17 Sep 2026 05:14:56 +0000 Subject: [PATCH] Update SDK to 463ed2cce38f6306936a13c3a51822d7999553c3 --- .codegen/_openapi_sha | 2 +- NEXT_CHANGELOG.md | 3 + account_client.go | 2 +- .../catalog/mock_ai_gateway_interface.go | 177 ++++++++++++++++++ service/catalog/api.go | 26 +++ service/catalog/impl.go | 43 +++++ service/catalog/interface.go | 29 +++ service/catalog/model.go | 69 +++++++ service/iamv2/api.go | 4 +- service/iamv2/interface.go | 4 +- service/iamv2/model.go | 42 ++--- service/pipelines/model.go | 140 +++++++++++++- service/pkg.go | 4 +- workspace_client.go | 2 +- 14 files changed, 515 insertions(+), 32 deletions(-) mode change 100755 => 100644 account_client.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index a92ff0f06..f26953677 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -5c5ba67b19bb31f9cbfffa3ce267955c8141ed40 \ No newline at end of file +463ed2cce38f6306936a13c3a51822d7999553c3 \ No newline at end of file diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index d0e65ed0c..d811fb271 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -15,3 +15,6 @@ - Reduce integration test cluster usage by replacing waiter coverage with HTTP fixtures and removing redundant live tests. ### API Changes +* Add `CreateMcpServiceUserMappedCredential`, `DeleteMcpServiceUserMappedCredential` and `GetMcpServiceUserMappedCredential` methods for [w.AiGateway](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#AiGatewayAPI) workspace-level service. +* Add `AvroOptions` and `ProtobufOptions` fields for [pipelines.Transformer](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#Transformer). +* Add `Avro` and `Protobuf` enum values for [pipelines.TransformerFormat](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#TransformerFormat). \ No newline at end of file diff --git a/account_client.go b/account_client.go old mode 100755 new mode 100644 index 6182a005b..9a04fa828 --- a/account_client.go +++ b/account_client.go @@ -144,7 +144,7 @@ type AccountClient struct { GroupsV2 iam.AccountGroupsV2Interface // These APIs are used to manage identities and the workspace access of - // these identities in . + // these identities in Databricks. IamV2 iamv2.AccountIamV2Interface // The Accounts IP Access List API enables account admins to configure IP diff --git a/experimental/mocks/service/catalog/mock_ai_gateway_interface.go b/experimental/mocks/service/catalog/mock_ai_gateway_interface.go index 06f3bac3e..db899ac7f 100644 --- a/experimental/mocks/service/catalog/mock_ai_gateway_interface.go +++ b/experimental/mocks/service/catalog/mock_ai_gateway_interface.go @@ -82,6 +82,65 @@ func (_c *MockAiGatewayInterface_CreateMcpService_Call) RunAndReturn(run func(co return _c } +// CreateMcpServiceUserMappedCredential provides a mock function with given fields: ctx, request +func (_m *MockAiGatewayInterface) CreateMcpServiceUserMappedCredential(ctx context.Context, request catalog.CreateMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for CreateMcpServiceUserMappedCredential") + } + + var r0 *catalog.McpServiceUserMappedCredential + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateMcpServiceUserMappedCredentialRequest) *catalog.McpServiceUserMappedCredential); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.McpServiceUserMappedCredential) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateMcpServiceUserMappedCredentialRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateMcpServiceUserMappedCredential' +type MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call struct { + *mock.Call +} + +// CreateMcpServiceUserMappedCredential is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateMcpServiceUserMappedCredentialRequest +func (_e *MockAiGatewayInterface_Expecter) CreateMcpServiceUserMappedCredential(ctx interface{}, request interface{}) *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call { + return &MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call{Call: _e.mock.On("CreateMcpServiceUserMappedCredential", ctx, request)} +} + +func (_c *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call) Run(run func(ctx context.Context, request catalog.CreateMcpServiceUserMappedCredentialRequest)) *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateMcpServiceUserMappedCredentialRequest)) + }) + return _c +} + +func (_c *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call) Return(_a0 *catalog.McpServiceUserMappedCredential, _a1 error) *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call) RunAndReturn(run func(context.Context, catalog.CreateMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error)) *MockAiGatewayInterface_CreateMcpServiceUserMappedCredential_Call { + _c.Call.Return(run) + return _c +} + // CreateModelProviderService provides a mock function with given fields: ctx, request func (_m *MockAiGatewayInterface) CreateModelProviderService(ctx context.Context, request catalog.CreateModelProviderServiceRequest) (*catalog.ModelProviderService, error) { ret := _m.Called(ctx, request) @@ -247,6 +306,65 @@ func (_c *MockAiGatewayInterface_DeleteMcpService_Call) RunAndReturn(run func(co return _c } +// DeleteMcpServiceUserMappedCredential provides a mock function with given fields: ctx, request +func (_m *MockAiGatewayInterface) DeleteMcpServiceUserMappedCredential(ctx context.Context, request catalog.DeleteMcpServiceUserMappedCredentialRequest) (*catalog.DeleteMcpServiceUserMappedCredentialResponse, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for DeleteMcpServiceUserMappedCredential") + } + + var r0 *catalog.DeleteMcpServiceUserMappedCredentialResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteMcpServiceUserMappedCredentialRequest) (*catalog.DeleteMcpServiceUserMappedCredentialResponse, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteMcpServiceUserMappedCredentialRequest) *catalog.DeleteMcpServiceUserMappedCredentialResponse); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.DeleteMcpServiceUserMappedCredentialResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.DeleteMcpServiceUserMappedCredentialRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteMcpServiceUserMappedCredential' +type MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call struct { + *mock.Call +} + +// DeleteMcpServiceUserMappedCredential is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteMcpServiceUserMappedCredentialRequest +func (_e *MockAiGatewayInterface_Expecter) DeleteMcpServiceUserMappedCredential(ctx interface{}, request interface{}) *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call { + return &MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call{Call: _e.mock.On("DeleteMcpServiceUserMappedCredential", ctx, request)} +} + +func (_c *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call) Run(run func(ctx context.Context, request catalog.DeleteMcpServiceUserMappedCredentialRequest)) *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteMcpServiceUserMappedCredentialRequest)) + }) + return _c +} + +func (_c *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call) Return(_a0 *catalog.DeleteMcpServiceUserMappedCredentialResponse, _a1 error) *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call) RunAndReturn(run func(context.Context, catalog.DeleteMcpServiceUserMappedCredentialRequest) (*catalog.DeleteMcpServiceUserMappedCredentialResponse, error)) *MockAiGatewayInterface_DeleteMcpServiceUserMappedCredential_Call { + _c.Call.Return(run) + return _c +} + // DeleteModelProviderService provides a mock function with given fields: ctx, request func (_m *MockAiGatewayInterface) DeleteModelProviderService(ctx context.Context, request catalog.DeleteModelProviderServiceRequest) error { ret := _m.Called(ctx, request) @@ -400,6 +518,65 @@ func (_c *MockAiGatewayInterface_GetMcpService_Call) RunAndReturn(run func(conte return _c } +// GetMcpServiceUserMappedCredential provides a mock function with given fields: ctx, request +func (_m *MockAiGatewayInterface) GetMcpServiceUserMappedCredential(ctx context.Context, request catalog.GetMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for GetMcpServiceUserMappedCredential") + } + + var r0 *catalog.McpServiceUserMappedCredential + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetMcpServiceUserMappedCredentialRequest) *catalog.McpServiceUserMappedCredential); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.McpServiceUserMappedCredential) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetMcpServiceUserMappedCredentialRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMcpServiceUserMappedCredential' +type MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call struct { + *mock.Call +} + +// GetMcpServiceUserMappedCredential is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetMcpServiceUserMappedCredentialRequest +func (_e *MockAiGatewayInterface_Expecter) GetMcpServiceUserMappedCredential(ctx interface{}, request interface{}) *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call { + return &MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call{Call: _e.mock.On("GetMcpServiceUserMappedCredential", ctx, request)} +} + +func (_c *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call) Run(run func(ctx context.Context, request catalog.GetMcpServiceUserMappedCredentialRequest)) *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetMcpServiceUserMappedCredentialRequest)) + }) + return _c +} + +func (_c *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call) Return(_a0 *catalog.McpServiceUserMappedCredential, _a1 error) *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call) RunAndReturn(run func(context.Context, catalog.GetMcpServiceUserMappedCredentialRequest) (*catalog.McpServiceUserMappedCredential, error)) *MockAiGatewayInterface_GetMcpServiceUserMappedCredential_Call { + _c.Call.Return(run) + return _c +} + // GetModelProviderService provides a mock function with given fields: ctx, request func (_m *MockAiGatewayInterface) GetModelProviderService(ctx context.Context, request catalog.GetModelProviderServiceRequest) (*catalog.ModelProviderService, error) { ret := _m.Called(ctx, request) diff --git a/service/catalog/api.go b/service/catalog/api.go index 5d358886a..1ace4440a 100644 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -262,6 +262,14 @@ type AiGatewayInterface interface { // references. CreateMcpService(ctx context.Context, request CreateMcpServiceRequest) (*McpService, error) + // Logs the caller in to an MCP service: creates their per-user OAuth + // credential, or re-authenticates it if one already exists. The request body + // carries the OAuth exchange fields. + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent schema. + CreateMcpServiceUserMappedCredential(ctx context.Context, request CreateMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) + // Creates a model provider service in a Unity Catalog schema. A model provider // service stores authentication and request configuration for an external model // provider, such as OpenAI, Azure OpenAI, or Amazon Bedrock. Model services @@ -296,6 +304,13 @@ type AiGatewayInterface interface { // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent schema. DeleteMcpService(ctx context.Context, request DeleteMcpServiceRequest) error + // Revokes (deletes) the caller's per-user OAuth credential for an MCP service + // (logout). + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent schema. + DeleteMcpServiceUserMappedCredential(ctx context.Context, request DeleteMcpServiceUserMappedCredentialRequest) (*DeleteMcpServiceUserMappedCredentialResponse, error) + // Deletes the model provider service identified by its resource name. // Optionally supply an `etag` to make the delete conditional on the model // provider service not having changed since it was read. @@ -320,6 +335,17 @@ type AiGatewayInterface interface { // on the parent schema. GetMcpService(ctx context.Context, request GetMcpServiceRequest) (*McpService, error) + // Returns the caller's per-user OAuth login state for an MCP service. Read + // `provisioning_info.state`: `ACTIVE` means the caller is logged in and the + // credential is usable; any other state (for example a failed or + // still-provisioning login) means the login has not completed and the caller + // should log in again. If the caller has no credential yet, the RPC returns + // `NOT_FOUND`. + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent schema. + GetMcpServiceUserMappedCredential(ctx context.Context, request GetMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) + // Returns the model provider service identified by its resource name. // // You must be the owner of the model provider service or have `EXECUTE`, diff --git a/service/catalog/impl.go b/service/catalog/impl.go index e7b5f6895..e065ef820 100644 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -309,6 +309,21 @@ func (a *aiGatewayImpl) CreateMcpService(ctx context.Context, request CreateMcpS return &mcpService, err } +func (a *aiGatewayImpl) CreateMcpServiceUserMappedCredential(ctx context.Context, request CreateMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) { + var mcpServiceUserMappedCredential McpServiceUserMappedCredential + path := fmt.Sprintf("/api/2.1/unity-catalog/%v/user-credentials", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPost, path, headers, queryParams, request.Login, &mcpServiceUserMappedCredential) + return &mcpServiceUserMappedCredential, err +} + func (a *aiGatewayImpl) CreateModelProviderService(ctx context.Context, request CreateModelProviderServiceRequest) (*ModelProviderService, error) { var modelProviderService ModelProviderService path := "/api/2.1/unity-catalog/model-provider-services" @@ -368,6 +383,20 @@ func (a *aiGatewayImpl) DeleteMcpService(ctx context.Context, request DeleteMcpS return err } +func (a *aiGatewayImpl) DeleteMcpServiceUserMappedCredential(ctx context.Context, request DeleteMcpServiceUserMappedCredentialRequest) (*DeleteMcpServiceUserMappedCredentialResponse, error) { + var deleteMcpServiceUserMappedCredentialResponse DeleteMcpServiceUserMappedCredentialResponse + path := fmt.Sprintf("/api/2.1/unity-catalog/%v/user-credentials", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodDelete, path, headers, queryParams, request, &deleteMcpServiceUserMappedCredentialResponse) + return &deleteMcpServiceUserMappedCredentialResponse, err +} + func (a *aiGatewayImpl) DeleteModelProviderService(ctx context.Context, request DeleteModelProviderServiceRequest) error { path := fmt.Sprintf("/api/2.1/unity-catalog/%v", request.Name) queryParams := make(map[string]any) @@ -408,6 +437,20 @@ func (a *aiGatewayImpl) GetMcpService(ctx context.Context, request GetMcpService return &mcpService, err } +func (a *aiGatewayImpl) GetMcpServiceUserMappedCredential(ctx context.Context, request GetMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) { + var mcpServiceUserMappedCredential McpServiceUserMappedCredential + path := fmt.Sprintf("/api/2.1/unity-catalog/%v/user-credentials", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodGet, path, headers, queryParams, request, &mcpServiceUserMappedCredential) + return &mcpServiceUserMappedCredential, err +} + func (a *aiGatewayImpl) GetModelProviderService(ctx context.Context, request GetModelProviderServiceRequest) (*ModelProviderService, error) { var modelProviderService ModelProviderService path := fmt.Sprintf("/api/2.1/unity-catalog/%v", request.Name) diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 9d600ee03..e4abab27f 100644 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -108,6 +108,15 @@ type AiGatewayService interface { // service references. CreateMcpService(ctx context.Context, request CreateMcpServiceRequest) (*McpService, error) + // Logs the caller in to an MCP service: creates their per-user OAuth + // credential, or re-authenticates it if one already exists. The request + // body carries the OAuth exchange fields. + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent + // schema. + CreateMcpServiceUserMappedCredential(ctx context.Context, request CreateMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) + // Creates a model provider service in a Unity Catalog schema. A model // provider service stores authentication and request configuration for an // external model provider, such as OpenAI, Azure OpenAI, or Amazon Bedrock. @@ -143,6 +152,14 @@ type AiGatewayService interface { // schema. DeleteMcpService(ctx context.Context, request DeleteMcpServiceRequest) error + // Revokes (deletes) the caller's per-user OAuth credential for an MCP + // service (logout). + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent + // schema. + DeleteMcpServiceUserMappedCredential(ctx context.Context, request DeleteMcpServiceUserMappedCredentialRequest) (*DeleteMcpServiceUserMappedCredentialResponse, error) + // Deletes the model provider service identified by its resource name. // Optionally supply an `etag` to make the delete conditional on the model // provider service not having changed since it was read. @@ -168,6 +185,18 @@ type AiGatewayService interface { // catalog and `USE_SCHEMA` on the parent schema. GetMcpService(ctx context.Context, request GetMcpServiceRequest) (*McpService, error) + // Returns the caller's per-user OAuth login state for an MCP service. Read + // `provisioning_info.state`: `ACTIVE` means the caller is logged in and the + // credential is usable; any other state (for example a failed or + // still-provisioning login) means the login has not completed and the + // caller should log in again. If the caller has no credential yet, the RPC + // returns `NOT_FOUND`. + // + // You must be the owner of the MCP service or have `EXECUTE` on it, plus + // `USE_CATALOG` on the parent catalog and `USE_SCHEMA` on the parent + // schema. + GetMcpServiceUserMappedCredential(ctx context.Context, request GetMcpServiceUserMappedCredentialRequest) (*McpServiceUserMappedCredential, error) + // Returns the model provider service identified by its resource name. // // You must be the owner of the model provider service or have `EXECUTE`, diff --git a/service/catalog/model.go b/service/catalog/model.go index 591cad347..9e1f71311 100644 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -1730,6 +1730,17 @@ func (s *CreateMcpServiceRequest) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } +type CreateMcpServiceUserMappedCredentialRequest struct { + Login McpServiceUserMappedCredentialLogin `json:"login"` + // Resource name of the MCP service. Format: + // `mcp-services/{catalog}.{schema}.{mcp_service}`. + Name string `json:"-" url:"-"` +} + +func (s *CreateMcpServiceUserMappedCredentialRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + type CreateMetastore struct { // Whether to allow non-DBR clients to directly access entities under the // metastore. @@ -2637,6 +2648,25 @@ func (s DeleteMcpServiceRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type DeleteMcpServiceUserMappedCredentialRequest struct { + // Resource name of the MCP service. Format: + // `mcp-services/{catalog}.{schema}.{mcp_service}`. + Name string `json:"-" url:"-"` +} + +func (s *DeleteMcpServiceUserMappedCredentialRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Delete returns no resource; a dedicated (empty) response keeps the revoke +// RPC's shape owned here rather than google.protobuf.Empty. +type DeleteMcpServiceUserMappedCredentialResponse struct { +} + +func (s *DeleteMcpServiceUserMappedCredentialResponse) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + type DeleteMetastoreRequest struct { // Force deletion even if the metastore is not empty. Default is false. Force bool `json:"-" url:"force,omitempty"` @@ -4548,6 +4578,16 @@ func (s *GetMcpServiceRequest) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } +type GetMcpServiceUserMappedCredentialRequest struct { + // Resource name of the MCP service. Format: + // `mcp-services/{catalog}.{schema}.{mcp_service}`. + Name string `json:"-" url:"-"` +} + +func (s *GetMcpServiceUserMappedCredentialRequest) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + type GetMetastoreRequest struct { // Unique ID of the metastore. Id string `json:"-" url:"-"` @@ -6466,6 +6506,35 @@ func (s McpServiceConfigSourceConnection) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// A caller's per-user OAuth credential for an MCP service. +type McpServiceUserMappedCredential struct { + // Token-expiry info for the credential, returned as a flat map: + // `access_token_expiration` (always set) and `refresh_token_expiration` + // (set when the credential has a refresh token). Both values are + // timestamps. + Options map[string]string `json:"options,omitempty"` + // Provisioning state of the credential. `ACTIVE` means the caller is logged + // in and the credential is usable; any other state means the login has not + // completed. + ProvisioningInfo *ProvisioningInfo `json:"provisioning_info,omitempty"` +} + +func (s *McpServiceUserMappedCredential) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +// Login input for an MCP service user credential. Carries the OAuth exchange +// fields as a flat map. +type McpServiceUserMappedCredentialLogin struct { + // OAuth exchange fields: `pkce_verifier`, `authorization_code`, and + // `oauth_redirect_uri`. + Options map[string]string `json:"options,omitempty"` +} + +func (s *McpServiceUserMappedCredentialLogin) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + type MetastoreAssignment struct { // The name of the default catalog in the metastore. This field is // deprecated. Please use "Default Namespace API" to configure the default diff --git a/service/iamv2/api.go b/service/iamv2/api.go index 5dee3c450..333f80e48 100644 --- a/service/iamv2/api.go +++ b/service/iamv2/api.go @@ -274,7 +274,7 @@ func NewAccountIamV2(client *client.DatabricksClient) *AccountIamV2API { } // These APIs are used to manage identities and the workspace access of these -// identities in . +// identities in Databricks. type AccountIamV2API struct { accountIamV2Impl } @@ -566,7 +566,7 @@ func NewWorkspaceIamV2(client *client.DatabricksClient) *WorkspaceIamV2API { } // These APIs are used to manage identities and the workspace access of these -// identities in . +// identities in Databricks. type WorkspaceIamV2API struct { workspaceIamV2Impl } diff --git a/service/iamv2/interface.go b/service/iamv2/interface.go index 21651051f..ec512c2ba 100644 --- a/service/iamv2/interface.go +++ b/service/iamv2/interface.go @@ -7,7 +7,7 @@ import ( ) // These APIs are used to manage identities and the workspace access of these -// identities in . +// identities in Databricks. // // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type AccountIamV2Service interface { @@ -220,7 +220,7 @@ type AccountIamV2Service interface { } // These APIs are used to manage identities and the workspace access of these -// identities in . +// identities in Databricks. // // Deprecated: Do not use this interface, it will be removed in a future version of the SDK. type WorkspaceIamV2Service interface { diff --git a/service/iamv2/model.go b/service/iamv2/model.go index 26a474512..a3db98ac9 100644 --- a/service/iamv2/model.go +++ b/service/iamv2/model.go @@ -32,7 +32,7 @@ func (s *CreateDirectGroupMemberRequest) UnmarshalJSON(b []byte) error { } type CreateGroupProxyRequest struct { - // Required. Group to be created in + // Required. Group to be created in Databricks Group Group `json:"group"` } @@ -41,7 +41,7 @@ func (s *CreateGroupProxyRequest) UnmarshalJSON(b []byte) error { } type CreateGroupRequest struct { - // Required. Group to be created in + // Required. Group to be created in Databricks Group Group `json:"group"` } @@ -50,7 +50,7 @@ func (s *CreateGroupRequest) UnmarshalJSON(b []byte) error { } type CreateServicePrincipalProxyRequest struct { - // Required. Service principal to be created in + // Required. Service principal to be created in Databricks ServicePrincipal ServicePrincipal `json:"service_principal"` } @@ -59,7 +59,7 @@ func (s *CreateServicePrincipalProxyRequest) UnmarshalJSON(b []byte) error { } type CreateServicePrincipalRequest struct { - // Required. Service principal to be created in + // Required. Service principal to be created in Databricks ServicePrincipal ServicePrincipal `json:"service_principal"` } @@ -68,7 +68,7 @@ func (s *CreateServicePrincipalRequest) UnmarshalJSON(b []byte) error { } type CreateUserProxyRequest struct { - // Required. User to be created in + // Required. User to be created in Databricks User User `json:"user"` } @@ -77,7 +77,7 @@ func (s *CreateUserProxyRequest) UnmarshalJSON(b []byte) error { } type CreateUserRequest struct { - // Required. User to be created in + // Required. User to be created in Databricks User User `json:"user"` } @@ -86,7 +86,7 @@ func (s *CreateUserRequest) UnmarshalJSON(b []byte) error { } type CreateWorkspaceAssignmentDetailProxyRequest struct { - // Required. Workspace assignment detail to be created in . + // Required. Workspace assignment detail to be created in Databricks. WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"` } @@ -95,7 +95,7 @@ func (s *CreateWorkspaceAssignmentDetailProxyRequest) UnmarshalJSON(b []byte) er } type CreateWorkspaceAssignmentDetailRequest struct { - // Required. Workspace assignment detail to be created in . + // Required. Workspace assignment detail to be created in Databricks. WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"` // Required. The workspace ID for which the workspace assignment detail is // being created. @@ -107,7 +107,7 @@ func (s *CreateWorkspaceAssignmentDetailRequest) UnmarshalJSON(b []byte) error { } type CreateWorkspaceAssignmentProxyRequest struct { - // Required. Workspace assignment to be created in . + // Required. Workspace assignment to be created in Databricks. WorkspaceAssignment WorkspaceAssignment `json:"workspace_assignment"` } @@ -116,7 +116,7 @@ func (s *CreateWorkspaceAssignmentProxyRequest) UnmarshalJSON(b []byte) error { } type CreateWorkspaceAssignmentRequest struct { - // Required. Workspace assignment to be created in . + // Required. Workspace assignment to be created in Databricks. WorkspaceAssignment WorkspaceAssignment `json:"workspace_assignment"` // Required. The workspace ID for which the workspace assignment is being // created. @@ -1401,7 +1401,7 @@ func (s TransitiveParentGroup) MarshalJSON() ([]byte, error) { } type UpdateGroupProxyRequest struct { - // Required. Group to be updated in + // Required. Group to be updated in Databricks Group Group `json:"group"` // Required. Internal ID of the group in Databricks. GroupId string `json:"-" url:"-"` @@ -1414,7 +1414,7 @@ func (s *UpdateGroupProxyRequest) UnmarshalJSON(b []byte) error { } type UpdateGroupRequest struct { - // Required. Group to be updated in + // Required. Group to be updated in Databricks Group Group `json:"group"` // Required. Internal ID of the group in Databricks. GroupId string `json:"-" url:"-"` @@ -1427,7 +1427,7 @@ func (s *UpdateGroupRequest) UnmarshalJSON(b []byte) error { } type UpdateServicePrincipalProxyRequest struct { - // Required. Service principal to be updated in + // Required. Service principal to be updated in Databricks ServicePrincipal ServicePrincipal `json:"service_principal"` // Required. Internal ID of the service principal in Databricks. ServicePrincipalId string `json:"-" url:"-"` @@ -1440,7 +1440,7 @@ func (s *UpdateServicePrincipalProxyRequest) UnmarshalJSON(b []byte) error { } type UpdateServicePrincipalRequest struct { - // Required. Service Principal to be updated in + // Required. Service Principal to be updated in Databricks ServicePrincipal ServicePrincipal `json:"service_principal"` // Required. Internal ID of the service principal in Databricks. ServicePrincipalId string `json:"-" url:"-"` @@ -1455,7 +1455,7 @@ func (s *UpdateServicePrincipalRequest) UnmarshalJSON(b []byte) error { type UpdateUserProxyRequest struct { // Optional. The list of fields to update. UpdateMask string `json:"-" url:"update_mask"` - // Required. User to be updated in + // Required. User to be updated in Databricks User User `json:"user"` // Required. Internal ID of the user in Databricks. UserId string `json:"-" url:"-"` @@ -1468,7 +1468,7 @@ func (s *UpdateUserProxyRequest) UnmarshalJSON(b []byte) error { type UpdateUserRequest struct { // Optional. The list of fields to update. UpdateMask string `json:"-" url:"update_mask"` - // Required. User to be updated in + // Required. User to be updated in Databricks User User `json:"user"` // Required. Internal ID of the user in Databricks. UserId string `json:"-" url:"-"` @@ -1483,7 +1483,7 @@ type UpdateWorkspaceAssignmentDetailProxyRequest struct { PrincipalId int64 `json:"-" url:"-"` // Required. The list of fields to update. UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` - // Required. Workspace assignment detail to be updated in . + // Required. Workspace assignment detail to be updated in Databricks. WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"` } @@ -1496,7 +1496,7 @@ type UpdateWorkspaceAssignmentDetailRequest struct { PrincipalId int64 `json:"-" url:"-"` // Required. The list of fields to update. UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` - // Required. Workspace assignment detail to be updated in . + // Required. Workspace assignment detail to be updated in Databricks. WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"` // Required. The workspace ID for which the workspace assignment detail is // being updated. @@ -1512,7 +1512,7 @@ type UpdateWorkspaceAssignmentProxyRequest struct { PrincipalId int64 `json:"-" url:"-"` // Required. The list of fields to update. UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` - // Required. Workspace assignment to be updated in . + // Required. Workspace assignment to be updated in Databricks. WorkspaceAssignment WorkspaceAssignment `json:"workspace_assignment"` } @@ -1525,7 +1525,7 @@ type UpdateWorkspaceAssignmentRequest struct { PrincipalId int64 `json:"-" url:"-"` // Required. The list of fields to update. UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` - // Required. Workspace assignment to be updated in . + // Required. Workspace assignment to be updated in Databricks. WorkspaceAssignment WorkspaceAssignment `json:"workspace_assignment"` // Required. The workspace ID for which the workspace assignment is being // updated. @@ -1541,7 +1541,7 @@ type UpdateWorkspaceIdentityDetailRequest struct { PrincipalId int64 `json:"-" url:"-"` // Required. The list of fields to update. UpdateMask fieldmask.FieldMask `json:"-" url:"update_mask"` - // Required. Workspace identity detail to be updated in . + // Required. Workspace identity detail to be updated in Databricks. WorkspaceIdentityDetail WorkspaceIdentityDetail `json:"workspace_identity_detail"` } diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 58472c93e..8885a9673 100644 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -66,6 +66,29 @@ func (s AutoFullRefreshPolicy) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type AvroTransformerOptions struct { + // (Optional) Parse mode for Avro data. Valid values: FAILFAST, PERMISSIVE. + // Defaults to FAILFAST. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // Inline Avro JSON schema string. + Schema string `json:"schema,omitempty"` + // Path to a schema file (.avsc). + SchemaFilePath string `json:"schema_file_path,omitempty"` + // (Optional) Schema registry to resolve the Avro schema at runtime instead + // of providing it inline or via a file path. + SchemaRegistry *SchemaRegistryConfig `json:"schema_registry,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *AvroTransformerOptions) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s AvroTransformerOptions) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Enum to specify which mode of clone to execute type CloneMode string @@ -225,6 +248,21 @@ func (s *ConfluenceConnectorOptions) UnmarshalJSON(b []byte) error { return marshal.Unmarshal(b, s) } +type ConfluentSchemaRegistryOptions struct { + // Required: subject name to resolve in the registry. + Subject string `json:"subject,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ConfluentSchemaRegistryOptions) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ConfluentSchemaRegistryOptions) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type ConnectionParameters struct { // Source catalog for initial connection. This is necessary for schema // exploration in some database systems like Oracle, and optional but @@ -2389,6 +2427,44 @@ func (s OutlookOptions) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Determines how errors encountered while deserializing records are handled. +type ParseMode string + +const ParseModeFailfast ParseMode = `FAILFAST` + +const ParseModePermissive ParseMode = `PERMISSIVE` + +// String representation for [fmt.Print] +func (f *ParseMode) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *ParseMode) Set(v string) error { + switch v { + case `FAILFAST`, `PERMISSIVE`: + *f = ParseMode(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "FAILFAST", "PERMISSIVE"`, v) + } +} + +// Values returns all possible values for ParseMode. +// +// There is no guarantee on the order of the values in the slice. +func (f *ParseMode) Values() []ParseMode { + return []ParseMode{ + ParseModeFailfast, + ParseModePermissive, + } +} + +// Type always returns ParseMode to satisfy [pflag.Value] interface +func (f *ParseMode) Type() string { + return "ParseMode" +} + type PathPattern struct { // The source code to include for pipelines Include string `json:"include,omitempty"` @@ -3106,6 +3182,34 @@ func (s PostgresSlotConfig) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type ProtobufTransformerOptions struct { + // Required: path to the .desc file (dbfs:/... or /Volumes/...). + DescFilePath string `json:"desc_file_path,omitempty"` + // Required: fully-qualified message type name. + MessageName string `json:"message_name,omitempty"` + // (Optional) Parse mode for Protobuf data. Valid values: FAILFAST, + // PERMISSIVE. Defaults to FAILFAST. + ParseMode ParseMode `json:"parse_mode,omitempty"` + // (Optional) Maximum expansion depth for recursive protobuf fields. Spark + // SQL does not natively support recursive types, so recursive fields are + // expanded up to this depth and truncated beyond it. Valid values: -1 + // (disallow recursive fields), 0 (drop), 1-10. + RecursiveFieldsMaxDepth int `json:"recursive_fields_max_depth,omitempty"` + // (Optional) Schema registry to resolve the Protobuf schema at runtime + // instead of providing it via desc_file_path. + SchemaRegistry *SchemaRegistryConfig `json:"schema_registry,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *ProtobufTransformerOptions) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s ProtobufTransformerOptions) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Enum representing the publishing mode of a pipeline. type PublishingMode string @@ -3344,6 +3448,29 @@ func (s RunAs) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type SchemaRegistryConfig struct { + // Required: Confluent-compatible schema registry options. + ConfluentOptions *ConfluentSchemaRegistryOptions `json:"confluent_options,omitempty"` + // (Optional) UC connection for registry authentication. Specify if + // different from the top-level source connection. + ConnectionName string `json:"connection_name,omitempty"` + // (Optional, Protobuf only) Selects a specific message from a schema that + // defines multiple Protobuf messages. Simple ("Location") or + // fully-qualified ("com.example.protos.Location"). Defaults to the first + // message. + ProtobufMessageName string `json:"protobuf_message_name,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *SchemaRegistryConfig) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s SchemaRegistryConfig) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + type SchemaSpec struct { // (Optional) Source Specific Connector Options ConnectorOptions *ConnectorOptions `json:"connector_options,omitempty"` @@ -3998,6 +4125,7 @@ func (f *TikTokAdsOptionsTikTokReportType) Type() string { // Specifies how to transform binary data into structured data. type Transformer struct { + AvroOptions *AvroTransformerOptions `json:"avro_options,omitempty"` // Required: the wire format of the data. Format TransformerFormat `json:"format,omitempty"` // Optional input column to transform. When set, the transformer reads from @@ -4009,6 +4137,8 @@ type Transformer struct { // to this column instead of replacing the input column. OutputColumn string `json:"output_column,omitempty"` + ProtobufOptions *ProtobufTransformerOptions `json:"protobuf_options,omitempty"` + ForceSendFields []string `json:"-" url:"-"` } @@ -4022,8 +4152,12 @@ func (s Transformer) MarshalJSON() ([]byte, error) { type TransformerFormat string +const TransformerFormatAvro TransformerFormat = `AVRO` + const TransformerFormatJson TransformerFormat = `JSON` +const TransformerFormatProtobuf TransformerFormat = `PROTOBUF` + const TransformerFormatString TransformerFormat = `STRING` // String representation for [fmt.Print] @@ -4034,11 +4168,11 @@ func (f *TransformerFormat) String() string { // Set raw string value and validate it against allowed values func (f *TransformerFormat) Set(v string) error { switch v { - case `JSON`, `STRING`: + case `AVRO`, `JSON`, `PROTOBUF`, `STRING`: *f = TransformerFormat(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "JSON", "STRING"`, v) + return fmt.Errorf(`value "%s" is not one of "AVRO", "JSON", "PROTOBUF", "STRING"`, v) } } @@ -4047,7 +4181,9 @@ func (f *TransformerFormat) Set(v string) error { // There is no guarantee on the order of the values in the slice. func (f *TransformerFormat) Values() []TransformerFormat { return []TransformerFormat{ + TransformerFormatAvro, TransformerFormatJson, + TransformerFormatProtobuf, TransformerFormatString, } } diff --git a/service/pkg.go b/service/pkg.go index a004ea6e2..0da9e56f1 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -168,7 +168,7 @@ // // - [iam.AccountGroupsV2API]: Groups simplify identity management, making it easier to assign access to Databricks account, data, and other securable objects. // -// - [iamv2.AccountIamV2API]: These APIs are used to manage identities and the workspace access of these identities in . +// - [iamv2.AccountIamV2API]: These APIs are used to manage identities and the workspace access of these identities in Databricks. // // - [compute.InstancePoolsAPI]: Instance Pools API are used to create, edit, delete and list instance pools by using ready-to-use cloud instances which reduces a cluster start and auto-scaling times. // @@ -376,7 +376,7 @@ // // - [tags.WorkspaceEntityTagAssignmentsAPI]: Manage tag assignments on workspace-scoped objects. // -// - [iamv2.WorkspaceIamV2API]: These APIs are used to manage identities and the workspace access of these identities in . +// - [iamv2.WorkspaceIamV2API]: These APIs are used to manage identities and the workspace access of these identities in Databricks. // // - [settings.WorkspaceNetworkConfigurationAPI]: These APIs allow configuration of network settings for Databricks workspaces by selecting which network policy to associate with the workspace. // diff --git a/workspace_client.go b/workspace_client.go index e2bfcd376..0de9f0ffc 100644 --- a/workspace_client.go +++ b/workspace_client.go @@ -1408,7 +1408,7 @@ type WorkspaceClient struct { WorkspaceEntityTagAssignments tags.WorkspaceEntityTagAssignmentsInterface // These APIs are used to manage identities and the workspace access of - // these identities in . + // these identities in Databricks. WorkspaceIamV2 iamv2.WorkspaceIamV2Interface // APIs to manage workspace level settings