notebook

package
v0.1.0-beta.11 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

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

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(credential azcore.TokenCredential, endpoint *string, options *azcore.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • endpoint - pass nil to accept the default values.
  • options - pass nil to accept the default values.

func NewClientFactoryWithClient

func NewClientFactoryWithClient(client fabric.Client) *ClientFactory

NewClientFactoryWithClient creates a new instance of ClientFactory with sharable Client. The Client will be propagated to any client created from this factory.

  • client - Client created in the containing module: github.com/microsoft/fabric-sdk-go/fabric

func (*ClientFactory) NewItemsClient

func (c *ClientFactory) NewItemsClient() *ItemsClient

NewItemsClient creates a new instance of ItemsClient.

type CreateNotebookRequest

type CreateNotebookRequest struct {
	// REQUIRED; The notebook display name. The display name must follow naming rules according to item type.
	DisplayName *string

	// The notebook public definition.
	Definition *Definition

	// The notebook description. Maximum length is 256 characters.
	Description *string
}

CreateNotebookRequest - Create notebook request payload.

func (CreateNotebookRequest) MarshalJSON

func (c CreateNotebookRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreateNotebookRequest.

func (*CreateNotebookRequest) UnmarshalJSON

func (c *CreateNotebookRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CreateNotebookRequest.

type Definition

type Definition struct {
	// REQUIRED; A list of definition parts.
	Parts []DefinitionPart

	// The format of the Notebook definition. Supported format: ipynb.
	Format *string
}

Definition - Notebook public definition object. Refer to this article [/rest/api/fabric/articles/item-management/definitions/notebook-definition] for more details on how to craft a notebook public definition.

func (Definition) MarshalJSON

func (d Definition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Definition.

func (*Definition) UnmarshalJSON

func (d *Definition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Definition.

type DefinitionPart

type DefinitionPart struct {
	// The notebook part path.
	Path *string

	// The notebook part payload.
	Payload *string

	// The payload type.
	PayloadType *PayloadType
}

DefinitionPart - Notebook definition part object.

func (DefinitionPart) MarshalJSON

func (d DefinitionPart) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DefinitionPart.

func (*DefinitionPart) UnmarshalJSON

func (d *DefinitionPart) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DefinitionPart.

type DefinitionResponse

type DefinitionResponse struct {
	// READ-ONLY; Notebook public definition object. Refer to this article [/rest/api/fabric/articles/item-management/definitions/notebook-definition]
	// for more details on how to craft a notebook public definition.
	Definition *Definition
}

DefinitionResponse - Notebook public definition response.

func (DefinitionResponse) MarshalJSON

func (d DefinitionResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DefinitionResponse.

func (*DefinitionResponse) UnmarshalJSON

func (d *DefinitionResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DefinitionResponse.

type ItemType

type ItemType string

ItemType - The type of the item. Additional item types may be added over time.

const (
	// ItemTypeDashboard - PowerBI dashboard.
	ItemTypeDashboard ItemType = "Dashboard"
	// ItemTypeDataPipeline - A data pipeline.
	ItemTypeDataPipeline ItemType = "DataPipeline"
	// ItemTypeDatamart - PowerBI datamart.
	ItemTypeDatamart ItemType = "Datamart"
	// ItemTypeEnvironment - An environment.
	ItemTypeEnvironment ItemType = "Environment"
	// ItemTypeEventhouse - An eventhouse.
	ItemTypeEventhouse ItemType = "Eventhouse"
	// ItemTypeEventstream - An eventstream.
	ItemTypeEventstream ItemType = "Eventstream"
	// ItemTypeGraphQLAPI - An API for GraphQL item.
	ItemTypeGraphQLAPI ItemType = "GraphQLApi"
	// ItemTypeKQLDashboard - A KQL dashboard.
	ItemTypeKQLDashboard ItemType = "KQLDashboard"
	// ItemTypeKQLDatabase - A KQL database.
	ItemTypeKQLDatabase ItemType = "KQLDatabase"
	// ItemTypeKQLQueryset - A KQL queryset.
	ItemTypeKQLQueryset ItemType = "KQLQueryset"
	// ItemTypeLakehouse - A lakehouse.
	ItemTypeLakehouse ItemType = "Lakehouse"
	// ItemTypeMLExperiment - A machine learning experiment.
	ItemTypeMLExperiment ItemType = "MLExperiment"
	// ItemTypeMLModel - A machine learning model.
	ItemTypeMLModel ItemType = "MLModel"
	// ItemTypeMirroredDatabase - A mirrored database.
	ItemTypeMirroredDatabase ItemType = "MirroredDatabase"
	// ItemTypeMirroredWarehouse - A mirrored warehouse.
	ItemTypeMirroredWarehouse ItemType = "MirroredWarehouse"
	// ItemTypeNotebook - A notebook.
	ItemTypeNotebook ItemType = "Notebook"
	// ItemTypePaginatedReport - PowerBI paginated report.
	ItemTypePaginatedReport ItemType = "PaginatedReport"
	// ItemTypeReflex - A Reflex.
	ItemTypeReflex ItemType = "Reflex"
	// ItemTypeReport - PowerBI report.
	ItemTypeReport ItemType = "Report"
	// ItemTypeSQLEndpoint - An SQL endpoint.
	ItemTypeSQLEndpoint ItemType = "SQLEndpoint"
	// ItemTypeSemanticModel - PowerBI semantic model.
	ItemTypeSemanticModel ItemType = "SemanticModel"
	// ItemTypeSparkJobDefinition - A spark job definition.
	ItemTypeSparkJobDefinition ItemType = "SparkJobDefinition"
	// ItemTypeWarehouse - A warehouse.
	ItemTypeWarehouse ItemType = "Warehouse"
)

func PossibleItemTypeValues

func PossibleItemTypeValues() []ItemType

PossibleItemTypeValues returns the possible values for the ItemType const type.

type ItemsClient

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

ItemsClient contains the methods for the Items group. Don't use this type directly, use a constructor function instead.

func (*ItemsClient) BeginCreateNotebook

func (client *ItemsClient) BeginCreateNotebook(ctx context.Context, workspaceID string, createNotebookRequest CreateNotebookRequest, options *ItemsClientBeginCreateNotebookOptions) (*runtime.Poller[ItemsClientCreateNotebookResponse], error)

BeginCreateNotebook - This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation]. To create notebook with definition, refer to Notebook definition [/rest/api/fabric/articles/item-management/definitions/notebook-definition] article. PERMISSIONS THE CALLER MUST HAVE CONTRIBUTOR OR HIGHER WORKSPACE ROLE. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All LIMITATIONS * To create a notebook the workspace must be on a supported Fabric capacity. For more information see: Microsoft Fabric license types [/fabric/enterprise/licenses#microsoft-fabric-license-types]. MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • createNotebookRequest - Create item request payload.
  • options - ItemsClientBeginCreateNotebookOptions contains the optional parameters for the ItemsClient.BeginCreateNotebook method.
Example (CreateANotebookExample)

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewItemsClient().BeginCreateNotebook(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", notebook.CreateNotebookRequest{
		Description: to.Ptr("A notebook description."),
		DisplayName: to.Ptr("Notebook 1"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

Example (CreateANotebookWithPublicDefinitionExample)

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewItemsClient().BeginCreateNotebook(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", notebook.CreateNotebookRequest{
		Description: to.Ptr("A notebook description"),
		Definition: &notebook.Definition{
			Format: to.Ptr("ipynb"),
			Parts: []notebook.DefinitionPart{
				{
					Path:        to.Ptr("notebook-content.py"),
					Payload:     to.Ptr("eyJuYmZvcm1hdCI6N..5ndWUiOiJweXRob24ifX19"),
					PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
				},
				{
					Path:        to.Ptr(".platform"),
					Payload:     to.Ptr("ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc="),
					PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
				}},
		},
		DisplayName: to.Ptr("Notebook 1"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ItemsClient) BeginGetNotebookDefinition

func (client *ItemsClient) BeginGetNotebookDefinition(ctx context.Context, workspaceID string, notebookID string, options *ItemsClientBeginGetNotebookDefinitionOptions) (*runtime.Poller[ItemsClientGetNotebookDefinitionResponse], error)

BeginGetNotebookDefinition - This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation]. When you get a notebook's public definition, the sensitivity label is not a part of the definition. PERMISSIONS The caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All LIMITATIONS This API is blocked for a notebook with an encrypted sensitivity label. MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • options - ItemsClientBeginGetNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginGetNotebookDefinition method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewItemsClient().BeginGetNotebookDefinition(ctx, "6e335e92-a2a2-4b5a-970a-bd6a89fbb765", "cfafbeb1-8037-4d0c-896e-a46fb27ff229", &notebook.ItemsClientBeginGetNotebookDefinitionOptions{Format: nil})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.DefinitionResponse = notebook.DefinitionResponse{
	// 	Definition: &notebook.Definition{
	// 		Parts: []notebook.DefinitionPart{
	// 			{
	// 				Path: to.Ptr("notebook-content.py"),
	// 				Payload: to.Ptr("IyBGYWJyaWMgbm90ZWJv..5ndWUiOiJweXRob24ifX19"),
	// 				PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
	// 			},
	// 			{
	// 				Path: to.Ptr(".platform"),
	// 				Payload: to.Ptr("ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc="),
	// 				PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
	// 		}},
	// 	},
	// }
}
Output:

func (*ItemsClient) BeginUpdateNotebookDefinition

func (client *ItemsClient) BeginUpdateNotebookDefinition(ctx context.Context, workspaceID string, notebookID string, updateNotebookDefinitionRequest UpdateNotebookDefinitionRequest, options *ItemsClientBeginUpdateNotebookDefinitionOptions) (*runtime.Poller[ItemsClientUpdateNotebookDefinitionResponse], error)

BeginUpdateNotebookDefinition - This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation]. Updating the notebook's definition, does not affect its sensitivity label. PERMISSIONS The API caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • updateNotebookDefinitionRequest - Update notebook definition request payload.
  • options - ItemsClientBeginUpdateNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginUpdateNotebookDefinition method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewItemsClient().BeginUpdateNotebookDefinition(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", notebook.UpdateNotebookDefinitionRequest{
		Definition: &notebook.Definition{
			Parts: []notebook.DefinitionPart{
				{
					Path:        to.Ptr("notebook-content.py"),
					Payload:     to.Ptr("IyBGYWJyaWMgbm90ZWJv..."),
					PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
				},
				{
					Path:        to.Ptr(".platform"),
					Payload:     to.Ptr("ZG90UGxhdGZvcm1CYXNlNjRTdHJpbmc="),
					PayloadType: to.Ptr(notebook.PayloadTypeInlineBase64),
				}},
		},
	}, &notebook.ItemsClientBeginUpdateNotebookDefinitionOptions{UpdateMetadata: to.Ptr(true)})
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ItemsClient) CreateNotebook

func (client *ItemsClient) CreateNotebook(ctx context.Context, workspaceID string, createNotebookRequest CreateNotebookRequest, options *ItemsClientBeginCreateNotebookOptions) (ItemsClientCreateNotebookResponse, error)

CreateNotebook - returns ItemsClientCreateNotebookResponse in sync mode. This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation].

To create notebook with definition, refer to Notebook definition [/rest/api/fabric/articles/item-management/definitions/notebook-definition] article.

PERMISSIONS THE CALLER MUST HAVE CONTRIBUTOR OR HIGHER WORKSPACE ROLE. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All

LIMITATIONS

  • To create a notebook the workspace must be on a supported Fabric capacity. For more information see: Microsoft Fabric license types [/fabric/enterprise/licenses#microsoft-fabric-license-types].

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • createNotebookRequest - Create item request payload.
  • options - ItemsClientBeginCreateNotebookOptions contains the optional parameters for the ItemsClient.BeginCreateNotebook method.

func (*ItemsClient) DeleteNotebook

func (client *ItemsClient) DeleteNotebook(ctx context.Context, workspaceID string, notebookID string, options *ItemsClientDeleteNotebookOptions) (ItemsClientDeleteNotebookResponse, error)

DeleteNotebook - PERMISSIONS The caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • options - ItemsClientDeleteNotebookOptions contains the optional parameters for the ItemsClient.DeleteNotebook method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewItemsClient().DeleteNotebook(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*ItemsClient) GetNotebook

func (client *ItemsClient) GetNotebook(ctx context.Context, workspaceID string, notebookID string, options *ItemsClientGetNotebookOptions) (ItemsClientGetNotebookResponse, error)

GetNotebook - PERMISSIONS The caller must have viewer or higher workspace role. REQUIRED DELEGATED SCOPES Notebook.Read.All or Notebook.ReadWrite.All or Item.Read.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • options - ItemsClientGetNotebookOptions contains the optional parameters for the ItemsClient.GetNotebook method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewItemsClient().GetNotebook(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Notebook = notebook.Notebook{
	// 	Type: to.Ptr(notebook.ItemTypeNotebook),
	// 	Description: to.Ptr("A notebook description."),
	// 	DisplayName: to.Ptr("Notebook 1"),
	// 	ID: to.Ptr("5b218778-e7a5-4d73-8187-f10824047715"),
	// 	WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
	// }
}
Output:

func (*ItemsClient) GetNotebookDefinition

func (client *ItemsClient) GetNotebookDefinition(ctx context.Context, workspaceID string, notebookID string, options *ItemsClientBeginGetNotebookDefinitionOptions) (ItemsClientGetNotebookDefinitionResponse, error)

GetNotebookDefinition - returns ItemsClientGetNotebookDefinitionResponse in sync mode. This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation].

When you get a notebook's public definition, the sensitivity label is not a part of the definition.

PERMISSIONS The caller must have contributor or higher workspace role.

REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All

LIMITATIONS This API is blocked for a notebook with an encrypted sensitivity label.

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • options - ItemsClientBeginGetNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginGetNotebookDefinition method.

func (*ItemsClient) ListNotebooks

func (client *ItemsClient) ListNotebooks(ctx context.Context, workspaceID string, options *ItemsClientListNotebooksOptions) ([]Notebook, error)

ListNotebooks - returns array of Notebook from all pages. This API supports pagination [/rest/api/fabric/articles/pagination].

PERMISSIONS The caller must have viewer or higher workspace role.

REQUIRED DELEGATED SCOPES Workspace.Read.All or Workspace.ReadWrite.All

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • options - ItemsClientListNotebooksOptions contains the optional parameters for the ItemsClient.NewListNotebooksPager method.

func (*ItemsClient) NewListNotebooksPager

func (client *ItemsClient) NewListNotebooksPager(workspaceID string, options *ItemsClientListNotebooksOptions) *runtime.Pager[ItemsClientListNotebooksResponse]

NewListNotebooksPager - This API supports pagination [/rest/api/fabric/articles/pagination]. PERMISSIONS The caller must have viewer or higher workspace role. REQUIRED DELEGATED SCOPES Workspace.Read.All or Workspace.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE

Generated from API version v1

  • workspaceID - The workspace ID.
  • options - ItemsClientListNotebooksOptions contains the optional parameters for the ItemsClient.NewListNotebooksPager method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewItemsClient().NewListNotebooksPager("cfafbeb1-8037-4d0c-896e-a46fb27ff229", &notebook.ItemsClientListNotebooksOptions{ContinuationToken: nil})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.Notebooks = notebook.Notebooks{
		// 	Value: []notebook.Notebook{
		// 		{
		// 			Type: to.Ptr(notebook.ItemTypeNotebook),
		// 			Description: to.Ptr("A notebook description."),
		// 			DisplayName: to.Ptr("Notebook Name 1"),
		// 			ID: to.Ptr("3546052c-ae64-4526-b1a8-52af7761426f"),
		// 			WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
		// 	}},
		// }
	}
}
Output:

func (*ItemsClient) UpdateNotebook

func (client *ItemsClient) UpdateNotebook(ctx context.Context, workspaceID string, notebookID string, updateNotebookRequest UpdateNotebookRequest, options *ItemsClientUpdateNotebookOptions) (ItemsClientUpdateNotebookResponse, error)

UpdateNotebook - PERMISSIONS The caller must have contributor or higher workspace role. REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section. | Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes | INTERFACE If the operation fails it returns an *core.ResponseError type.

Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • updateNotebookRequest - Update notebook request payload.
  • options - ItemsClientUpdateNotebookOptions contains the optional parameters for the ItemsClient.UpdateNotebook method.
Example

Generated from example definition

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"

	"github.com/microsoft/fabric-sdk-go/fabric/notebook"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := notebook.NewClientFactory(cred, nil, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewItemsClient().UpdateNotebook(ctx, "cfafbeb1-8037-4d0c-896e-a46fb27ff229", "5b218778-e7a5-4d73-8187-f10824047715", notebook.UpdateNotebookRequest{
		Description: to.Ptr("A new description for notebook."),
		DisplayName: to.Ptr("Notebook's New name"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Notebook = notebook.Notebook{
	// 	Type: to.Ptr(notebook.ItemTypeNotebook),
	// 	Description: to.Ptr("A new description for notebook."),
	// 	DisplayName: to.Ptr("Notebook's New name"),
	// 	ID: to.Ptr("5b218778-e7a5-4d73-8187-f10824047715"),
	// 	WorkspaceID: to.Ptr("cfafbeb1-8037-4d0c-896e-a46fb27ff229"),
	// }
}
Output:

func (*ItemsClient) UpdateNotebookDefinition

func (client *ItemsClient) UpdateNotebookDefinition(ctx context.Context, workspaceID string, notebookID string, updateNotebookDefinitionRequest UpdateNotebookDefinitionRequest, options *ItemsClientBeginUpdateNotebookDefinitionOptions) (ItemsClientUpdateNotebookDefinitionResponse, error)

UpdateNotebookDefinition - returns ItemsClientUpdateNotebookDefinitionResponse in sync mode. This API supports long running operations (LRO) [/rest/api/fabric/articles/long-running-operation].

Updating the notebook's definition, does not affect its sensitivity label.

PERMISSIONS The API caller must have contributor or higher workspace role.

REQUIRED DELEGATED SCOPES Notebook.ReadWrite.All or Item.ReadWrite.All

MICROSOFT ENTRA SUPPORTED IDENTITIES This API supports the Microsoft identities [/rest/api/fabric/articles/identity-support] listed in this section.

| Identity | Support | |-|-| | User | Yes | | Service principal [/entra/identity-platform/app-objects-and-service-principals#service-principal-object] and Managed identities [/entra/identity/managed-identities-azure-resources/overview] | Yes |

INTERFACE Generated from API version v1

  • workspaceID - The workspace ID.
  • notebookID - The notebook ID.
  • updateNotebookDefinitionRequest - Update notebook definition request payload.
  • options - ItemsClientBeginUpdateNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginUpdateNotebookDefinition method.

type ItemsClientBeginCreateNotebookOptions

type ItemsClientBeginCreateNotebookOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

ItemsClientBeginCreateNotebookOptions contains the optional parameters for the ItemsClient.BeginCreateNotebook method.

type ItemsClientBeginGetNotebookDefinitionOptions

type ItemsClientBeginGetNotebookDefinitionOptions struct {
	// The format of the notebook public definition.
	Format *string

	// Resumes the long-running operation from the provided token.
	ResumeToken string
}

ItemsClientBeginGetNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginGetNotebookDefinition method.

type ItemsClientBeginUpdateNotebookDefinitionOptions

type ItemsClientBeginUpdateNotebookDefinitionOptions struct {
	// Resumes the long-running operation from the provided token.
	ResumeToken string

	// When set to true and the .platform file is provided as part of the definition, the item's metadata is updated using the
	// metadata in the .platform file
	UpdateMetadata *bool
}

ItemsClientBeginUpdateNotebookDefinitionOptions contains the optional parameters for the ItemsClient.BeginUpdateNotebookDefinition method.

type ItemsClientCreateNotebookResponse

type ItemsClientCreateNotebookResponse struct {
	// A notebook object.
	Notebook
}

ItemsClientCreateNotebookResponse contains the response from method ItemsClient.BeginCreateNotebook.

type ItemsClientDeleteNotebookOptions

type ItemsClientDeleteNotebookOptions struct {
}

ItemsClientDeleteNotebookOptions contains the optional parameters for the ItemsClient.DeleteNotebook method.

type ItemsClientDeleteNotebookResponse

type ItemsClientDeleteNotebookResponse struct {
}

ItemsClientDeleteNotebookResponse contains the response from method ItemsClient.DeleteNotebook.

type ItemsClientGetNotebookDefinitionResponse

type ItemsClientGetNotebookDefinitionResponse struct {
	// Notebook public definition response.
	DefinitionResponse
}

ItemsClientGetNotebookDefinitionResponse contains the response from method ItemsClient.BeginGetNotebookDefinition.

type ItemsClientGetNotebookOptions

type ItemsClientGetNotebookOptions struct {
}

ItemsClientGetNotebookOptions contains the optional parameters for the ItemsClient.GetNotebook method.

type ItemsClientGetNotebookResponse

type ItemsClientGetNotebookResponse struct {
	// A notebook object.
	Notebook
}

ItemsClientGetNotebookResponse contains the response from method ItemsClient.GetNotebook.

type ItemsClientListNotebooksOptions

type ItemsClientListNotebooksOptions struct {
	// A token for retrieving the next page of results.
	ContinuationToken *string
}

ItemsClientListNotebooksOptions contains the optional parameters for the ItemsClient.NewListNotebooksPager method.

type ItemsClientListNotebooksResponse

type ItemsClientListNotebooksResponse struct {
	// A list of notebooks.
	Notebooks
}

ItemsClientListNotebooksResponse contains the response from method ItemsClient.NewListNotebooksPager.

type ItemsClientUpdateNotebookDefinitionResponse

type ItemsClientUpdateNotebookDefinitionResponse struct {
}

ItemsClientUpdateNotebookDefinitionResponse contains the response from method ItemsClient.BeginUpdateNotebookDefinition.

type ItemsClientUpdateNotebookOptions

type ItemsClientUpdateNotebookOptions struct {
}

ItemsClientUpdateNotebookOptions contains the optional parameters for the ItemsClient.UpdateNotebook method.

type ItemsClientUpdateNotebookResponse

type ItemsClientUpdateNotebookResponse struct {
	// A notebook object.
	Notebook
}

ItemsClientUpdateNotebookResponse contains the response from method ItemsClient.UpdateNotebook.

type Notebook

type Notebook struct {
	// REQUIRED; The item type.
	Type *ItemType

	// The item description.
	Description *string

	// The item display name.
	DisplayName *string

	// READ-ONLY; The item ID.
	ID *string

	// READ-ONLY; The workspace ID.
	WorkspaceID *string
}

Notebook - A notebook object.

func (Notebook) MarshalJSON

func (n Notebook) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Notebook.

func (*Notebook) UnmarshalJSON

func (n *Notebook) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Notebook.

type Notebooks

type Notebooks struct {
	// REQUIRED; A list of notebooks.
	Value []Notebook

	// The token for the next result set batch. If there are no more records, it's removed from the response.
	ContinuationToken *string

	// The URI of the next result set batch. If there are no more records, it's removed from the response.
	ContinuationURI *string
}

Notebooks - A list of notebooks.

func (Notebooks) MarshalJSON

func (n Notebooks) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Notebooks.

func (*Notebooks) UnmarshalJSON

func (n *Notebooks) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Notebooks.

type PayloadType

type PayloadType string

PayloadType - The type of the definition part payload. Additional payload types may be added over time.

const (
	// PayloadTypeInlineBase64 - Inline Base 64.
	PayloadTypeInlineBase64 PayloadType = "InlineBase64"
)

func PossiblePayloadTypeValues

func PossiblePayloadTypeValues() []PayloadType

PossiblePayloadTypeValues returns the possible values for the PayloadType const type.

type UpdateNotebookDefinitionRequest

type UpdateNotebookDefinitionRequest struct {
	// REQUIRED; Notebook public definition object. Refer to this article [/rest/api/fabric/articles/item-management/definitions/notebook-definition]
	// for more details on how to craft a notebook public definition.
	Definition *Definition
}

UpdateNotebookDefinitionRequest - Update notebook public definition request payload.

func (UpdateNotebookDefinitionRequest) MarshalJSON

func (u UpdateNotebookDefinitionRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateNotebookDefinitionRequest.

func (*UpdateNotebookDefinitionRequest) UnmarshalJSON

func (u *UpdateNotebookDefinitionRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateNotebookDefinitionRequest.

type UpdateNotebookRequest

type UpdateNotebookRequest struct {
	// The notebook description. Maximum length is 256 characters.
	Description *string

	// The notebook display name. The display name must follow naming rules according to item type.
	DisplayName *string
}

UpdateNotebookRequest - Update notebook request.

func (UpdateNotebookRequest) MarshalJSON

func (u UpdateNotebookRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UpdateNotebookRequest.

func (*UpdateNotebookRequest) UnmarshalJSON

func (u *UpdateNotebookRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UpdateNotebookRequest.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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