documents

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the HTTP client to be used for interacting with the Document API

func NewClient

func NewClient(client *rest.Client) *Client

NewClient creates a new document client

func (Client) Create

func (c Client) Create(ctx context.Context, name string, isPrivate bool, externalId string, data []byte, documentType DocumentType) (api.Response, error)

func (Client) Delete

func (c Client) Delete(ctx context.Context, id string) (api.Response, error)

func (Client) Get

func (c Client) Get(ctx context.Context, id string) (Response, error)

func (Client) List

func (c Client) List(ctx context.Context, filter string) (ListResponse, error)

func (Client) Update

func (c Client) Update(ctx context.Context, id string, name string, isPrivate bool, data []byte, documentType DocumentType) (api.Response, error)

type DocumentType

type DocumentType string
const (
	Dashboard DocumentType = "dashboard"
	Notebook  DocumentType = "notebook"
)

type ListResponse

type ListResponse struct {
	api.Response
	Responses []Response
}

ListResponse is a list of API Responses

type Metadata

type Metadata struct {
	ID         string `json:"id"`
	ExternalID string `json:"externalId"`
	Actor      string `json:"actor"`
	Owner      string `json:"owner"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Version    int    `json:"version"`
	IsPrivate  bool   `json:"isPrivate"`
}

func UnmarshallMetadata

func UnmarshallMetadata(b []byte) (Metadata, error)

type Response

type Response struct {
	api.Response
	Metadata
}

Response contains the API response

Jump to

Keyboard shortcuts

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