sharing

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 8 Imported by: 13

Documentation

Overview

These APIs allow you to manage Clean Rooms, Providers, Recipient Activation, Recipients, Shares, etc.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationType

type AuthenticationType string

The delta sharing authentication type.

const AuthenticationTypeDatabricks AuthenticationType = `DATABRICKS`
const AuthenticationTypeToken AuthenticationType = `TOKEN`

func (*AuthenticationType) Set

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

Set raw string value and validate it against allowed values

func (*AuthenticationType) String

func (f *AuthenticationType) String() string

String representation for fmt.Print

func (*AuthenticationType) Type

func (f *AuthenticationType) Type() string

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

type CentralCleanRoomInfo added in v0.13.0

type CentralCleanRoomInfo struct {
	// All assets from all collaborators that are available in the clean room.
	// Only one of table_info or notebook_info will be filled in.
	CleanRoomAssets []CleanRoomAssetInfo `json:"clean_room_assets,omitempty"`
	// All collaborators who are in the clean room.
	Collaborators []CleanRoomCollaboratorInfo `json:"collaborators,omitempty"`
	// The collaborator who created the clean room.
	Creator *CleanRoomCollaboratorInfo `json:"creator,omitempty"`
	// The cloud where clean room tasks will be run.
	StationCloud string `json:"station_cloud,omitempty"`
	// The region where clean room tasks will be run.
	StationRegion string `json:"station_region,omitempty"`

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

func (CentralCleanRoomInfo) MarshalJSON added in v0.23.0

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

func (*CentralCleanRoomInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomAssetInfo added in v0.13.0

type CleanRoomAssetInfo struct {
	// Time at which this asset was added, in epoch milliseconds.
	AddedAt int64 `json:"added_at,omitempty"`
	// Details about the notebook asset.
	NotebookInfo *CleanRoomNotebookInfo `json:"notebook_info,omitempty"`
	// The collaborator who owns the asset.
	Owner *CleanRoomCollaboratorInfo `json:"owner,omitempty"`
	// Details about the table asset.
	TableInfo *CleanRoomTableInfo `json:"table_info,omitempty"`
	// Time at which this asset was updated, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`

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

func (CleanRoomAssetInfo) MarshalJSON added in v0.23.0

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

func (*CleanRoomAssetInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomCatalog added in v0.13.0

type CleanRoomCatalog struct {
	// Name of the catalog in the clean room station. Empty for notebooks.
	CatalogName string `json:"catalog_name,omitempty"`
	// The details of the shared notebook files.
	NotebookFiles []SharedDataObject `json:"notebook_files,omitempty"`
	// The details of the shared tables.
	Tables []SharedDataObject `json:"tables,omitempty"`

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

func (CleanRoomCatalog) MarshalJSON added in v0.23.0

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

func (*CleanRoomCatalog) UnmarshalJSON added in v0.23.0

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

type CleanRoomCatalogUpdate added in v0.13.0

type CleanRoomCatalogUpdate struct {
	// The name of the catalog to update assets.
	CatalogName string `json:"catalog_name,omitempty"`
	// The updates to the assets in the catalog.
	Updates *SharedDataObjectUpdate `json:"updates,omitempty"`

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

func (CleanRoomCatalogUpdate) MarshalJSON added in v0.23.0

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

func (*CleanRoomCatalogUpdate) UnmarshalJSON added in v0.23.0

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

type CleanRoomCollaboratorInfo added in v0.13.0

type CleanRoomCollaboratorInfo struct {
	// The global Unity Catalog metastore id of the collaborator. Also known as
	// the sharing identifier. The identifier is of format
	// __cloud__:__region__:__metastore-uuid__.
	GlobalMetastoreId string `json:"global_metastore_id,omitempty"`
	// The organization name of the collaborator. This is configured in the
	// metastore for Delta Sharing and is used to identify the organization to
	// other collaborators.
	OrganizationName string `json:"organization_name,omitempty"`

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

func (CleanRoomCollaboratorInfo) MarshalJSON added in v0.23.0

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

func (*CleanRoomCollaboratorInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomInfo added in v0.13.0

type CleanRoomInfo struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// Time at which this clean room was created, in epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Username of clean room creator.
	CreatedBy string `json:"created_by,omitempty"`
	// Catalog aliases shared by the current collaborator with asset details.
	LocalCatalogs []CleanRoomCatalog `json:"local_catalogs,omitempty"`
	// Name of the clean room.
	Name string `json:"name,omitempty"`
	// Username of current owner of clean room.
	Owner string `json:"owner,omitempty"`
	// Central clean room details.
	RemoteDetailedInfo *CentralCleanRoomInfo `json:"remote_detailed_info,omitempty"`
	// Time at which this clean room was updated, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Username of clean room updater.
	UpdatedBy string `json:"updated_by,omitempty"`

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

func (CleanRoomInfo) MarshalJSON added in v0.23.0

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

func (*CleanRoomInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomNotebookInfo added in v0.13.0

type CleanRoomNotebookInfo struct {
	// The base64 representation of the notebook content in HTML.
	NotebookContent string `json:"notebook_content,omitempty"`
	// The name of the notebook.
	NotebookName string `json:"notebook_name,omitempty"`

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

func (CleanRoomNotebookInfo) MarshalJSON added in v0.23.0

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

func (*CleanRoomNotebookInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomTableInfo added in v0.13.0

type CleanRoomTableInfo struct {
	// Name of parent catalog.
	CatalogName string `json:"catalog_name,omitempty"`
	// The array of __ColumnInfo__ definitions of the table's columns.
	Columns []ColumnInfo `json:"columns,omitempty"`
	// Full name of table, in form of
	// __catalog_name__.__schema_name__.__table_name__
	FullName string `json:"full_name,omitempty"`
	// Name of table, relative to parent schema.
	Name string `json:"name,omitempty"`
	// Name of parent schema relative to its parent catalog.
	SchemaName string `json:"schema_name,omitempty"`

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

func (CleanRoomTableInfo) MarshalJSON added in v0.23.0

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

func (*CleanRoomTableInfo) UnmarshalJSON added in v0.23.0

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

type CleanRoomsAPI added in v0.13.0

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

A clean room is a secure, privacy-protecting environment where two or more parties can share sensitive enterprise data, including customer data, for measurements, insights, activation and other use cases.

To create clean rooms, you must be a metastore admin or a user with the **CREATE_CLEAN_ROOM** privilege.

func NewCleanRooms added in v0.13.0

func NewCleanRooms(client *client.DatabricksClient) *CleanRoomsAPI

func (*CleanRoomsAPI) Create added in v0.13.0

func (a *CleanRoomsAPI) Create(ctx context.Context, request CreateCleanRoom) (*CleanRoomInfo, error)

Create a clean room.

Creates a new clean room with specified colaborators. The caller must be a metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the metastore.

func (*CleanRoomsAPI) Delete added in v0.13.0

func (a *CleanRoomsAPI) Delete(ctx context.Context, request DeleteCleanRoomRequest) error

Delete a clean room.

Deletes a data object clean room from the metastore. The caller must be an owner of the clean room.

func (*CleanRoomsAPI) DeleteByName added in v0.32.0

func (a *CleanRoomsAPI) DeleteByName(ctx context.Context, name string) error

Delete a clean room.

Deletes a data object clean room from the metastore. The caller must be an owner of the clean room.

func (*CleanRoomsAPI) Get added in v0.13.0

Get a clean room.

Gets a data object clean room from the metastore. The caller must be a metastore admin or the owner of the clean room.

func (*CleanRoomsAPI) GetByName added in v0.32.0

func (a *CleanRoomsAPI) GetByName(ctx context.Context, name string) (*CleanRoomInfo, error)

Get a clean room.

Gets a data object clean room from the metastore. The caller must be a metastore admin or the owner of the clean room.

func (*CleanRoomsAPI) Impl added in v0.13.0

func (a *CleanRoomsAPI) Impl() CleanRoomsService

Impl returns low-level CleanRooms API implementation Deprecated: use MockCleanRoomsInterface instead.

func (*CleanRoomsAPI) List added in v0.24.0

List clean rooms.

Gets an array of data object clean rooms from the metastore. The caller must be a metastore admin or the owner of the clean room. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

func (*CleanRoomsAPI) ListAll added in v0.13.0

func (a *CleanRoomsAPI) ListAll(ctx context.Context, request ListCleanRoomsRequest) ([]CleanRoomInfo, error)

List clean rooms.

Gets an array of data object clean rooms from the metastore. The caller must be a metastore admin or the owner of the clean room. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

func (*CleanRoomsAPI) Update added in v0.13.0

func (a *CleanRoomsAPI) Update(ctx context.Context, request UpdateCleanRoom) (*CleanRoomInfo, error)

Update a clean room.

Updates the clean room with the changes and data objects in the request. The caller must be the owner of the clean room or a metastore admin.

When the caller is a metastore admin, only the __owner__ field can be updated.

In the case that the clean room name is changed **updateCleanRoom** requires that the caller is both the clean room owner and a metastore admin.

For each table that is added through this method, the clean room owner must also have **SELECT** privilege on the table. The privilege must be maintained indefinitely for recipients to be able to access the table. Typically, you should use a group as the clean room owner.

Table removals through **update** do not require additional privileges.

func (*CleanRoomsAPI) WithImpl added in v0.13.0

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockCleanRoomsInterface instead.

type CleanRoomsInterface added in v0.29.0

type CleanRoomsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockCleanRoomsInterface instead.
	WithImpl(impl CleanRoomsService) CleanRoomsInterface

	// Impl returns low-level CleanRooms API implementation
	// Deprecated: use MockCleanRoomsInterface instead.
	Impl() CleanRoomsService

	// Create a clean room.
	//
	// Creates a new clean room with specified colaborators. The caller must be a
	// metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the metastore.
	Create(ctx context.Context, request CreateCleanRoom) (*CleanRoomInfo, error)

	// Delete a clean room.
	//
	// Deletes a data object clean room from the metastore. The caller must be an
	// owner of the clean room.
	Delete(ctx context.Context, request DeleteCleanRoomRequest) error

	// Delete a clean room.
	//
	// Deletes a data object clean room from the metastore. The caller must be an
	// owner of the clean room.
	DeleteByName(ctx context.Context, name string) error

	// Get a clean room.
	//
	// Gets a data object clean room from the metastore. The caller must be a
	// metastore admin or the owner of the clean room.
	Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoomInfo, error)

	// Get a clean room.
	//
	// Gets a data object clean room from the metastore. The caller must be a
	// metastore admin or the owner of the clean room.
	GetByName(ctx context.Context, name string) (*CleanRoomInfo, error)

	// List clean rooms.
	//
	// Gets an array of data object clean rooms from the metastore. The caller must
	// be a metastore admin or the owner of the clean room. There is no guarantee of
	// a specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context, request ListCleanRoomsRequest) listing.Iterator[CleanRoomInfo]

	// List clean rooms.
	//
	// Gets an array of data object clean rooms from the metastore. The caller must
	// be a metastore admin or the owner of the clean room. There is no guarantee of
	// a specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context, request ListCleanRoomsRequest) ([]CleanRoomInfo, error)

	// Update a clean room.
	//
	// Updates the clean room with the changes and data objects in the request. The
	// caller must be the owner of the clean room or a metastore admin.
	//
	// When the caller is a metastore admin, only the __owner__ field can be
	// updated.
	//
	// In the case that the clean room name is changed **updateCleanRoom** requires
	// that the caller is both the clean room owner and a metastore admin.
	//
	// For each table that is added through this method, the clean room owner must
	// also have **SELECT** privilege on the table. The privilege must be maintained
	// indefinitely for recipients to be able to access the table. Typically, you
	// should use a group as the clean room owner.
	//
	// Table removals through **update** do not require additional privileges.
	Update(ctx context.Context, request UpdateCleanRoom) (*CleanRoomInfo, error)
}

type CleanRoomsService added in v0.13.0

type CleanRoomsService interface {

	// Create a clean room.
	//
	// Creates a new clean room with specified colaborators. The caller must be
	// a metastore admin or have the **CREATE_CLEAN_ROOM** privilege on the
	// metastore.
	Create(ctx context.Context, request CreateCleanRoom) (*CleanRoomInfo, error)

	// Delete a clean room.
	//
	// Deletes a data object clean room from the metastore. The caller must be
	// an owner of the clean room.
	Delete(ctx context.Context, request DeleteCleanRoomRequest) error

	// Get a clean room.
	//
	// Gets a data object clean room from the metastore. The caller must be a
	// metastore admin or the owner of the clean room.
	Get(ctx context.Context, request GetCleanRoomRequest) (*CleanRoomInfo, error)

	// List clean rooms.
	//
	// Gets an array of data object clean rooms from the metastore. The caller
	// must be a metastore admin or the owner of the clean room. There is no
	// guarantee of a specific ordering of the elements in the array.
	//
	// Use ListAll() to get all CleanRoomInfo instances, which will iterate over every result page.
	List(ctx context.Context, request ListCleanRoomsRequest) (*ListCleanRoomsResponse, error)

	// Update a clean room.
	//
	// Updates the clean room with the changes and data objects in the request.
	// The caller must be the owner of the clean room or a metastore admin.
	//
	// When the caller is a metastore admin, only the __owner__ field can be
	// updated.
	//
	// In the case that the clean room name is changed **updateCleanRoom**
	// requires that the caller is both the clean room owner and a metastore
	// admin.
	//
	// For each table that is added through this method, the clean room owner
	// must also have **SELECT** privilege on the table. The privilege must be
	// maintained indefinitely for recipients to be able to access the table.
	// Typically, you should use a group as the clean room owner.
	//
	// Table removals through **update** do not require additional privileges.
	Update(ctx context.Context, request UpdateCleanRoom) (*CleanRoomInfo, error)
}

A clean room is a secure, privacy-protecting environment where two or more parties can share sensitive enterprise data, including customer data, for measurements, insights, activation and other use cases.

To create clean rooms, you must be a metastore admin or a user with the **CREATE_CLEAN_ROOM** privilege.

type ColumnInfo added in v0.13.0

type ColumnInfo struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`

	Mask *ColumnMask `json:"mask,omitempty"`
	// Name of Column.
	Name string `json:"name,omitempty"`
	// Whether field may be Null (default: true).
	Nullable bool `json:"nullable,omitempty"`
	// Partition index for column.
	PartitionIndex int `json:"partition_index,omitempty"`
	// Ordinal position of column (starting at position 0).
	Position int `json:"position,omitempty"`
	// Format of IntervalType.
	TypeIntervalType string `json:"type_interval_type,omitempty"`
	// Full data type specification, JSON-serialized.
	TypeJson string `json:"type_json,omitempty"`
	// Name of type (INT, STRUCT, MAP, etc.).
	TypeName ColumnTypeName `json:"type_name,omitempty"`
	// Digits of precision; required for DecimalTypes.
	TypePrecision int `json:"type_precision,omitempty"`
	// Digits to right of decimal; Required for DecimalTypes.
	TypeScale int `json:"type_scale,omitempty"`
	// Full data type specification as SQL/catalogString text.
	TypeText string `json:"type_text,omitempty"`

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

func (ColumnInfo) MarshalJSON added in v0.23.0

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

func (*ColumnInfo) UnmarshalJSON added in v0.23.0

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

type ColumnMask added in v0.13.0

type ColumnMask struct {
	// The full name of the column mask SQL UDF.
	FunctionName string `json:"function_name,omitempty"`
	// The list of additional table columns to be passed as input to the column
	// mask function. The first arg of the mask function should be of the type
	// of the column being masked and the types of the rest of the args should
	// match the types of columns in 'using_column_names'.
	UsingColumnNames []string `json:"using_column_names,omitempty"`

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

func (ColumnMask) MarshalJSON added in v0.23.0

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

func (*ColumnMask) UnmarshalJSON added in v0.23.0

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

type ColumnTypeName added in v0.13.0

type ColumnTypeName string

Name of type (INT, STRUCT, MAP, etc.).

const ColumnTypeNameArray ColumnTypeName = `ARRAY`
const ColumnTypeNameBinary ColumnTypeName = `BINARY`
const ColumnTypeNameBoolean ColumnTypeName = `BOOLEAN`
const ColumnTypeNameByte ColumnTypeName = `BYTE`
const ColumnTypeNameChar ColumnTypeName = `CHAR`
const ColumnTypeNameDate ColumnTypeName = `DATE`
const ColumnTypeNameDecimal ColumnTypeName = `DECIMAL`
const ColumnTypeNameDouble ColumnTypeName = `DOUBLE`
const ColumnTypeNameFloat ColumnTypeName = `FLOAT`
const ColumnTypeNameInt ColumnTypeName = `INT`
const ColumnTypeNameInterval ColumnTypeName = `INTERVAL`
const ColumnTypeNameLong ColumnTypeName = `LONG`
const ColumnTypeNameMap ColumnTypeName = `MAP`
const ColumnTypeNameNull ColumnTypeName = `NULL`
const ColumnTypeNameShort ColumnTypeName = `SHORT`
const ColumnTypeNameString ColumnTypeName = `STRING`
const ColumnTypeNameStruct ColumnTypeName = `STRUCT`
const ColumnTypeNameTableType ColumnTypeName = `TABLE_TYPE`
const ColumnTypeNameTimestamp ColumnTypeName = `TIMESTAMP`
const ColumnTypeNameTimestampNtz ColumnTypeName = `TIMESTAMP_NTZ`
const ColumnTypeNameUserDefinedType ColumnTypeName = `USER_DEFINED_TYPE`

func (*ColumnTypeName) Set added in v0.13.0

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

Set raw string value and validate it against allowed values

func (*ColumnTypeName) String added in v0.13.0

func (f *ColumnTypeName) String() string

String representation for fmt.Print

func (*ColumnTypeName) Type added in v0.13.0

func (f *ColumnTypeName) Type() string

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

type CreateCleanRoom added in v0.13.0

type CreateCleanRoom struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// Name of the clean room.
	Name string `json:"name"`
	// Central clean room details.
	RemoteDetailedInfo CentralCleanRoomInfo `json:"remote_detailed_info"`

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

func (CreateCleanRoom) MarshalJSON added in v0.23.0

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

func (*CreateCleanRoom) UnmarshalJSON added in v0.23.0

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

type CreateProvider

type CreateProvider struct {
	// The delta sharing authentication type.
	AuthenticationType AuthenticationType `json:"authentication_type"`
	// Description about the provider.
	Comment string `json:"comment,omitempty"`
	// The name of the Provider.
	Name string `json:"name"`
	// This field is required when the __authentication_type__ is **TOKEN** or
	// not provided.
	RecipientProfileStr string `json:"recipient_profile_str,omitempty"`

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

func (CreateProvider) MarshalJSON added in v0.23.0

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

func (*CreateProvider) UnmarshalJSON added in v0.23.0

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

type CreateRecipient

type CreateRecipient struct {
	// The delta sharing authentication type.
	AuthenticationType AuthenticationType `json:"authentication_type"`
	// Description about the recipient.
	Comment string `json:"comment,omitempty"`
	// The global Unity Catalog metastore id provided by the data recipient.
	// This field is required when the __authentication_type__ is
	// **DATABRICKS**. The identifier is of format
	// __cloud__:__region__:__metastore-uuid__.
	DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"`
	// IP Access List
	IpAccessList *IpAccessList `json:"ip_access_list,omitempty"`
	// Name of Recipient.
	Name string `json:"name"`
	// Username of the recipient owner.
	Owner string `json:"owner,omitempty"`
	// Recipient properties as map of string key-value pairs.
	PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"`
	// The one-time sharing code provided by the data recipient. This field is
	// required when the __authentication_type__ is **DATABRICKS**.
	SharingCode string `json:"sharing_code,omitempty"`

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

func (CreateRecipient) MarshalJSON added in v0.23.0

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

func (*CreateRecipient) UnmarshalJSON added in v0.23.0

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

type CreateShare

type CreateShare struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// Name of the share.
	Name string `json:"name"`
	// Storage root URL for the share.
	StorageRoot string `json:"storage_root,omitempty"`

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

func (CreateShare) MarshalJSON added in v0.23.0

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

func (*CreateShare) UnmarshalJSON added in v0.23.0

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

type DeleteCleanRoomRequest added in v0.13.0

type DeleteCleanRoomRequest struct {
	// The name of the clean room.
	Name string `json:"-" url:"-"`
}

Delete a clean room

type DeleteProviderRequest

type DeleteProviderRequest struct {
	// Name of the provider.
	Name string `json:"-" url:"-"`
}

Delete a provider

type DeleteRecipientRequest

type DeleteRecipientRequest struct {
	// Name of the recipient.
	Name string `json:"-" url:"-"`
}

Delete a share recipient

type DeleteResponse added in v0.34.0

type DeleteResponse struct {
}

type DeleteShareRequest

type DeleteShareRequest struct {
	// The name of the share.
	Name string `json:"-" url:"-"`
}

Delete a share

type GetActivationUrlInfoRequest

type GetActivationUrlInfoRequest struct {
	// The one time activation url. It also accepts activation token.
	ActivationUrl string `json:"-" url:"-"`
}

Get a share activation URL

type GetActivationUrlInfoResponse added in v0.34.0

type GetActivationUrlInfoResponse struct {
}

type GetCleanRoomRequest added in v0.13.0

type GetCleanRoomRequest struct {
	// Whether to include remote details (central) on the clean room.
	IncludeRemoteDetails bool `json:"-" url:"include_remote_details,omitempty"`
	// The name of the clean room.
	Name string `json:"-" url:"-"`

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

Get a clean room

func (GetCleanRoomRequest) MarshalJSON added in v0.23.0

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

func (*GetCleanRoomRequest) UnmarshalJSON added in v0.23.0

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

type GetProviderRequest

type GetProviderRequest struct {
	// Name of the provider.
	Name string `json:"-" url:"-"`
}

Get a provider

type GetRecipientRequest

type GetRecipientRequest struct {
	// Name of the recipient.
	Name string `json:"-" url:"-"`
}

Get a share recipient

type GetRecipientSharePermissionsResponse

type GetRecipientSharePermissionsResponse struct {
	// An array of data share permissions for a recipient.
	PermissionsOut []ShareToPrivilegeAssignment `json:"permissions_out,omitempty"`
}

type GetShareRequest

type GetShareRequest struct {
	// Query for data to include in the share.
	IncludeSharedData bool `json:"-" url:"include_shared_data,omitempty"`
	// The name of the share.
	Name string `json:"-" url:"-"`

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

Get a share

func (GetShareRequest) MarshalJSON added in v0.23.0

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

func (*GetShareRequest) UnmarshalJSON added in v0.23.0

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

type IpAccessList

type IpAccessList struct {
	// Allowed IP Addresses in CIDR notation. Limit of 100.
	AllowedIpAddresses []string `json:"allowed_ip_addresses,omitempty"`
}

type ListCleanRoomsRequest added in v0.21.0

type ListCleanRoomsRequest struct {
	// Maximum number of clean rooms to return. If not set, all the clean rooms
	// are returned (not recommended). - when set to a value greater than 0, the
	// page length is the minimum of this value and a server configured value; -
	// when set to 0, the page length is set to a server configured value
	// (recommended); - when set to a value less than 0, an invalid parameter
	// error is returned;
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// Opaque pagination token to go to next page based on previous query.
	PageToken string `json:"-" url:"page_token,omitempty"`

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

List clean rooms

func (ListCleanRoomsRequest) MarshalJSON added in v0.23.0

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

func (*ListCleanRoomsRequest) UnmarshalJSON added in v0.23.0

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

type ListCleanRoomsResponse added in v0.13.0

type ListCleanRoomsResponse struct {
	// An array of clean rooms. Remote details (central) are not included.
	CleanRooms []CleanRoomInfo `json:"clean_rooms,omitempty"`
	// Opaque token to retrieve the next page of results. Absent if there are no
	// more pages. __page_token__ should be set to this value for the next
	// request (for the next page of results).
	NextPageToken string `json:"next_page_token,omitempty"`

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

func (ListCleanRoomsResponse) MarshalJSON added in v0.23.0

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

func (*ListCleanRoomsResponse) UnmarshalJSON added in v0.23.0

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

type ListProviderSharesResponse

type ListProviderSharesResponse struct {
	// An array of provider shares.
	Shares []ProviderShare `json:"shares,omitempty"`
}

type ListProvidersRequest

type ListProvidersRequest struct {
	// If not provided, all providers will be returned. If no providers exist
	// with this ID, no results will be returned.
	DataProviderGlobalMetastoreId string `json:"-" url:"data_provider_global_metastore_id,omitempty"`

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

List providers

func (ListProvidersRequest) MarshalJSON added in v0.23.0

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

func (*ListProvidersRequest) UnmarshalJSON added in v0.23.0

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

type ListProvidersResponse

type ListProvidersResponse struct {
	// An array of provider information objects.
	Providers []ProviderInfo `json:"providers,omitempty"`
}

type ListRecipientsRequest

type ListRecipientsRequest struct {
	// If not provided, all recipients will be returned. If no recipients exist
	// with this ID, no results will be returned.
	DataRecipientGlobalMetastoreId string `json:"-" url:"data_recipient_global_metastore_id,omitempty"`

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

List share recipients

func (ListRecipientsRequest) MarshalJSON added in v0.23.0

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

func (*ListRecipientsRequest) UnmarshalJSON added in v0.23.0

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

type ListRecipientsResponse

type ListRecipientsResponse struct {
	// An array of recipient information objects.
	Recipients []RecipientInfo `json:"recipients,omitempty"`
}

type ListSharesRequest

type ListSharesRequest struct {
	// Name of the provider in which to list shares.
	Name string `json:"-" url:"-"`
}

List shares by Provider

type ListSharesResponse

type ListSharesResponse struct {
	// An array of data share information objects.
	Shares []ShareInfo `json:"shares,omitempty"`
}

type Partition

type Partition struct {
	// An array of partition values.
	Values []PartitionValue `json:"values,omitempty"`
}

type PartitionValue

type PartitionValue struct {
	// The name of the partition column.
	Name string `json:"name,omitempty"`
	// The operator to apply for the value.
	Op PartitionValueOp `json:"op,omitempty"`
	// The key of a Delta Sharing recipient's property. For example
	// `databricks-account-id`. When this field is set, field `value` can not be
	// set.
	RecipientPropertyKey string `json:"recipient_property_key,omitempty"`
	// The value of the partition column. When this value is not set, it means
	// `null` value. When this field is set, field `recipient_property_key` can
	// not be set.
	Value string `json:"value,omitempty"`

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

func (PartitionValue) MarshalJSON added in v0.23.0

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

func (*PartitionValue) UnmarshalJSON added in v0.23.0

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

type PartitionValueOp

type PartitionValueOp string

The operator to apply for the value.

const PartitionValueOpEqual PartitionValueOp = `EQUAL`
const PartitionValueOpLike PartitionValueOp = `LIKE`

func (*PartitionValueOp) Set

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

Set raw string value and validate it against allowed values

func (*PartitionValueOp) String

func (f *PartitionValueOp) String() string

String representation for fmt.Print

func (*PartitionValueOp) Type

func (f *PartitionValueOp) Type() string

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

type Privilege

type Privilege string
const PrivilegeAccess Privilege = `ACCESS`
const PrivilegeAllPrivileges Privilege = `ALL_PRIVILEGES`
const PrivilegeApplyTag Privilege = `APPLY_TAG`
const PrivilegeCreate Privilege = `CREATE`
const PrivilegeCreateCatalog Privilege = `CREATE_CATALOG`
const PrivilegeCreateConnection Privilege = `CREATE_CONNECTION`
const PrivilegeCreateExternalLocation Privilege = `CREATE_EXTERNAL_LOCATION`
const PrivilegeCreateExternalTable Privilege = `CREATE_EXTERNAL_TABLE`
const PrivilegeCreateExternalVolume Privilege = `CREATE_EXTERNAL_VOLUME`
const PrivilegeCreateForeignCatalog Privilege = `CREATE_FOREIGN_CATALOG`
const PrivilegeCreateFunction Privilege = `CREATE_FUNCTION`
const PrivilegeCreateManagedStorage Privilege = `CREATE_MANAGED_STORAGE`
const PrivilegeCreateMaterializedView Privilege = `CREATE_MATERIALIZED_VIEW`
const PrivilegeCreateModel Privilege = `CREATE_MODEL`
const PrivilegeCreateProvider Privilege = `CREATE_PROVIDER`
const PrivilegeCreateRecipient Privilege = `CREATE_RECIPIENT`
const PrivilegeCreateSchema Privilege = `CREATE_SCHEMA`
const PrivilegeCreateServiceCredential Privilege = `CREATE_SERVICE_CREDENTIAL`
const PrivilegeCreateShare Privilege = `CREATE_SHARE`
const PrivilegeCreateStorageCredential Privilege = `CREATE_STORAGE_CREDENTIAL`
const PrivilegeCreateTable Privilege = `CREATE_TABLE`
const PrivilegeCreateView Privilege = `CREATE_VIEW`
const PrivilegeCreateVolume Privilege = `CREATE_VOLUME`
const PrivilegeExecute Privilege = `EXECUTE`
const PrivilegeManageAllowlist Privilege = `MANAGE_ALLOWLIST`
const PrivilegeModify Privilege = `MODIFY`
const PrivilegeReadFiles Privilege = `READ_FILES`
const PrivilegeReadPrivateFiles Privilege = `READ_PRIVATE_FILES`
const PrivilegeReadVolume Privilege = `READ_VOLUME`
const PrivilegeRefresh Privilege = `REFRESH`
const PrivilegeSelect Privilege = `SELECT`
const PrivilegeSetSharePermission Privilege = `SET_SHARE_PERMISSION`
const PrivilegeSingleUserAccess Privilege = `SINGLE_USER_ACCESS`
const PrivilegeUsage Privilege = `USAGE`
const PrivilegeUseCatalog Privilege = `USE_CATALOG`
const PrivilegeUseConnection Privilege = `USE_CONNECTION`
const PrivilegeUseMarketplaceAssets Privilege = `USE_MARKETPLACE_ASSETS`
const PrivilegeUseProvider Privilege = `USE_PROVIDER`
const PrivilegeUseRecipient Privilege = `USE_RECIPIENT`
const PrivilegeUseSchema Privilege = `USE_SCHEMA`
const PrivilegeUseShare Privilege = `USE_SHARE`
const PrivilegeWriteFiles Privilege = `WRITE_FILES`
const PrivilegeWritePrivateFiles Privilege = `WRITE_PRIVATE_FILES`
const PrivilegeWriteVolume Privilege = `WRITE_VOLUME`

func (*Privilege) Set

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

Set raw string value and validate it against allowed values

func (*Privilege) String

func (f *Privilege) String() string

String representation for fmt.Print

func (*Privilege) Type

func (f *Privilege) Type() string

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

type PrivilegeAssignment

type PrivilegeAssignment struct {
	// The principal (user email address or group name).
	Principal string `json:"principal,omitempty"`
	// The privileges assigned to the principal.
	Privileges []Privilege `json:"privileges,omitempty"`

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

func (PrivilegeAssignment) MarshalJSON added in v0.23.0

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

func (*PrivilegeAssignment) UnmarshalJSON added in v0.23.0

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

type ProviderInfo

type ProviderInfo struct {
	// The delta sharing authentication type.
	AuthenticationType AuthenticationType `json:"authentication_type,omitempty"`
	// Cloud vendor of the provider's UC metastore. This field is only present
	// when the __authentication_type__ is **DATABRICKS**.
	Cloud string `json:"cloud,omitempty"`
	// Description about the provider.
	Comment string `json:"comment,omitempty"`
	// Time at which this Provider was created, in epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Username of Provider creator.
	CreatedBy string `json:"created_by,omitempty"`
	// The global UC metastore id of the data provider. This field is only
	// present when the __authentication_type__ is **DATABRICKS**. The
	// identifier is of format <cloud>:<region>:<metastore-uuid>.
	DataProviderGlobalMetastoreId string `json:"data_provider_global_metastore_id,omitempty"`
	// UUID of the provider's UC metastore. This field is only present when the
	// __authentication_type__ is **DATABRICKS**.
	MetastoreId string `json:"metastore_id,omitempty"`
	// The name of the Provider.
	Name string `json:"name,omitempty"`
	// Username of Provider owner.
	Owner string `json:"owner,omitempty"`
	// The recipient profile. This field is only present when the
	// authentication_type is `TOKEN`.
	RecipientProfile *RecipientProfile `json:"recipient_profile,omitempty"`
	// This field is only present when the authentication_type is `TOKEN` or not
	// provided.
	RecipientProfileStr string `json:"recipient_profile_str,omitempty"`
	// Cloud region of the provider's UC metastore. This field is only present
	// when the __authentication_type__ is **DATABRICKS**.
	Region string `json:"region,omitempty"`
	// Time at which this Provider was created, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Username of user who last modified Share.
	UpdatedBy string `json:"updated_by,omitempty"`

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

func (ProviderInfo) MarshalJSON added in v0.23.0

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

func (*ProviderInfo) UnmarshalJSON added in v0.23.0

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

type ProviderShare

type ProviderShare struct {
	// The name of the Provider Share.
	Name string `json:"name,omitempty"`

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

func (ProviderShare) MarshalJSON added in v0.23.0

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

func (*ProviderShare) UnmarshalJSON added in v0.23.0

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

type ProvidersAPI

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

A data provider is an object representing the organization in the real world who shares the data. A provider contains shares which further contain the shared data.

func NewProviders

func NewProviders(client *client.DatabricksClient) *ProvidersAPI

func (*ProvidersAPI) Create

func (a *ProvidersAPI) Create(ctx context.Context, request CreateProvider) (*ProviderInfo, error)

Create an auth provider.

Creates a new authentication provider minimally based on a name and authentication type. The caller must be an admin on the metastore.

Example (Providers)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

publicShareRecipient := `{
        "shareCredentialsVersion":1,
        "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz",
        "endpoint":"https://sharing.delta.io/delta-sharing/"
    }
`

created, err := w.Providers.Create(ctx, sharing.CreateProvider{
	Name:                fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	RecipientProfileStr: publicShareRecipient,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.Providers.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*ProvidersAPI) Delete

func (a *ProvidersAPI) Delete(ctx context.Context, request DeleteProviderRequest) error

Delete a provider.

Deletes an authentication provider, if the caller is a metastore admin or is the owner of the provider.

func (*ProvidersAPI) DeleteByName

func (a *ProvidersAPI) DeleteByName(ctx context.Context, name string) error

Delete a provider.

Deletes an authentication provider, if the caller is a metastore admin or is the owner of the provider.

func (*ProvidersAPI) Get

Get a provider.

Gets a specific authentication provider. The caller must supply the name of the provider, and must either be a metastore admin or the owner of the provider.

Example (Providers)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

publicShareRecipient := `{
        "shareCredentialsVersion":1,
        "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz",
        "endpoint":"https://sharing.delta.io/delta-sharing/"
    }
`

created, err := w.Providers.Create(ctx, sharing.CreateProvider{
	Name:                fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	RecipientProfileStr: publicShareRecipient,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

_, err = w.Providers.GetByName(ctx, created.Name)
if err != nil {
	panic(err)
}

// cleanup

err = w.Providers.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*ProvidersAPI) GetByName

func (a *ProvidersAPI) GetByName(ctx context.Context, name string) (*ProviderInfo, error)

Get a provider.

Gets a specific authentication provider. The caller must supply the name of the provider, and must either be a metastore admin or the owner of the provider.

func (*ProvidersAPI) Impl

func (a *ProvidersAPI) Impl() ProvidersService

Impl returns low-level Providers API implementation Deprecated: use MockProvidersInterface instead.

func (*ProvidersAPI) List added in v0.24.0

List providers.

Gets an array of available authentication providers. The caller must either be a metastore admin or the owner of the providers. Providers not owned by the caller are not included in the response. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

func (*ProvidersAPI) ListAll

func (a *ProvidersAPI) ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error)

List providers.

Gets an array of available authentication providers. The caller must either be a metastore admin or the owner of the providers. Providers not owned by the caller are not included in the response. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

Example (Providers)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.Providers.ListAll(ctx, sharing.ListProvidersRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*ProvidersAPI) ListShares

List shares by Provider.

Gets an array of a specified provider's shares within the metastore where:

* the caller is a metastore admin, or * the caller is the owner.

This method is generated by Databricks SDK Code Generator.

Example (Providers)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

publicShareRecipient := `{
        "shareCredentialsVersion":1,
        "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz",
        "endpoint":"https://sharing.delta.io/delta-sharing/"
    }
`

created, err := w.Providers.Create(ctx, sharing.CreateProvider{
	Name:                fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	RecipientProfileStr: publicShareRecipient,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

shares, err := w.Providers.ListSharesAll(ctx, sharing.ListSharesRequest{
	Name: created.Name,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", shares)

// cleanup

err = w.Providers.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*ProvidersAPI) ListSharesAll added in v0.10.0

func (a *ProvidersAPI) ListSharesAll(ctx context.Context, request ListSharesRequest) ([]ProviderShare, error)

List shares by Provider.

Gets an array of a specified provider's shares within the metastore where:

* the caller is a metastore admin, or * the caller is the owner.

This method is generated by Databricks SDK Code Generator.

func (*ProvidersAPI) ListSharesByName

func (a *ProvidersAPI) ListSharesByName(ctx context.Context, name string) (*ListProviderSharesResponse, error)

List shares by Provider.

Gets an array of a specified provider's shares within the metastore where:

* the caller is a metastore admin, or * the caller is the owner.

func (*ProvidersAPI) ProviderInfoNameToMetastoreIdMap

func (a *ProvidersAPI) ProviderInfoNameToMetastoreIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error)

ProviderInfoNameToMetastoreIdMap calls ProvidersAPI.ListAll and creates a map of results with ProviderInfo.Name as key and ProviderInfo.MetastoreId as value.

Returns an error if there's more than one ProviderInfo with the same .Name.

Note: All ProviderInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*ProvidersAPI) Update

func (a *ProvidersAPI) Update(ctx context.Context, request UpdateProvider) (*ProviderInfo, error)

Update a provider.

Updates the information for an authentication provider, if the caller is a metastore admin or is the owner of the provider. If the update changes the provider name, the caller must be both a metastore admin and the owner of the provider.

Example (Providers)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

publicShareRecipient := `{
        "shareCredentialsVersion":1,
        "bearerToken":"dapiabcdefghijklmonpqrstuvwxyz",
        "endpoint":"https://sharing.delta.io/delta-sharing/"
    }
`

created, err := w.Providers.Create(ctx, sharing.CreateProvider{
	Name:                fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	RecipientProfileStr: publicShareRecipient,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

_, err = w.Providers.Update(ctx, sharing.UpdateProvider{
	Name:    created.Name,
	Comment: "Comment for update",
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Providers.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*ProvidersAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockProvidersInterface instead.

type ProvidersInterface added in v0.29.0

type ProvidersInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockProvidersInterface instead.
	WithImpl(impl ProvidersService) ProvidersInterface

	// Impl returns low-level Providers API implementation
	// Deprecated: use MockProvidersInterface instead.
	Impl() ProvidersService

	// Create an auth provider.
	//
	// Creates a new authentication provider minimally based on a name and
	// authentication type. The caller must be an admin on the metastore.
	Create(ctx context.Context, request CreateProvider) (*ProviderInfo, error)

	// Delete a provider.
	//
	// Deletes an authentication provider, if the caller is a metastore admin or is
	// the owner of the provider.
	Delete(ctx context.Context, request DeleteProviderRequest) error

	// Delete a provider.
	//
	// Deletes an authentication provider, if the caller is a metastore admin or is
	// the owner of the provider.
	DeleteByName(ctx context.Context, name string) error

	// Get a provider.
	//
	// Gets a specific authentication provider. The caller must supply the name of
	// the provider, and must either be a metastore admin or the owner of the
	// provider.
	Get(ctx context.Context, request GetProviderRequest) (*ProviderInfo, error)

	// Get a provider.
	//
	// Gets a specific authentication provider. The caller must supply the name of
	// the provider, and must either be a metastore admin or the owner of the
	// provider.
	GetByName(ctx context.Context, name string) (*ProviderInfo, error)

	// List providers.
	//
	// Gets an array of available authentication providers. The caller must either
	// be a metastore admin or the owner of the providers. Providers not owned by
	// the caller are not included in the response. There is no guarantee of a
	// specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context, request ListProvidersRequest) listing.Iterator[ProviderInfo]

	// List providers.
	//
	// Gets an array of available authentication providers. The caller must either
	// be a metastore admin or the owner of the providers. Providers not owned by
	// the caller are not included in the response. There is no guarantee of a
	// specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context, request ListProvidersRequest) ([]ProviderInfo, error)

	// ProviderInfoNameToMetastoreIdMap calls [ProvidersAPI.ListAll] and creates a map of results with [ProviderInfo].Name as key and [ProviderInfo].MetastoreId as value.
	//
	// Returns an error if there's more than one [ProviderInfo] with the same .Name.
	//
	// Note: All [ProviderInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	ProviderInfoNameToMetastoreIdMap(ctx context.Context, request ListProvidersRequest) (map[string]string, error)

	// List shares by Provider.
	//
	// Gets an array of a specified provider's shares within the metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListShares(ctx context.Context, request ListSharesRequest) listing.Iterator[ProviderShare]

	// List shares by Provider.
	//
	// Gets an array of a specified provider's shares within the metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListSharesAll(ctx context.Context, request ListSharesRequest) ([]ProviderShare, error)

	// List shares by Provider.
	//
	// Gets an array of a specified provider's shares within the metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner.
	ListSharesByName(ctx context.Context, name string) (*ListProviderSharesResponse, error)

	// Update a provider.
	//
	// Updates the information for an authentication provider, if the caller is a
	// metastore admin or is the owner of the provider. If the update changes the
	// provider name, the caller must be both a metastore admin and the owner of the
	// provider.
	Update(ctx context.Context, request UpdateProvider) (*ProviderInfo, error)
}

type ProvidersService

type ProvidersService interface {

	// Create an auth provider.
	//
	// Creates a new authentication provider minimally based on a name and
	// authentication type. The caller must be an admin on the metastore.
	Create(ctx context.Context, request CreateProvider) (*ProviderInfo, error)

	// Delete a provider.
	//
	// Deletes an authentication provider, if the caller is a metastore admin or
	// is the owner of the provider.
	Delete(ctx context.Context, request DeleteProviderRequest) error

	// Get a provider.
	//
	// Gets a specific authentication provider. The caller must supply the name
	// of the provider, and must either be a metastore admin or the owner of the
	// provider.
	Get(ctx context.Context, request GetProviderRequest) (*ProviderInfo, error)

	// List providers.
	//
	// Gets an array of available authentication providers. The caller must
	// either be a metastore admin or the owner of the providers. Providers not
	// owned by the caller are not included in the response. There is no
	// guarantee of a specific ordering of the elements in the array.
	//
	// Use ListAll() to get all ProviderInfo instances
	List(ctx context.Context, request ListProvidersRequest) (*ListProvidersResponse, error)

	// List shares by Provider.
	//
	// Gets an array of a specified provider's shares within the metastore
	// where:
	//
	// * the caller is a metastore admin, or * the caller is the owner.
	//
	// Use ListSharesAll() to get all ProviderShare instances
	ListShares(ctx context.Context, request ListSharesRequest) (*ListProviderSharesResponse, error)

	// Update a provider.
	//
	// Updates the information for an authentication provider, if the caller is
	// a metastore admin or is the owner of the provider. If the update changes
	// the provider name, the caller must be both a metastore admin and the
	// owner of the provider.
	Update(ctx context.Context, request UpdateProvider) (*ProviderInfo, error)
}

A data provider is an object representing the organization in the real world who shares the data. A provider contains shares which further contain the shared data.

type RecipientActivationAPI

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

The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of `TOKEN`. The data recipient follows the activation link shared by the data provider to download the credential file that includes the access token. The recipient will then use the credential file to establish a secure connection with the provider to receive the shared data.

Note that you can download the credential file only once. Recipients should treat the downloaded credential as a secret and must not share it outside of their organization.

func NewRecipientActivation

func NewRecipientActivation(client *client.DatabricksClient) *RecipientActivationAPI

func (*RecipientActivationAPI) GetActivationUrlInfo

func (a *RecipientActivationAPI) GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error

Get a share activation URL.

Gets an activation URL for a share.

func (*RecipientActivationAPI) GetActivationUrlInfoByActivationUrl

func (a *RecipientActivationAPI) GetActivationUrlInfoByActivationUrl(ctx context.Context, activationUrl string) error

Get a share activation URL.

Gets an activation URL for a share.

func (*RecipientActivationAPI) Impl

Impl returns low-level RecipientActivation API implementation Deprecated: use MockRecipientActivationInterface instead.

func (*RecipientActivationAPI) RetrieveToken

Get an access token.

Retrieve access token with an activation url. This is a public API without any authentication.

func (*RecipientActivationAPI) RetrieveTokenByActivationUrl

func (a *RecipientActivationAPI) RetrieveTokenByActivationUrl(ctx context.Context, activationUrl string) (*RetrieveTokenResponse, error)

Get an access token.

Retrieve access token with an activation url. This is a public API without any authentication.

func (*RecipientActivationAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockRecipientActivationInterface instead.

type RecipientActivationInterface added in v0.29.0

type RecipientActivationInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockRecipientActivationInterface instead.
	WithImpl(impl RecipientActivationService) RecipientActivationInterface

	// Impl returns low-level RecipientActivation API implementation
	// Deprecated: use MockRecipientActivationInterface instead.
	Impl() RecipientActivationService

	// Get a share activation URL.
	//
	// Gets an activation URL for a share.
	GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error

	// Get a share activation URL.
	//
	// Gets an activation URL for a share.
	GetActivationUrlInfoByActivationUrl(ctx context.Context, activationUrl string) error

	// Get an access token.
	//
	// Retrieve access token with an activation url. This is a public API without
	// any authentication.
	RetrieveToken(ctx context.Context, request RetrieveTokenRequest) (*RetrieveTokenResponse, error)

	// Get an access token.
	//
	// Retrieve access token with an activation url. This is a public API without
	// any authentication.
	RetrieveTokenByActivationUrl(ctx context.Context, activationUrl string) (*RetrieveTokenResponse, error)
}

type RecipientActivationService

type RecipientActivationService interface {

	// Get a share activation URL.
	//
	// Gets an activation URL for a share.
	GetActivationUrlInfo(ctx context.Context, request GetActivationUrlInfoRequest) error

	// Get an access token.
	//
	// Retrieve access token with an activation url. This is a public API
	// without any authentication.
	RetrieveToken(ctx context.Context, request RetrieveTokenRequest) (*RetrieveTokenResponse, error)
}

The Recipient Activation API is only applicable in the open sharing model where the recipient object has the authentication type of `TOKEN`. The data recipient follows the activation link shared by the data provider to download the credential file that includes the access token. The recipient will then use the credential file to establish a secure connection with the provider to receive the shared data.

Note that you can download the credential file only once. Recipients should treat the downloaded credential as a secret and must not share it outside of their organization.

type RecipientInfo

type RecipientInfo struct {
	// A boolean status field showing whether the Recipient's activation URL has
	// been exercised or not.
	Activated bool `json:"activated,omitempty"`
	// Full activation url to retrieve the access token. It will be empty if the
	// token is already retrieved.
	ActivationUrl string `json:"activation_url,omitempty"`
	// The delta sharing authentication type.
	AuthenticationType AuthenticationType `json:"authentication_type,omitempty"`
	// Cloud vendor of the recipient's Unity Catalog Metstore. This field is
	// only present when the __authentication_type__ is **DATABRICKS**`.
	Cloud string `json:"cloud,omitempty"`
	// Description about the recipient.
	Comment string `json:"comment,omitempty"`
	// Time at which this recipient was created, in epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Username of recipient creator.
	CreatedBy string `json:"created_by,omitempty"`
	// The global Unity Catalog metastore id provided by the data recipient.
	// This field is only present when the __authentication_type__ is
	// **DATABRICKS**. The identifier is of format
	// __cloud__:__region__:__metastore-uuid__.
	DataRecipientGlobalMetastoreId string `json:"data_recipient_global_metastore_id,omitempty"`
	// IP Access List
	IpAccessList *IpAccessList `json:"ip_access_list,omitempty"`
	// Unique identifier of recipient's Unity Catalog metastore. This field is
	// only present when the __authentication_type__ is **DATABRICKS**
	MetastoreId string `json:"metastore_id,omitempty"`
	// Name of Recipient.
	Name string `json:"name,omitempty"`
	// Username of the recipient owner.
	Owner string `json:"owner,omitempty"`
	// Recipient properties as map of string key-value pairs.
	PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"`
	// Cloud region of the recipient's Unity Catalog Metstore. This field is
	// only present when the __authentication_type__ is **DATABRICKS**.
	Region string `json:"region,omitempty"`
	// The one-time sharing code provided by the data recipient. This field is
	// only present when the __authentication_type__ is **DATABRICKS**.
	SharingCode string `json:"sharing_code,omitempty"`
	// This field is only present when the __authentication_type__ is **TOKEN**.
	Tokens []RecipientTokenInfo `json:"tokens,omitempty"`
	// Time at which the recipient was updated, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Username of recipient updater.
	UpdatedBy string `json:"updated_by,omitempty"`

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

func (RecipientInfo) MarshalJSON added in v0.23.0

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

func (*RecipientInfo) UnmarshalJSON added in v0.23.0

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

type RecipientProfile

type RecipientProfile struct {
	// The token used to authorize the recipient.
	BearerToken string `json:"bearer_token,omitempty"`
	// The endpoint for the share to be used by the recipient.
	Endpoint string `json:"endpoint,omitempty"`
	// The version number of the recipient's credentials on a share.
	ShareCredentialsVersion int `json:"share_credentials_version,omitempty"`

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

func (RecipientProfile) MarshalJSON added in v0.23.0

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

func (*RecipientProfile) UnmarshalJSON added in v0.23.0

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

type RecipientTokenInfo

type RecipientTokenInfo struct {
	// Full activation URL to retrieve the access token. It will be empty if the
	// token is already retrieved.
	ActivationUrl string `json:"activation_url,omitempty"`
	// Time at which this recipient Token was created, in epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Username of recipient token creator.
	CreatedBy string `json:"created_by,omitempty"`
	// Expiration timestamp of the token in epoch milliseconds.
	ExpirationTime int64 `json:"expiration_time,omitempty"`
	// Unique ID of the recipient token.
	Id string `json:"id,omitempty"`
	// Time at which this recipient Token was updated, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Username of recipient Token updater.
	UpdatedBy string `json:"updated_by,omitempty"`

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

func (RecipientTokenInfo) MarshalJSON added in v0.23.0

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

func (*RecipientTokenInfo) UnmarshalJSON added in v0.23.0

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

type RecipientsAPI

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

A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares. The way how sharing works differs depending on whether or not your recipient has access to a Databricks workspace that is enabled for Unity Catalog:

- For recipients with access to a Databricks workspace that is enabled for Unity Catalog, you can create a recipient object along with a unique sharing identifier you get from the recipient. The sharing identifier is the key identifier that enables the secure connection. This sharing mode is called **Databricks-to-Databricks sharing**.

- For recipients without access to a Databricks workspace that is enabled for Unity Catalog, when you create a recipient object, Databricks generates an activation link you can send to the recipient. The recipient follows the activation link to download the credential file, and then uses the credential file to establish a secure connection to receive the shared data. This sharing mode is called **open sharing**.

func NewRecipients

func NewRecipients(client *client.DatabricksClient) *RecipientsAPI

func (*RecipientsAPI) Create

func (a *RecipientsAPI) Create(ctx context.Context, request CreateRecipient) (*RecipientInfo, error)

Create a share recipient.

Creates a new recipient with the delta sharing authentication type in the metastore. The caller must be a metastore admin or has the **CREATE_RECIPIENT** privilege on the metastore.

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.Recipients.Create(ctx, sharing.CreateRecipient{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.Recipients.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*RecipientsAPI) Delete

func (a *RecipientsAPI) Delete(ctx context.Context, request DeleteRecipientRequest) error

Delete a share recipient.

Deletes the specified recipient from the metastore. The caller must be the owner of the recipient.

func (*RecipientsAPI) DeleteByName

func (a *RecipientsAPI) DeleteByName(ctx context.Context, name string) error

Delete a share recipient.

Deletes the specified recipient from the metastore. The caller must be the owner of the recipient.

func (*RecipientsAPI) Get

Get a share recipient.

Gets a share recipient from the metastore if:

* the caller is the owner of the share recipient, or: * is a metastore admin

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.Recipients.Create(ctx, sharing.CreateRecipient{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

_, err = w.Recipients.GetByName(ctx, created.Name)
if err != nil {
	panic(err)
}

// cleanup

err = w.Recipients.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*RecipientsAPI) GetByName

func (a *RecipientsAPI) GetByName(ctx context.Context, name string) (*RecipientInfo, error)

Get a share recipient.

Gets a share recipient from the metastore if:

* the caller is the owner of the share recipient, or: * is a metastore admin

func (*RecipientsAPI) Impl

func (a *RecipientsAPI) Impl() RecipientsService

Impl returns low-level Recipients API implementation Deprecated: use MockRecipientsInterface instead.

func (*RecipientsAPI) List added in v0.24.0

List share recipients.

Gets an array of all share recipients within the current metastore where:

* the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

func (*RecipientsAPI) ListAll

func (a *RecipientsAPI) ListAll(ctx context.Context, request ListRecipientsRequest) ([]RecipientInfo, error)

List share recipients.

Gets an array of all share recipients within the current metastore where:

* the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.Recipients.ListAll(ctx, sharing.ListRecipientsRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*RecipientsAPI) RecipientInfoNameToMetastoreIdMap

func (a *RecipientsAPI) RecipientInfoNameToMetastoreIdMap(ctx context.Context, request ListRecipientsRequest) (map[string]string, error)

RecipientInfoNameToMetastoreIdMap calls RecipientsAPI.ListAll and creates a map of results with RecipientInfo.Name as key and RecipientInfo.MetastoreId as value.

Returns an error if there's more than one RecipientInfo with the same .Name.

Note: All RecipientInfo instances are loaded into memory before creating a map.

This method is generated by Databricks SDK Code Generator.

func (*RecipientsAPI) RotateToken

func (a *RecipientsAPI) RotateToken(ctx context.Context, request RotateRecipientToken) (*RecipientInfo, error)

Rotate a token.

Refreshes the specified recipient's delta sharing authentication token with the provided token info. The caller must be the owner of the recipient.

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.Recipients.Create(ctx, sharing.CreateRecipient{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

recipientInfo, err := w.Recipients.RotateToken(ctx, sharing.RotateRecipientToken{
	Name:                         created.Name,
	ExistingTokenExpireInSeconds: 0,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", recipientInfo)

// cleanup

err = w.Recipients.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*RecipientsAPI) SharePermissions

Get recipient share permissions.

Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the owner of the Recipient.

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.Recipients.Create(ctx, sharing.CreateRecipient{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

sharePermissions, err := w.Recipients.SharePermissionsByName(ctx, created.Name)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", sharePermissions)

// cleanup

err = w.Recipients.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*RecipientsAPI) SharePermissionsByName

func (a *RecipientsAPI) SharePermissionsByName(ctx context.Context, name string) (*GetRecipientSharePermissionsResponse, error)

Get recipient share permissions.

Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the owner of the Recipient.

func (*RecipientsAPI) Update

func (a *RecipientsAPI) Update(ctx context.Context, request UpdateRecipient) error

Update a share recipient.

Updates an existing recipient in the metastore. The caller must be a metastore admin or the owner of the recipient. If the recipient name will be updated, the user must be both a metastore admin and the owner of the recipient.

Example (Recipients)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.Recipients.Create(ctx, sharing.CreateRecipient{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

err = w.Recipients.Update(ctx, sharing.UpdateRecipient{
	Name:    created.Name,
	Comment: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Recipients.DeleteByName(ctx, created.Name)
if err != nil {
	panic(err)
}
Output:

func (*RecipientsAPI) WithImpl

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockRecipientsInterface instead.

type RecipientsInterface added in v0.29.0

type RecipientsInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockRecipientsInterface instead.
	WithImpl(impl RecipientsService) RecipientsInterface

	// Impl returns low-level Recipients API implementation
	// Deprecated: use MockRecipientsInterface instead.
	Impl() RecipientsService

	// Create a share recipient.
	//
	// Creates a new recipient with the delta sharing authentication type in the
	// metastore. The caller must be a metastore admin or has the
	// **CREATE_RECIPIENT** privilege on the metastore.
	Create(ctx context.Context, request CreateRecipient) (*RecipientInfo, error)

	// Delete a share recipient.
	//
	// Deletes the specified recipient from the metastore. The caller must be the
	// owner of the recipient.
	Delete(ctx context.Context, request DeleteRecipientRequest) error

	// Delete a share recipient.
	//
	// Deletes the specified recipient from the metastore. The caller must be the
	// owner of the recipient.
	DeleteByName(ctx context.Context, name string) error

	// Get a share recipient.
	//
	// Gets a share recipient from the metastore if:
	//
	// * the caller is the owner of the share recipient, or: * is a metastore admin
	Get(ctx context.Context, request GetRecipientRequest) (*RecipientInfo, error)

	// Get a share recipient.
	//
	// Gets a share recipient from the metastore if:
	//
	// * the caller is the owner of the share recipient, or: * is a metastore admin
	GetByName(ctx context.Context, name string) (*RecipientInfo, error)

	// List share recipients.
	//
	// Gets an array of all share recipients within the current metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner. There is no
	// guarantee of a specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context, request ListRecipientsRequest) listing.Iterator[RecipientInfo]

	// List share recipients.
	//
	// Gets an array of all share recipients within the current metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner. There is no
	// guarantee of a specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context, request ListRecipientsRequest) ([]RecipientInfo, error)

	// RecipientInfoNameToMetastoreIdMap calls [RecipientsAPI.ListAll] and creates a map of results with [RecipientInfo].Name as key and [RecipientInfo].MetastoreId as value.
	//
	// Returns an error if there's more than one [RecipientInfo] with the same .Name.
	//
	// Note: All [RecipientInfo] instances are loaded into memory before creating a map.
	//
	// This method is generated by Databricks SDK Code Generator.
	RecipientInfoNameToMetastoreIdMap(ctx context.Context, request ListRecipientsRequest) (map[string]string, error)

	// Rotate a token.
	//
	// Refreshes the specified recipient's delta sharing authentication token with
	// the provided token info. The caller must be the owner of the recipient.
	RotateToken(ctx context.Context, request RotateRecipientToken) (*RecipientInfo, error)

	// Get recipient share permissions.
	//
	// Gets the share permissions for the specified Recipient. The caller must be a
	// metastore admin or the owner of the Recipient.
	SharePermissions(ctx context.Context, request SharePermissionsRequest) (*GetRecipientSharePermissionsResponse, error)

	// Get recipient share permissions.
	//
	// Gets the share permissions for the specified Recipient. The caller must be a
	// metastore admin or the owner of the Recipient.
	SharePermissionsByName(ctx context.Context, name string) (*GetRecipientSharePermissionsResponse, error)

	// Update a share recipient.
	//
	// Updates an existing recipient in the metastore. The caller must be a
	// metastore admin or the owner of the recipient. If the recipient name will be
	// updated, the user must be both a metastore admin and the owner of the
	// recipient.
	Update(ctx context.Context, request UpdateRecipient) error
}

type RecipientsService

type RecipientsService interface {

	// Create a share recipient.
	//
	// Creates a new recipient with the delta sharing authentication type in the
	// metastore. The caller must be a metastore admin or has the
	// **CREATE_RECIPIENT** privilege on the metastore.
	Create(ctx context.Context, request CreateRecipient) (*RecipientInfo, error)

	// Delete a share recipient.
	//
	// Deletes the specified recipient from the metastore. The caller must be
	// the owner of the recipient.
	Delete(ctx context.Context, request DeleteRecipientRequest) error

	// Get a share recipient.
	//
	// Gets a share recipient from the metastore if:
	//
	// * the caller is the owner of the share recipient, or: * is a metastore
	// admin
	Get(ctx context.Context, request GetRecipientRequest) (*RecipientInfo, error)

	// List share recipients.
	//
	// Gets an array of all share recipients within the current metastore where:
	//
	// * the caller is a metastore admin, or * the caller is the owner. There is
	// no guarantee of a specific ordering of the elements in the array.
	//
	// Use ListAll() to get all RecipientInfo instances
	List(ctx context.Context, request ListRecipientsRequest) (*ListRecipientsResponse, error)

	// Rotate a token.
	//
	// Refreshes the specified recipient's delta sharing authentication token
	// with the provided token info. The caller must be the owner of the
	// recipient.
	RotateToken(ctx context.Context, request RotateRecipientToken) (*RecipientInfo, error)

	// Get recipient share permissions.
	//
	// Gets the share permissions for the specified Recipient. The caller must
	// be a metastore admin or the owner of the Recipient.
	SharePermissions(ctx context.Context, request SharePermissionsRequest) (*GetRecipientSharePermissionsResponse, error)

	// Update a share recipient.
	//
	// Updates an existing recipient in the metastore. The caller must be a
	// metastore admin or the owner of the recipient. If the recipient name will
	// be updated, the user must be both a metastore admin and the owner of the
	// recipient.
	Update(ctx context.Context, request UpdateRecipient) error
}

A recipient is an object you create using :method:recipients/create to represent an organization which you want to allow access shares. The way how sharing works differs depending on whether or not your recipient has access to a Databricks workspace that is enabled for Unity Catalog:

- For recipients with access to a Databricks workspace that is enabled for Unity Catalog, you can create a recipient object along with a unique sharing identifier you get from the recipient. The sharing identifier is the key identifier that enables the secure connection. This sharing mode is called **Databricks-to-Databricks sharing**.

- For recipients without access to a Databricks workspace that is enabled for Unity Catalog, when you create a recipient object, Databricks generates an activation link you can send to the recipient. The recipient follows the activation link to download the credential file, and then uses the credential file to establish a secure connection to receive the shared data. This sharing mode is called **open sharing**.

type RetrieveTokenRequest

type RetrieveTokenRequest struct {
	// The one time activation url. It also accepts activation token.
	ActivationUrl string `json:"-" url:"-"`
}

Get an access token

type RetrieveTokenResponse

type RetrieveTokenResponse struct {
	// The token used to authorize the recipient.
	BearerToken string `json:"bearerToken,omitempty"`
	// The endpoint for the share to be used by the recipient.
	Endpoint string `json:"endpoint,omitempty"`
	// Expiration timestamp of the token in epoch milliseconds.
	ExpirationTime string `json:"expirationTime,omitempty"`
	// These field names must follow the delta sharing protocol.
	ShareCredentialsVersion int `json:"shareCredentialsVersion,omitempty"`

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

func (RetrieveTokenResponse) MarshalJSON added in v0.23.0

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

func (*RetrieveTokenResponse) UnmarshalJSON added in v0.23.0

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

type RotateRecipientToken

type RotateRecipientToken struct {
	// The expiration time of the bearer token in ISO 8601 format. This will set
	// the expiration_time of existing token only to a smaller timestamp, it
	// cannot extend the expiration_time. Use 0 to expire the existing token
	// immediately, negative number will return an error.
	ExistingTokenExpireInSeconds int64 `json:"existing_token_expire_in_seconds"`
	// The name of the recipient.
	Name string `json:"-" url:"-"`
}

type SecurablePropertiesKvPairs added in v0.9.0

type SecurablePropertiesKvPairs struct {
	// A map of key-value properties attached to the securable.
	Properties map[string]string `json:"properties"`
}

An object with __properties__ containing map of key-value properties attached to the securable.

type SecurablePropertiesMap added in v0.9.0

type SecurablePropertiesMap map[string]string

A map of key-value properties attached to the securable.

type ShareInfo

type ShareInfo struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// Time at which this share was created, in epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Username of share creator.
	CreatedBy string `json:"created_by,omitempty"`
	// Name of the share.
	Name string `json:"name,omitempty"`
	// A list of shared data objects within the share.
	Objects []SharedDataObject `json:"objects,omitempty"`
	// Username of current owner of share.
	Owner string `json:"owner,omitempty"`
	// Storage Location URL (full path) for the share.
	StorageLocation string `json:"storage_location,omitempty"`
	// Storage root URL for the share.
	StorageRoot string `json:"storage_root,omitempty"`
	// Time at which this share was updated, in epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Username of share updater.
	UpdatedBy string `json:"updated_by,omitempty"`

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

func (ShareInfo) MarshalJSON added in v0.23.0

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

func (*ShareInfo) UnmarshalJSON added in v0.23.0

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

type SharePermissionsRequest

type SharePermissionsRequest struct {
	// The name of the Recipient.
	Name string `json:"-" url:"-"`
}

Get recipient share permissions

type ShareToPrivilegeAssignment

type ShareToPrivilegeAssignment struct {
	// The privileges assigned to the principal.
	PrivilegeAssignments []PrivilegeAssignment `json:"privilege_assignments,omitempty"`
	// The share name.
	ShareName string `json:"share_name,omitempty"`

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

func (ShareToPrivilegeAssignment) MarshalJSON added in v0.23.0

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

func (*ShareToPrivilegeAssignment) UnmarshalJSON added in v0.23.0

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

type SharedDataObject

type SharedDataObject struct {
	// The time when this data object is added to the share, in epoch
	// milliseconds.
	AddedAt int64 `json:"added_at,omitempty"`
	// Username of the sharer.
	AddedBy string `json:"added_by,omitempty"`
	// Whether to enable cdf or indicate if cdf is enabled on the shared object.
	CdfEnabled bool `json:"cdf_enabled,omitempty"`
	// A user-provided comment when adding the data object to the share.
	// [Update:OPT]
	Comment string `json:"comment,omitempty"`
	// The content of the notebook file when the data object type is
	// NOTEBOOK_FILE. This should be base64 encoded. Required for adding a
	// NOTEBOOK_FILE, optional for updating, ignored for other types.
	Content string `json:"content,omitempty"`
	// The type of the data object.
	DataObjectType SharedDataObjectDataObjectType `json:"data_object_type,omitempty"`
	// Whether to enable or disable sharing of data history. If not specified,
	// the default is **DISABLED**.
	HistoryDataSharingStatus SharedDataObjectHistoryDataSharingStatus `json:"history_data_sharing_status,omitempty"`
	// A fully qualified name that uniquely identifies a data object.
	//
	// For example, a table's fully qualified name is in the format of
	// `<catalog>.<schema>.<table>`.
	Name string `json:"name"`
	// Array of partitions for the shared data.
	Partitions []Partition `json:"partitions,omitempty"`
	// A user-provided new name for the data object within the share. If this
	// new name is not provided, the object's original name will be used as the
	// `shared_as` name. The `shared_as` name must be unique within a share. For
	// tables, the new name must follow the format of `<schema>.<table>`.
	SharedAs string `json:"shared_as,omitempty"`
	// The start version associated with the object. This allows data providers
	// to control the lowest object version that is accessible by clients. If
	// specified, clients can query snapshots or changes for versions >=
	// start_version. If not specified, clients can only query starting from the
	// version of the object at the time it was added to the share.
	//
	// NOTE: The start_version should be <= the `current` version of the object.
	StartVersion int64 `json:"start_version,omitempty"`
	// One of: **ACTIVE**, **PERMISSION_DENIED**.
	Status SharedDataObjectStatus `json:"status,omitempty"`
	// A user-provided new name for the data object within the share. If this
	// new name is not provided, the object's original name will be used as the
	// `string_shared_as` name. The `string_shared_as` name must be unique
	// within a share. For notebooks, the new name should be the new notebook
	// file name.
	StringSharedAs string `json:"string_shared_as,omitempty"`

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

func (SharedDataObject) MarshalJSON added in v0.23.0

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

func (*SharedDataObject) UnmarshalJSON added in v0.23.0

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

type SharedDataObjectDataObjectType added in v0.36.0

type SharedDataObjectDataObjectType string

The type of the data object.

const SharedDataObjectDataObjectTypeMaterializedView SharedDataObjectDataObjectType = `MATERIALIZED_VIEW`
const SharedDataObjectDataObjectTypeModel SharedDataObjectDataObjectType = `MODEL`
const SharedDataObjectDataObjectTypeNotebookFile SharedDataObjectDataObjectType = `NOTEBOOK_FILE`
const SharedDataObjectDataObjectTypeSchema SharedDataObjectDataObjectType = `SCHEMA`
const SharedDataObjectDataObjectTypeStreamingTable SharedDataObjectDataObjectType = `STREAMING_TABLE`
const SharedDataObjectDataObjectTypeTable SharedDataObjectDataObjectType = `TABLE`
const SharedDataObjectDataObjectTypeView SharedDataObjectDataObjectType = `VIEW`

func (*SharedDataObjectDataObjectType) Set added in v0.36.0

Set raw string value and validate it against allowed values

func (*SharedDataObjectDataObjectType) String added in v0.36.0

String representation for fmt.Print

func (*SharedDataObjectDataObjectType) Type added in v0.36.0

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

type SharedDataObjectHistoryDataSharingStatus added in v0.12.0

type SharedDataObjectHistoryDataSharingStatus string

Whether to enable or disable sharing of data history. If not specified, the default is **DISABLED**.

const SharedDataObjectHistoryDataSharingStatusDisabled SharedDataObjectHistoryDataSharingStatus = `DISABLED`
const SharedDataObjectHistoryDataSharingStatusEnabled SharedDataObjectHistoryDataSharingStatus = `ENABLED`

func (*SharedDataObjectHistoryDataSharingStatus) Set added in v0.12.0

Set raw string value and validate it against allowed values

func (*SharedDataObjectHistoryDataSharingStatus) String added in v0.12.0

String representation for fmt.Print

func (*SharedDataObjectHistoryDataSharingStatus) Type added in v0.12.0

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

type SharedDataObjectStatus

type SharedDataObjectStatus string

One of: **ACTIVE**, **PERMISSION_DENIED**.

const SharedDataObjectStatusActive SharedDataObjectStatus = `ACTIVE`
const SharedDataObjectStatusPermissionDenied SharedDataObjectStatus = `PERMISSION_DENIED`

func (*SharedDataObjectStatus) Set

Set raw string value and validate it against allowed values

func (*SharedDataObjectStatus) String

func (f *SharedDataObjectStatus) String() string

String representation for fmt.Print

func (*SharedDataObjectStatus) Type

func (f *SharedDataObjectStatus) Type() string

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

type SharedDataObjectUpdate

type SharedDataObjectUpdate struct {
	// One of: **ADD**, **REMOVE**, **UPDATE**.
	Action SharedDataObjectUpdateAction `json:"action,omitempty"`
	// The data object that is being added, removed, or updated.
	DataObject *SharedDataObject `json:"data_object,omitempty"`
}

type SharedDataObjectUpdateAction

type SharedDataObjectUpdateAction string

One of: **ADD**, **REMOVE**, **UPDATE**.

const SharedDataObjectUpdateActionAdd SharedDataObjectUpdateAction = `ADD`
const SharedDataObjectUpdateActionRemove SharedDataObjectUpdateAction = `REMOVE`
const SharedDataObjectUpdateActionUpdate SharedDataObjectUpdateAction = `UPDATE`

func (*SharedDataObjectUpdateAction) Set

Set raw string value and validate it against allowed values

func (*SharedDataObjectUpdateAction) String

String representation for fmt.Print

func (*SharedDataObjectUpdateAction) Type

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

type SharesAPI

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

A share is a container instantiated with :method:shares/create. Once created you can iteratively register a collection of existing data assets defined within the metastore using :method:shares/update. You can register data assets under their original name, qualified by their original schema, or provide alternate exposed names.

func NewShares

func NewShares(client *client.DatabricksClient) *SharesAPI

func (*SharesAPI) Create

func (a *SharesAPI) Create(ctx context.Context, request CreateShare) (*ShareInfo, error)

Create a share.

Creates a new share for data objects. Data objects can be added after creation with **update**. The caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.

Example (Shares)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

createdShare, err := w.Shares.Create(ctx, sharing.CreateShare{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", createdShare)

// cleanup

err = w.Shares.DeleteByName(ctx, createdShare.Name)
if err != nil {
	panic(err)
}
Output:

func (*SharesAPI) Delete

func (a *SharesAPI) Delete(ctx context.Context, request DeleteShareRequest) error

Delete a share.

Deletes a data object share from the metastore. The caller must be an owner of the share.

func (*SharesAPI) DeleteByName

func (a *SharesAPI) DeleteByName(ctx context.Context, name string) error

Delete a share.

Deletes a data object share from the metastore. The caller must be an owner of the share.

func (*SharesAPI) Get

func (a *SharesAPI) Get(ctx context.Context, request GetShareRequest) (*ShareInfo, error)

Get a share.

Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.

Example (Shares)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

createdShare, err := w.Shares.Create(ctx, sharing.CreateShare{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", createdShare)

_, err = w.Shares.GetByName(ctx, createdShare.Name)
if err != nil {
	panic(err)
}

// cleanup

err = w.Shares.DeleteByName(ctx, createdShare.Name)
if err != nil {
	panic(err)
}
Output:

func (*SharesAPI) GetByName

func (a *SharesAPI) GetByName(ctx context.Context, name string) (*ShareInfo, error)

Get a share.

Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the share.

func (*SharesAPI) Impl

func (a *SharesAPI) Impl() SharesService

Impl returns low-level Shares API implementation Deprecated: use MockSharesInterface instead.

func (*SharesAPI) List added in v0.24.0

List shares.

Gets an array of data object shares from the metastore. The caller must be a metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

func (*SharesAPI) ListAll

func (a *SharesAPI) ListAll(ctx context.Context) ([]ShareInfo, error)

List shares.

Gets an array of data object shares from the metastore. The caller must be a metastore admin or the owner of the share. There is no guarantee of a specific ordering of the elements in the array.

This method is generated by Databricks SDK Code Generator.

Example (Shares)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.Shares.ListAll(ctx)
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*SharesAPI) SharePermissions

func (a *SharesAPI) SharePermissions(ctx context.Context, request SharePermissionsRequest) (*catalog.PermissionsList, error)

Get permissions.

Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the owner of the share.

func (*SharesAPI) SharePermissionsByName

func (a *SharesAPI) SharePermissionsByName(ctx context.Context, name string) (*catalog.PermissionsList, error)

Get permissions.

Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the owner of the share.

func (*SharesAPI) Update

func (a *SharesAPI) Update(ctx context.Context, request UpdateShare) (*ShareInfo, error)

Update a share.

Updates the share with the changes and data objects in the request. The caller must be the owner of the share or a metastore admin.

When the caller is a metastore admin, only the __owner__ field can be updated.

In the case that the share name is changed, **updateShare** requires that the caller is both the share owner and a metastore admin.

If there are notebook files in the share, the __storage_root__ field cannot be updated.

For each table that is added through this method, the share owner must also have **SELECT** privilege on the table. This privilege must be maintained indefinitely for recipients to be able to access the table. Typically, you should use a group as the share owner.

Table removals through **update** do not require additional privileges.

Example (Shares)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

tableName := fmt.Sprintf("sdk-%x", time.Now().UnixNano())

createdCatalog, err := w.Catalogs.Create(ctx, catalog.CreateCatalog{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", createdCatalog)

createdSchema, err := w.Schemas.Create(ctx, catalog.CreateSchema{
	Name:        fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	CatalogName: createdCatalog.Name,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", createdSchema)

_, err = w.StatementExecution.ExecuteAndWait(ctx, sql.ExecuteStatementRequest{
	WarehouseId: os.Getenv("TEST_DEFAULT_WAREHOUSE_ID"),
	Catalog:     createdCatalog.Name,
	Schema:      createdSchema.Name,
	Statement:   fmt.Sprintf("CREATE TABLE %s TBLPROPERTIES (delta.enableDeletionVectors=false) AS SELECT 2+2 as four", tableName),
})
if err != nil {
	panic(err)
}

tableFullName := fmt.Sprintf("%s.%s.%s", createdCatalog.Name, createdSchema.Name, tableName)

createdShare, err := w.Shares.Create(ctx, sharing.CreateShare{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", createdShare)

_, err = w.Shares.Update(ctx, sharing.UpdateShare{
	Name: createdShare.Name,
	Updates: []sharing.SharedDataObjectUpdate{sharing.SharedDataObjectUpdate{
		Action: sharing.SharedDataObjectUpdateActionAdd,
		DataObject: &sharing.SharedDataObject{
			Name:           tableFullName,
			DataObjectType: "TABLE",
		},
	}},
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Schemas.DeleteByFullName(ctx, createdSchema.FullName)
if err != nil {
	panic(err)
}
err = w.Catalogs.Delete(ctx, catalog.DeleteCatalogRequest{
	Name:  createdCatalog.Name,
	Force: true,
})
if err != nil {
	panic(err)
}
err = w.Tables.DeleteByFullName(ctx, tableFullName)
if err != nil {
	panic(err)
}
err = w.Shares.DeleteByName(ctx, createdShare.Name)
if err != nil {
	panic(err)
}
Output:

func (*SharesAPI) UpdatePermissions

func (a *SharesAPI) UpdatePermissions(ctx context.Context, request UpdateSharePermissions) error

Update permissions.

Updates the permissions for a data share in the metastore. The caller must be a metastore admin or an owner of the share.

For new recipient grants, the user must also be the owner of the recipients. recipient revocations do not require additional privileges.

func (*SharesAPI) WithImpl

func (a *SharesAPI) WithImpl(impl SharesService) SharesInterface

WithImpl could be used to override low-level API implementations for unit testing purposes with github.com/golang/mock or other mocking frameworks. Deprecated: use MockSharesInterface instead.

type SharesInterface added in v0.29.0

type SharesInterface interface {
	// WithImpl could be used to override low-level API implementations for unit
	// testing purposes with [github.com/golang/mock] or other mocking frameworks.
	// Deprecated: use MockSharesInterface instead.
	WithImpl(impl SharesService) SharesInterface

	// Impl returns low-level Shares API implementation
	// Deprecated: use MockSharesInterface instead.
	Impl() SharesService

	// Create a share.
	//
	// Creates a new share for data objects. Data objects can be added after
	// creation with **update**. The caller must be a metastore admin or have the
	// **CREATE_SHARE** privilege on the metastore.
	Create(ctx context.Context, request CreateShare) (*ShareInfo, error)

	// Delete a share.
	//
	// Deletes a data object share from the metastore. The caller must be an owner
	// of the share.
	Delete(ctx context.Context, request DeleteShareRequest) error

	// Delete a share.
	//
	// Deletes a data object share from the metastore. The caller must be an owner
	// of the share.
	DeleteByName(ctx context.Context, name string) error

	// Get a share.
	//
	// Gets a data object share from the metastore. The caller must be a metastore
	// admin or the owner of the share.
	Get(ctx context.Context, request GetShareRequest) (*ShareInfo, error)

	// Get a share.
	//
	// Gets a data object share from the metastore. The caller must be a metastore
	// admin or the owner of the share.
	GetByName(ctx context.Context, name string) (*ShareInfo, error)

	// List shares.
	//
	// Gets an array of data object shares from the metastore. The caller must be a
	// metastore admin or the owner of the share. There is no guarantee of a
	// specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	List(ctx context.Context) listing.Iterator[ShareInfo]

	// List shares.
	//
	// Gets an array of data object shares from the metastore. The caller must be a
	// metastore admin or the owner of the share. There is no guarantee of a
	// specific ordering of the elements in the array.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListAll(ctx context.Context) ([]ShareInfo, error)

	// Get permissions.
	//
	// Gets the permissions for a data share from the metastore. The caller must be
	// a metastore admin or the owner of the share.
	SharePermissions(ctx context.Context, request SharePermissionsRequest) (*catalog.PermissionsList, error)

	// Get permissions.
	//
	// Gets the permissions for a data share from the metastore. The caller must be
	// a metastore admin or the owner of the share.
	SharePermissionsByName(ctx context.Context, name string) (*catalog.PermissionsList, error)

	// Update a share.
	//
	// Updates the share with the changes and data objects in the request. The
	// caller must be the owner of the share or a metastore admin.
	//
	// When the caller is a metastore admin, only the __owner__ field can be
	// updated.
	//
	// In the case that the share name is changed, **updateShare** requires that the
	// caller is both the share owner and a metastore admin.
	//
	// If there are notebook files in the share, the __storage_root__ field cannot
	// be updated.
	//
	// For each table that is added through this method, the share owner must also
	// have **SELECT** privilege on the table. This privilege must be maintained
	// indefinitely for recipients to be able to access the table. Typically, you
	// should use a group as the share owner.
	//
	// Table removals through **update** do not require additional privileges.
	Update(ctx context.Context, request UpdateShare) (*ShareInfo, error)

	// Update permissions.
	//
	// Updates the permissions for a data share in the metastore. The caller must be
	// a metastore admin or an owner of the share.
	//
	// For new recipient grants, the user must also be the owner of the recipients.
	// recipient revocations do not require additional privileges.
	UpdatePermissions(ctx context.Context, request UpdateSharePermissions) error
}

type SharesService

type SharesService interface {

	// Create a share.
	//
	// Creates a new share for data objects. Data objects can be added after
	// creation with **update**. The caller must be a metastore admin or have
	// the **CREATE_SHARE** privilege on the metastore.
	Create(ctx context.Context, request CreateShare) (*ShareInfo, error)

	// Delete a share.
	//
	// Deletes a data object share from the metastore. The caller must be an
	// owner of the share.
	Delete(ctx context.Context, request DeleteShareRequest) error

	// Get a share.
	//
	// Gets a data object share from the metastore. The caller must be a
	// metastore admin or the owner of the share.
	Get(ctx context.Context, request GetShareRequest) (*ShareInfo, error)

	// List shares.
	//
	// Gets an array of data object shares from the metastore. The caller must
	// be a metastore admin or the owner of the share. There is no guarantee of
	// a specific ordering of the elements in the array.
	//
	// Use ListAll() to get all ShareInfo instances
	List(ctx context.Context) (*ListSharesResponse, error)

	// Get permissions.
	//
	// Gets the permissions for a data share from the metastore. The caller must
	// be a metastore admin or the owner of the share.
	SharePermissions(ctx context.Context, request SharePermissionsRequest) (*catalog.PermissionsList, error)

	// Update a share.
	//
	// Updates the share with the changes and data objects in the request. The
	// caller must be the owner of the share or a metastore admin.
	//
	// When the caller is a metastore admin, only the __owner__ field can be
	// updated.
	//
	// In the case that the share name is changed, **updateShare** requires that
	// the caller is both the share owner and a metastore admin.
	//
	// If there are notebook files in the share, the __storage_root__ field
	// cannot be updated.
	//
	// For each table that is added through this method, the share owner must
	// also have **SELECT** privilege on the table. This privilege must be
	// maintained indefinitely for recipients to be able to access the table.
	// Typically, you should use a group as the share owner.
	//
	// Table removals through **update** do not require additional privileges.
	Update(ctx context.Context, request UpdateShare) (*ShareInfo, error)

	// Update permissions.
	//
	// Updates the permissions for a data share in the metastore. The caller
	// must be a metastore admin or an owner of the share.
	//
	// For new recipient grants, the user must also be the owner of the
	// recipients. recipient revocations do not require additional privileges.
	UpdatePermissions(ctx context.Context, request UpdateSharePermissions) error
}

A share is a container instantiated with :method:shares/create. Once created you can iteratively register a collection of existing data assets defined within the metastore using :method:shares/update. You can register data assets under their original name, qualified by their original schema, or provide alternate exposed names.

type UpdateCleanRoom added in v0.13.0

type UpdateCleanRoom struct {
	// Array of shared data object updates.
	CatalogUpdates []CleanRoomCatalogUpdate `json:"catalog_updates,omitempty"`
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// The name of the clean room.
	Name string `json:"-" url:"-"`
	// Username of current owner of clean room.
	Owner string `json:"owner,omitempty"`

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

func (UpdateCleanRoom) MarshalJSON added in v0.23.0

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

func (*UpdateCleanRoom) UnmarshalJSON added in v0.23.0

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

type UpdatePermissionsResponse added in v0.34.0

type UpdatePermissionsResponse struct {
}

type UpdateProvider

type UpdateProvider struct {
	// Description about the provider.
	Comment string `json:"comment,omitempty"`
	// Name of the provider.
	Name string `json:"-" url:"-"`
	// New name for the provider.
	NewName string `json:"new_name,omitempty"`
	// Username of Provider owner.
	Owner string `json:"owner,omitempty"`
	// This field is required when the __authentication_type__ is **TOKEN** or
	// not provided.
	RecipientProfileStr string `json:"recipient_profile_str,omitempty"`

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

func (UpdateProvider) MarshalJSON added in v0.23.0

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

func (*UpdateProvider) UnmarshalJSON added in v0.23.0

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

type UpdateRecipient

type UpdateRecipient struct {
	// Description about the recipient.
	Comment string `json:"comment,omitempty"`
	// IP Access List
	IpAccessList *IpAccessList `json:"ip_access_list,omitempty"`
	// Name of the recipient.
	Name string `json:"-" url:"-"`
	// New name for the recipient.
	NewName string `json:"new_name,omitempty"`
	// Username of the recipient owner.
	Owner string `json:"owner,omitempty"`
	// Recipient properties as map of string key-value pairs. When provided in
	// update request, the specified properties will override the existing
	// properties. To add and remove properties, one would need to perform a
	// read-modify-write.
	PropertiesKvpairs *SecurablePropertiesKvPairs `json:"properties_kvpairs,omitempty"`

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

func (UpdateRecipient) MarshalJSON added in v0.23.0

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

func (*UpdateRecipient) UnmarshalJSON added in v0.23.0

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

type UpdateResponse added in v0.34.0

type UpdateResponse struct {
}

type UpdateShare

type UpdateShare struct {
	// User-provided free-form text description.
	Comment string `json:"comment,omitempty"`
	// The name of the share.
	Name string `json:"-" url:"-"`
	// New name for the share.
	NewName string `json:"new_name,omitempty"`
	// Username of current owner of share.
	Owner string `json:"owner,omitempty"`
	// Storage root URL for the share.
	StorageRoot string `json:"storage_root,omitempty"`
	// Array of shared data object updates.
	Updates []SharedDataObjectUpdate `json:"updates,omitempty"`

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

func (UpdateShare) MarshalJSON added in v0.23.0

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

func (*UpdateShare) UnmarshalJSON added in v0.23.0

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

type UpdateSharePermissions

type UpdateSharePermissions struct {
	// Array of permission changes.
	Changes []catalog.PermissionsChange `json:"changes,omitempty"`
	// The name of the share.
	Name string `json:"-" url:"-"`
}

Jump to

Keyboard shortcuts

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