iamv2

package
v0.169.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

These APIs allow you to manage Account Iam V2, Workspace Iam V2, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountIamV2API

type AccountIamV2API struct {
	// contains filtered or unexported fields
}

These APIs are used to manage identities and the workspace access of these identities in <Databricks>.

func NewAccountIamV2

func NewAccountIamV2(client *client.DatabricksClient) *AccountIamV2API

func (*AccountIamV2API) CreateWorkspaceAssignmentDetail added in v0.133.0

func (a *AccountIamV2API) CreateWorkspaceAssignmentDetail(ctx context.Context, request CreateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

func (*AccountIamV2API) DeleteWorkspaceAssignmentDetail added in v0.133.0

func (a *AccountIamV2API) DeleteWorkspaceAssignmentDetail(ctx context.Context, request DeleteWorkspaceAssignmentDetailRequest) error

func (*AccountIamV2API) GetWorkspaceAccessDetail

func (a *AccountIamV2API) GetWorkspaceAccessDetail(ctx context.Context, request GetWorkspaceAccessDetailRequest) (*WorkspaceAccessDetail, error)

func (*AccountIamV2API) GetWorkspaceAssignmentDetail added in v0.133.0

func (a *AccountIamV2API) GetWorkspaceAssignmentDetail(ctx context.Context, request GetWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

func (*AccountIamV2API) ListWorkspaceAssignmentDetails added in v0.133.0

func (a *AccountIamV2API) ListWorkspaceAssignmentDetails(ctx context.Context, request ListWorkspaceAssignmentDetailsRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

func (*AccountIamV2API) ResolveGroup

func (a *AccountIamV2API) ResolveGroup(ctx context.Context, request ResolveGroupRequest) (*ResolveGroupResponse, error)

func (*AccountIamV2API) ResolveServicePrincipal

func (a *AccountIamV2API) ResolveServicePrincipal(ctx context.Context, request ResolveServicePrincipalRequest) (*ResolveServicePrincipalResponse, error)

func (*AccountIamV2API) ResolveUser

func (a *AccountIamV2API) ResolveUser(ctx context.Context, request ResolveUserRequest) (*ResolveUserResponse, error)

func (*AccountIamV2API) UpdateWorkspaceAssignmentDetail added in v0.133.0

func (a *AccountIamV2API) UpdateWorkspaceAssignmentDetail(ctx context.Context, request UpdateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

type AccountIamV2Interface

type AccountIamV2Interface interface {

	// Creates a workspace assignment detail for a principal. Entitlements are
	// granted one at a time rather than atomically. If the request fails partway
	// through, the principal stays assigned to the workspace with only some of the
	// requested entitlements. Get the assignment detail afterwards to confirm which
	// entitlements were granted.
	CreateWorkspaceAssignmentDetail(ctx context.Context, request CreateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

	// Deletes a workspace assignment detail for a principal, revoking all of its
	// entitlements. Entitlements are revoked one at a time rather than atomically.
	// If the request fails partway through, the principal stays assigned with some
	// of its original entitlements. Retrying is safe.
	DeleteWorkspaceAssignmentDetail(ctx context.Context, request DeleteWorkspaceAssignmentDetailRequest) error

	// Returns the access details for a principal in a workspace. Allows for
	// checking access details for any provisioned principal (user, service
	// principal, or group) in a workspace. * Provisioned principal here refers to
	// one that has been synced into Databricks from the customer's IdP or added
	// explicitly to Databricks via SCIM/UI. Allows for passing in a "view"
	// parameter to control what fields are returned (BASIC by default or FULL).
	GetWorkspaceAccessDetail(ctx context.Context, request GetWorkspaceAccessDetailRequest) (*WorkspaceAccessDetail, error)

	// Returns the assignment details for a principal in a workspace.
	GetWorkspaceAssignmentDetail(ctx context.Context, request GetWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

	// Lists workspace assignment details for a workspace. The response omits the
	// per-principal entitlement fields (`entitlements` and
	// `effective_entitlements`). To read the entitlements for a single principal,
	// get that principal's assignment detail.
	ListWorkspaceAssignmentDetails(ctx context.Context, request ListWorkspaceAssignmentDetailsRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

	// Resolves a group with the given external ID from the customer's IdP. If the
	// group does not exist, it will be created in the account. If the customer is
	// not onboarded onto Automatic Identity Management (AIM), this will return an
	// error.
	ResolveGroup(ctx context.Context, request ResolveGroupRequest) (*ResolveGroupResponse, error)

	// Resolves a service principal with the given external ID from the customer's
	// IdP. If the service principal does not exist, it will be created. If the
	// customer is not onboarded onto Automatic Identity Management (AIM), this will
	// return an error.
	ResolveServicePrincipal(ctx context.Context, request ResolveServicePrincipalRequest) (*ResolveServicePrincipalResponse, error)

	// Resolves a user with the given external ID from the customer's IdP. If the
	// user does not exist, it will be created. If the customer is not onboarded
	// onto Automatic Identity Management (AIM), this will return an error.
	ResolveUser(ctx context.Context, request ResolveUserRequest) (*ResolveUserResponse, error)

	// Updates the entitlements of a directly assigned principal in a workspace.
	// Changes are applied one at a time rather than atomically. If the request
	// fails partway through, only some of the requested changes take effect. Get
	// the assignment detail afterwards to confirm the final state.
	UpdateWorkspaceAssignmentDetail(ctx context.Context, request UpdateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)
}

type AccountIamV2Service deprecated

type AccountIamV2Service interface {

	// Creates a workspace assignment detail for a principal. Entitlements are
	// granted one at a time rather than atomically. If the request fails
	// partway through, the principal stays assigned to the workspace with only
	// some of the requested entitlements. Get the assignment detail afterwards
	// to confirm which entitlements were granted.
	CreateWorkspaceAssignmentDetail(ctx context.Context, request CreateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

	// Deletes a workspace assignment detail for a principal, revoking all of
	// its entitlements. Entitlements are revoked one at a time rather than
	// atomically. If the request fails partway through, the principal stays
	// assigned with some of its original entitlements. Retrying is safe.
	DeleteWorkspaceAssignmentDetail(ctx context.Context, request DeleteWorkspaceAssignmentDetailRequest) error

	// Returns the access details for a principal in a workspace. Allows for
	// checking access details for any provisioned principal (user, service
	// principal, or group) in a workspace. * Provisioned principal here refers
	// to one that has been synced into Databricks from the customer's IdP or
	// added explicitly to Databricks via SCIM/UI. Allows for passing in a
	// "view" parameter to control what fields are returned (BASIC by default or
	// FULL).
	GetWorkspaceAccessDetail(ctx context.Context, request GetWorkspaceAccessDetailRequest) (*WorkspaceAccessDetail, error)

	// Returns the assignment details for a principal in a workspace.
	GetWorkspaceAssignmentDetail(ctx context.Context, request GetWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)

	// Lists workspace assignment details for a workspace. The response omits
	// the per-principal entitlement fields (`entitlements` and
	// `effective_entitlements`). To read the entitlements for a single
	// principal, get that principal's assignment detail.
	ListWorkspaceAssignmentDetails(ctx context.Context, request ListWorkspaceAssignmentDetailsRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

	// Resolves a group with the given external ID from the customer's IdP. If
	// the group does not exist, it will be created in the account. If the
	// customer is not onboarded onto Automatic Identity Management (AIM), this
	// will return an error.
	ResolveGroup(ctx context.Context, request ResolveGroupRequest) (*ResolveGroupResponse, error)

	// Resolves a service principal with the given external ID from the
	// customer's IdP. If the service principal does not exist, it will be
	// created. If the customer is not onboarded onto Automatic Identity
	// Management (AIM), this will return an error.
	ResolveServicePrincipal(ctx context.Context, request ResolveServicePrincipalRequest) (*ResolveServicePrincipalResponse, error)

	// Resolves a user with the given external ID from the customer's IdP. If
	// the user does not exist, it will be created. If the customer is not
	// onboarded onto Automatic Identity Management (AIM), this will return an
	// error.
	ResolveUser(ctx context.Context, request ResolveUserRequest) (*ResolveUserResponse, error)

	// Updates the entitlements of a directly assigned principal in a workspace.
	// Changes are applied one at a time rather than atomically. If the request
	// fails partway through, only some of the requested changes take effect.
	// Get the assignment detail afterwards to confirm the final state.
	UpdateWorkspaceAssignmentDetail(ctx context.Context, request UpdateWorkspaceAssignmentDetailRequest) (*WorkspaceAssignmentDetail, error)
}

These APIs are used to manage identities and the workspace access of these identities in <Databricks>.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type CreateWorkspaceAssignmentDetailProxyRequest added in v0.133.0

type CreateWorkspaceAssignmentDetailProxyRequest struct {
	// Required. Workspace assignment detail to be created in <Databricks>.
	WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"`
}

type CreateWorkspaceAssignmentDetailRequest added in v0.133.0

type CreateWorkspaceAssignmentDetailRequest struct {
	// 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.
	WorkspaceId int64 `json:"-" url:"-"`
}

type DeleteWorkspaceAssignmentDetailProxyRequest added in v0.133.0

type DeleteWorkspaceAssignmentDetailProxyRequest struct {
	// Required. ID of the principal in Databricks to delete workspace
	// assignment for.
	PrincipalId int64 `json:"-" url:"-"`
}

type DeleteWorkspaceAssignmentDetailRequest added in v0.133.0

type DeleteWorkspaceAssignmentDetailRequest struct {
	// Required. ID of the principal in Databricks to delete workspace
	// assignment for.
	PrincipalId int64 `json:"-" url:"-"`
	// The workspace ID where the principal has access.
	WorkspaceId int64 `json:"-" url:"-"`
}

type Entitlement added in v0.133.0

type Entitlement string
const EntitlementAllowClusterCreate Entitlement = `ALLOW_CLUSTER_CREATE`
const EntitlementAllowInstancePoolCreate Entitlement = `ALLOW_INSTANCE_POOL_CREATE`
const EntitlementDatabricksSqlAccess Entitlement = `DATABRICKS_SQL_ACCESS`
const EntitlementWorkspaceAccess Entitlement = `WORKSPACE_ACCESS`
const EntitlementWorkspaceAdmin Entitlement = `WORKSPACE_ADMIN`
const EntitlementWorkspaceConsume Entitlement = `WORKSPACE_CONSUME`

func (*Entitlement) Set added in v0.133.0

func (f *Entitlement) Set(v string) error

Set raw string value and validate it against allowed values

func (*Entitlement) String added in v0.133.0

func (f *Entitlement) String() string

String representation for fmt.Print

func (*Entitlement) Type added in v0.133.0

func (f *Entitlement) Type() string

Type always returns Entitlement to satisfy [pflag.Value] interface

func (*Entitlement) Values added in v0.133.0

func (f *Entitlement) Values() []Entitlement

Values returns all possible values for Entitlement.

There is no guarantee on the order of the values in the slice.

type GetWorkspaceAccessDetailLocalRequest

type GetWorkspaceAccessDetailLocalRequest struct {
	// Required. The internal ID of the principal (user/sp/group) for which the
	// access details are being requested.
	PrincipalId int64 `json:"-" url:"-"`
	// Controls what fields are returned.
	View WorkspaceAccessDetailView `json:"-" url:"view,omitempty"`
}

type GetWorkspaceAccessDetailRequest

type GetWorkspaceAccessDetailRequest struct {
	// Required. The internal ID of the principal (user/sp/group) for which the
	// access details are being requested.
	PrincipalId int64 `json:"-" url:"-"`
	// Controls what fields are returned.
	View WorkspaceAccessDetailView `json:"-" url:"view,omitempty"`
	// Required. The workspace ID for which the access details are being
	// requested.
	WorkspaceId int64 `json:"-" url:"-"`
}

type GetWorkspaceAssignmentDetailProxyRequest added in v0.133.0

type GetWorkspaceAssignmentDetailProxyRequest struct {
	// Required. The internal ID of the principal (user/sp/group) for which the
	// assignment details are being requested.
	PrincipalId int64 `json:"-" url:"-"`
}

type GetWorkspaceAssignmentDetailRequest added in v0.133.0

type GetWorkspaceAssignmentDetailRequest struct {
	// Required. The internal ID of the principal (user/sp/group) for which the
	// assignment details are being requested.
	PrincipalId int64 `json:"-" url:"-"`
	// Required. The workspace ID for which the assignment details are being
	// requested.
	WorkspaceId int64 `json:"-" url:"-"`
}

type Group

type Group struct {
	// The parent account ID for group in Databricks.
	AccountId string `json:"account_id,omitempty"`
	// ExternalId of the group in the customer's IdP.
	ExternalId string `json:"external_id,omitempty"`
	// Internal group ID of the group in Databricks.
	GroupId string `json:"group_id,omitempty"`
	// Display name of the group.
	GroupName string `json:"group_name,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

The details of a Group resource.

func (Group) MarshalJSON

func (s Group) MarshalJSON() ([]byte, error)

func (*Group) UnmarshalJSON

func (s *Group) UnmarshalJSON(b []byte) error

type ListWorkspaceAssignmentDetailsProxyRequest added in v0.133.0

type ListWorkspaceAssignmentDetailsProxyRequest struct {
	// The maximum number of workspace assignment details to return. The service
	// may return fewer than this value.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token from a previous list call. Provide this to retrieve the
	// subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListWorkspaceAssignmentDetailsProxyRequest) MarshalJSON added in v0.133.0

func (*ListWorkspaceAssignmentDetailsProxyRequest) UnmarshalJSON added in v0.133.0

type ListWorkspaceAssignmentDetailsRequest added in v0.133.0

type ListWorkspaceAssignmentDetailsRequest struct {
	// The maximum number of workspace assignment details to return. The service
	// may return fewer than this value.
	PageSize int `json:"-" url:"page_size,omitempty"`
	// A page token, received from a previous ListWorkspaceAssignmentDetails
	// call. Provide this to retrieve the subsequent page.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// Required. The workspace ID for which the workspace assignment details are
	// being fetched.
	WorkspaceId int64 `json:"-" url:"-"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (ListWorkspaceAssignmentDetailsRequest) MarshalJSON added in v0.133.0

func (s ListWorkspaceAssignmentDetailsRequest) MarshalJSON() ([]byte, error)

func (*ListWorkspaceAssignmentDetailsRequest) UnmarshalJSON added in v0.133.0

func (s *ListWorkspaceAssignmentDetailsRequest) UnmarshalJSON(b []byte) error

type ListWorkspaceAssignmentDetailsResponse added in v0.133.0

type ListWorkspaceAssignmentDetailsResponse struct {
	// A token, which can be sent as page_token to retrieve the next page. If
	// this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"next_page_token,omitempty"`

	WorkspaceAssignmentDetails []WorkspaceAssignmentDetail `json:"workspace_assignment_details,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

Response message for listing workspace assignment details.

func (ListWorkspaceAssignmentDetailsResponse) MarshalJSON added in v0.133.0

func (s ListWorkspaceAssignmentDetailsResponse) MarshalJSON() ([]byte, error)

func (*ListWorkspaceAssignmentDetailsResponse) UnmarshalJSON added in v0.133.0

func (s *ListWorkspaceAssignmentDetailsResponse) UnmarshalJSON(b []byte) error

type PrincipalType

type PrincipalType string

The type of the principal (user/sp/group).

const PrincipalTypeGroup PrincipalType = `GROUP`
const PrincipalTypeServicePrincipal PrincipalType = `SERVICE_PRINCIPAL`
const PrincipalTypeUser PrincipalType = `USER`

func (*PrincipalType) Set

func (f *PrincipalType) Set(v string) error

Set raw string value and validate it against allowed values

func (*PrincipalType) String

func (f *PrincipalType) String() string

String representation for fmt.Print

func (*PrincipalType) Type

func (f *PrincipalType) Type() string

Type always returns PrincipalType to satisfy [pflag.Value] interface

func (*PrincipalType) Values

func (f *PrincipalType) Values() []PrincipalType

Values returns all possible values for PrincipalType.

There is no guarantee on the order of the values in the slice.

type ResolveGroupProxyRequest

type ResolveGroupProxyRequest struct {
	// Required. The external ID of the group in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a group with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the group's name and inherited parent groups.

type ResolveGroupRequest

type ResolveGroupRequest struct {
	// Required. The external ID of the group in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a group with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the group's name and inherited parent groups.

type ResolveGroupResponse

type ResolveGroupResponse struct {
	// The group that was resolved.
	Group *Group `json:"group,omitempty"`
}

type ResolveServicePrincipalProxyRequest

type ResolveServicePrincipalProxyRequest struct {
	// Required. The external ID of the service principal in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a service principal with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the service principal's display name, status, and inherited parent groups.

type ResolveServicePrincipalRequest

type ResolveServicePrincipalRequest struct {
	// Required. The external ID of the service principal in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a service principal with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the service principal's display name, status, and inherited parent groups.

type ResolveServicePrincipalResponse

type ResolveServicePrincipalResponse struct {
	// The service principal that was resolved.
	ServicePrincipal *ServicePrincipal `json:"service_principal,omitempty"`
}

type ResolveUserProxyRequest

type ResolveUserProxyRequest struct {
	// Required. The external ID of the user in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a user with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the user's display name, status, and inherited parent groups.

type ResolveUserRequest

type ResolveUserRequest struct {
	// Required. The external ID of the user in the customer's IdP.
	ExternalId string `json:"external_id"`
}

Request message for resolving a user with the given external ID from the customer's IdP into Databricks. Will resolve metadata such as the user's display name, status, and inherited parent groups.

type ResolveUserResponse

type ResolveUserResponse struct {
	// The user that was resolved.
	User *User `json:"user,omitempty"`
}

type ServicePrincipal

type ServicePrincipal struct {
	// The parent account ID for the service principal in Databricks.
	AccountId string `json:"account_id,omitempty"`
	// The activity status of a service principal in a Databricks account.
	AccountSpStatus State `json:"account_sp_status,omitempty"`
	// Application ID of the service principal.
	ApplicationId string `json:"application_id,omitempty"`
	// Display name of the service principal.
	DisplayName string `json:"display_name,omitempty"`
	// ExternalId of the service principal in the customer's IdP.
	ExternalId string `json:"external_id,omitempty"`
	// Internal service principal ID of the service principal in Databricks.
	ServicePrincipalId string `json:"service_principal_id,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

The details of a ServicePrincipal resource.

func (ServicePrincipal) MarshalJSON

func (s ServicePrincipal) MarshalJSON() ([]byte, error)

func (*ServicePrincipal) UnmarshalJSON

func (s *ServicePrincipal) UnmarshalJSON(b []byte) error

type State

type State string

The activity status of a user or service principal in a Databricks account or workspace.

const StateActive State = `ACTIVE`
const StateInactive State = `INACTIVE`

func (*State) Set

func (f *State) Set(v string) error

Set raw string value and validate it against allowed values

func (*State) String

func (f *State) String() string

String representation for fmt.Print

func (*State) Type

func (f *State) Type() string

Type always returns State to satisfy [pflag.Value] interface

func (*State) Values

func (f *State) Values() []State

Values returns all possible values for State.

There is no guarantee on the order of the values in the slice.

type UpdateWorkspaceAssignmentDetailProxyRequest added in v0.133.0

type UpdateWorkspaceAssignmentDetailProxyRequest struct {
	// Required. ID of the principal in Databricks.
	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 <Databricks>.
	WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"`
}

type UpdateWorkspaceAssignmentDetailRequest added in v0.133.0

type UpdateWorkspaceAssignmentDetailRequest struct {
	// Required. ID of the principal in Databricks.
	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 <Databricks>.
	WorkspaceAssignmentDetail WorkspaceAssignmentDetail `json:"workspace_assignment_detail"`
	// Required. The workspace ID for which the workspace assignment detail is
	// being updated.
	WorkspaceId int64 `json:"-" url:"-"`
}

type User

type User struct {
	// The accountId parent of the user in Databricks.
	AccountId string `json:"account_id,omitempty"`
	// The activity status of a user in a Databricks account.
	AccountUserStatus State `json:"account_user_status,omitempty"`
	// ExternalId of the user in the customer's IdP.
	ExternalId string `json:"external_id,omitempty"`

	FullName *UserFullName `json:"full_name,omitempty"`
	// Internal userId of the user in Databricks.
	UserId string `json:"user_id,omitempty"`
	// Username/email of the user.
	Username string `json:"username,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

The details of a User resource.

func (User) MarshalJSON

func (s User) MarshalJSON() ([]byte, error)

func (*User) UnmarshalJSON

func (s *User) UnmarshalJSON(b []byte) error

type UserFullName added in v0.153.0

type UserFullName struct {
	FamilyName string `json:"family_name,omitempty"`

	GivenName string `json:"given_name,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

func (UserFullName) MarshalJSON added in v0.153.0

func (s UserFullName) MarshalJSON() ([]byte, error)

func (*UserFullName) UnmarshalJSON added in v0.153.0

func (s *UserFullName) UnmarshalJSON(b []byte) error

type WorkspaceAccessDetail

type WorkspaceAccessDetail struct {
	AccessType WorkspaceAccessDetailAccessType `json:"access_type,omitempty"`
	// The account ID parent of the workspace where the principal has access.
	AccountId string `json:"account_id,omitempty"`
	// The permissions granted to the principal in the workspace.
	Permissions []WorkspacePermission `json:"permissions,omitempty"`
	// The internal ID of the principal (user/sp/group) in Databricks.
	PrincipalId int64 `json:"principal_id,omitempty"`

	PrincipalType PrincipalType `json:"principal_type,omitempty"`
	// The activity status of the principal in the workspace. Not applicable for
	// groups at the moment.
	Status State `json:"status,omitempty"`
	// The workspace ID where the principal has access.
	WorkspaceId int64 `json:"workspace_id,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

The details of a principal's access to a workspace.

func (WorkspaceAccessDetail) MarshalJSON

func (s WorkspaceAccessDetail) MarshalJSON() ([]byte, error)

func (*WorkspaceAccessDetail) UnmarshalJSON

func (s *WorkspaceAccessDetail) UnmarshalJSON(b []byte) error

type WorkspaceAccessDetailAccessType

type WorkspaceAccessDetailAccessType string

The type of access the principal has to the workspace.

const WorkspaceAccessDetailAccessTypeDirect WorkspaceAccessDetailAccessType = `DIRECT`
const WorkspaceAccessDetailAccessTypeIndirect WorkspaceAccessDetailAccessType = `INDIRECT`

func (*WorkspaceAccessDetailAccessType) Set

Set raw string value and validate it against allowed values

func (*WorkspaceAccessDetailAccessType) String

String representation for fmt.Print

func (*WorkspaceAccessDetailAccessType) Type

Type always returns WorkspaceAccessDetailAccessType to satisfy [pflag.Value] interface

func (*WorkspaceAccessDetailAccessType) Values

Values returns all possible values for WorkspaceAccessDetailAccessType.

There is no guarantee on the order of the values in the slice.

type WorkspaceAccessDetailView

type WorkspaceAccessDetailView string

Controls what fields are returned in the GetWorkspaceAccessDetail response.

const WorkspaceAccessDetailViewBasic WorkspaceAccessDetailView = `BASIC`
const WorkspaceAccessDetailViewFull WorkspaceAccessDetailView = `FULL`

func (*WorkspaceAccessDetailView) Set

Set raw string value and validate it against allowed values

func (*WorkspaceAccessDetailView) String

func (f *WorkspaceAccessDetailView) String() string

String representation for fmt.Print

func (*WorkspaceAccessDetailView) Type

Type always returns WorkspaceAccessDetailView to satisfy [pflag.Value] interface

func (*WorkspaceAccessDetailView) Values

Values returns all possible values for WorkspaceAccessDetailView.

There is no guarantee on the order of the values in the slice.

type WorkspaceAssignmentDetail added in v0.133.0

type WorkspaceAssignmentDetail struct {
	// The account ID parent of the workspace where the principal is assigned
	AccountId string `json:"account_id,omitempty"`
	// Every entitlement the principal holds in this workspace, whether granted
	// directly or through group membership. Get responses populate this field.
	// List responses leave it empty.
	EffectiveEntitlements []Entitlement `json:"effective_entitlements,omitempty"`
	// Entitlements granted directly to the principal on this workspace. This is
	// the only client-settable field. Create and update manage exactly this
	// set, including entitlements the principal also holds through a group.
	// List responses leave this field empty. Get a single principal to read its
	// entitlements.
	Entitlements []Entitlement `json:"entitlements,omitempty"`
	// The internal ID of the principal (user/sp/group) in Databricks.
	PrincipalId int64 `json:"principal_id"`

	PrincipalType PrincipalType `json:"principal_type,omitempty"`
	// The workspace ID where the principal is assigned
	WorkspaceId int64 `json:"workspace_id,omitempty"`

	ForceSendFields []string `json:"-" url:"-"`
}

The direct assignment of a provisioned account-level principal (user, service principal, or group) to a workspace, together with the entitlements that assignment grants in the workspace.

This resource covers only principals assigned directly to the workspace. Principals that inherit workspace access through a group are not represented here. See WorkspaceAccessDetail and WorkspaceIdentityDetail for the effective, direct-or-indirect view. Creating the resource assigns the principal to the workspace, and deleting it removes the assignment.

`entitlements` is the only client-settable field. It holds the entitlements granted directly on this assignment, including any the principal also holds through a group. `effective_entitlements` is the read-only union of those and any granted through group membership.

A direct assignment always carries at least one directly-assigned entitlement, because the assignment is what grants it. Create and update both reject an empty `entitlements` set. To remove a principal's assignment entirely, delete the resource.

This resource replaces workspace assignment previously managed through the workspace SCIM and permission-assignment APIs, and is intended for account and workspace admins.

func (WorkspaceAssignmentDetail) MarshalJSON added in v0.133.0

func (s WorkspaceAssignmentDetail) MarshalJSON() ([]byte, error)

func (*WorkspaceAssignmentDetail) UnmarshalJSON added in v0.133.0

func (s *WorkspaceAssignmentDetail) UnmarshalJSON(b []byte) error

type WorkspaceIamV2API

type WorkspaceIamV2API struct {
	// contains filtered or unexported fields
}

These APIs are used to manage identities and the workspace access of these identities in <Databricks>.

func NewWorkspaceIamV2

func NewWorkspaceIamV2(client *client.DatabricksClient) *WorkspaceIamV2API

func (*WorkspaceIamV2API) CreateWorkspaceAssignmentDetailProxy added in v0.133.0

func (a *WorkspaceIamV2API) CreateWorkspaceAssignmentDetailProxy(ctx context.Context, request CreateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

func (*WorkspaceIamV2API) DeleteWorkspaceAssignmentDetailProxy added in v0.133.0

func (a *WorkspaceIamV2API) DeleteWorkspaceAssignmentDetailProxy(ctx context.Context, request DeleteWorkspaceAssignmentDetailProxyRequest) error

func (*WorkspaceIamV2API) GetWorkspaceAccessDetailLocal

func (a *WorkspaceIamV2API) GetWorkspaceAccessDetailLocal(ctx context.Context, request GetWorkspaceAccessDetailLocalRequest) (*WorkspaceAccessDetail, error)

func (*WorkspaceIamV2API) GetWorkspaceAssignmentDetailProxy added in v0.133.0

func (a *WorkspaceIamV2API) GetWorkspaceAssignmentDetailProxy(ctx context.Context, request GetWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

func (*WorkspaceIamV2API) ListWorkspaceAssignmentDetailsProxy added in v0.133.0

func (a *WorkspaceIamV2API) ListWorkspaceAssignmentDetailsProxy(ctx context.Context, request ListWorkspaceAssignmentDetailsProxyRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

func (*WorkspaceIamV2API) ResolveGroupProxy

func (a *WorkspaceIamV2API) ResolveGroupProxy(ctx context.Context, request ResolveGroupProxyRequest) (*ResolveGroupResponse, error)

func (*WorkspaceIamV2API) ResolveServicePrincipalProxy

func (a *WorkspaceIamV2API) ResolveServicePrincipalProxy(ctx context.Context, request ResolveServicePrincipalProxyRequest) (*ResolveServicePrincipalResponse, error)

func (*WorkspaceIamV2API) ResolveUserProxy

func (a *WorkspaceIamV2API) ResolveUserProxy(ctx context.Context, request ResolveUserProxyRequest) (*ResolveUserResponse, error)

func (*WorkspaceIamV2API) UpdateWorkspaceAssignmentDetailProxy added in v0.133.0

func (a *WorkspaceIamV2API) UpdateWorkspaceAssignmentDetailProxy(ctx context.Context, request UpdateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

type WorkspaceIamV2Interface

type WorkspaceIamV2Interface interface {

	// Creates a workspace assignment detail for a principal in the calling
	// workspace. Entitlements are granted one at a time rather than atomically. If
	// the request fails partway through, the principal stays assigned to the
	// workspace with only some of the requested entitlements. Get the assignment
	// detail afterwards to confirm which entitlements were granted.
	CreateWorkspaceAssignmentDetailProxy(ctx context.Context, request CreateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

	// Deletes a workspace assignment detail for a principal in the calling
	// workspace, revoking all of its entitlements. Entitlements are revoked one at
	// a time rather than atomically. If the request fails partway through, the
	// principal stays assigned with some of its original entitlements. Retrying is
	// safe.
	DeleteWorkspaceAssignmentDetailProxy(ctx context.Context, request DeleteWorkspaceAssignmentDetailProxyRequest) error

	// Returns the access details for a principal in the current workspace. Allows
	// for checking access details for any provisioned principal (user, service
	// principal, or group) in the current workspace. * Provisioned principal here
	// refers to one that has been synced into Databricks from the customer's IdP or
	// added explicitly to Databricks via SCIM/UI. Allows for passing in a "view"
	// parameter to control what fields are returned (BASIC by default or FULL).
	GetWorkspaceAccessDetailLocal(ctx context.Context, request GetWorkspaceAccessDetailLocalRequest) (*WorkspaceAccessDetail, error)

	// Returns the assignment details for a principal in the calling workspace.
	GetWorkspaceAssignmentDetailProxy(ctx context.Context, request GetWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

	// Lists workspace assignment details for the calling workspace. The response
	// omits the per-principal entitlement fields (`entitlements` and
	// `effective_entitlements`). To read the entitlements for a single principal,
	// get that principal's assignment detail.
	ListWorkspaceAssignmentDetailsProxy(ctx context.Context, request ListWorkspaceAssignmentDetailsProxyRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

	// Resolves a group with the given external ID from the customer's IdP. If the
	// group does not exist, it will be created in the account. If the customer is
	// not onboarded onto Automatic Identity Management (AIM), this will return an
	// error.
	ResolveGroupProxy(ctx context.Context, request ResolveGroupProxyRequest) (*ResolveGroupResponse, error)

	// Resolves a service principal with the given external ID from the customer's
	// IdP. If the service principal does not exist, it will be created. If the
	// customer is not onboarded onto Automatic Identity Management (AIM), this will
	// return an error.
	ResolveServicePrincipalProxy(ctx context.Context, request ResolveServicePrincipalProxyRequest) (*ResolveServicePrincipalResponse, error)

	// Resolves a user with the given external ID from the customer's IdP. If the
	// user does not exist, it will be created. If the customer is not onboarded
	// onto Automatic Identity Management (AIM), this will return an error.
	ResolveUserProxy(ctx context.Context, request ResolveUserProxyRequest) (*ResolveUserResponse, error)

	// Updates the entitlements of a directly assigned principal in the calling
	// workspace. Changes are applied one at a time rather than atomically. If the
	// request fails partway through, only some of the requested changes take
	// effect. Get the assignment detail afterwards to confirm the final state.
	UpdateWorkspaceAssignmentDetailProxy(ctx context.Context, request UpdateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)
}

type WorkspaceIamV2Service deprecated

type WorkspaceIamV2Service interface {

	// Creates a workspace assignment detail for a principal in the calling
	// workspace. Entitlements are granted one at a time rather than atomically.
	// If the request fails partway through, the principal stays assigned to the
	// workspace with only some of the requested entitlements. Get the
	// assignment detail afterwards to confirm which entitlements were granted.
	CreateWorkspaceAssignmentDetailProxy(ctx context.Context, request CreateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

	// Deletes a workspace assignment detail for a principal in the calling
	// workspace, revoking all of its entitlements. Entitlements are revoked one
	// at a time rather than atomically. If the request fails partway through,
	// the principal stays assigned with some of its original entitlements.
	// Retrying is safe.
	DeleteWorkspaceAssignmentDetailProxy(ctx context.Context, request DeleteWorkspaceAssignmentDetailProxyRequest) error

	// Returns the access details for a principal in the current workspace.
	// Allows for checking access details for any provisioned principal (user,
	// service principal, or group) in the current workspace. * Provisioned
	// principal here refers to one that has been synced into Databricks from
	// the customer's IdP or added explicitly to Databricks via SCIM/UI. Allows
	// for passing in a "view" parameter to control what fields are returned
	// (BASIC by default or FULL).
	GetWorkspaceAccessDetailLocal(ctx context.Context, request GetWorkspaceAccessDetailLocalRequest) (*WorkspaceAccessDetail, error)

	// Returns the assignment details for a principal in the calling workspace.
	GetWorkspaceAssignmentDetailProxy(ctx context.Context, request GetWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)

	// Lists workspace assignment details for the calling workspace. The
	// response omits the per-principal entitlement fields (`entitlements` and
	// `effective_entitlements`). To read the entitlements for a single
	// principal, get that principal's assignment detail.
	ListWorkspaceAssignmentDetailsProxy(ctx context.Context, request ListWorkspaceAssignmentDetailsProxyRequest) (*ListWorkspaceAssignmentDetailsResponse, error)

	// Resolves a group with the given external ID from the customer's IdP. If
	// the group does not exist, it will be created in the account. If the
	// customer is not onboarded onto Automatic Identity Management (AIM), this
	// will return an error.
	ResolveGroupProxy(ctx context.Context, request ResolveGroupProxyRequest) (*ResolveGroupResponse, error)

	// Resolves a service principal with the given external ID from the
	// customer's IdP. If the service principal does not exist, it will be
	// created. If the customer is not onboarded onto Automatic Identity
	// Management (AIM), this will return an error.
	ResolveServicePrincipalProxy(ctx context.Context, request ResolveServicePrincipalProxyRequest) (*ResolveServicePrincipalResponse, error)

	// Resolves a user with the given external ID from the customer's IdP. If
	// the user does not exist, it will be created. If the customer is not
	// onboarded onto Automatic Identity Management (AIM), this will return an
	// error.
	ResolveUserProxy(ctx context.Context, request ResolveUserProxyRequest) (*ResolveUserResponse, error)

	// Updates the entitlements of a directly assigned principal in the calling
	// workspace. Changes are applied one at a time rather than atomically. If
	// the request fails partway through, only some of the requested changes
	// take effect. Get the assignment detail afterwards to confirm the final
	// state.
	UpdateWorkspaceAssignmentDetailProxy(ctx context.Context, request UpdateWorkspaceAssignmentDetailProxyRequest) (*WorkspaceAssignmentDetail, error)
}

These APIs are used to manage identities and the workspace access of these identities in <Databricks>.

Deprecated: Do not use this interface, it will be removed in a future version of the SDK.

type WorkspacePermission

type WorkspacePermission string

The type of permission a principal has to a workspace (admin/user).

const WorkspacePermissionAdminPermission WorkspacePermission = `ADMIN_PERMISSION`
const WorkspacePermissionUserPermission WorkspacePermission = `USER_PERMISSION`

func (*WorkspacePermission) Set

func (f *WorkspacePermission) Set(v string) error

Set raw string value and validate it against allowed values

func (*WorkspacePermission) String

func (f *WorkspacePermission) String() string

String representation for fmt.Print

func (*WorkspacePermission) Type

func (f *WorkspacePermission) Type() string

Type always returns WorkspacePermission to satisfy [pflag.Value] interface

func (*WorkspacePermission) Values

Values returns all possible values for WorkspacePermission.

There is no guarantee on the order of the values in the slice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL