documents

package
v0.5.2-0...-e490bd6 Latest Latest
Warning

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

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

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) (Response, error)

func (Client) Delete

func (c Client) Delete(ctx context.Context, id string) (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) (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 Response

type Response struct {
	api.Response

	// Metadata fields
	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"`
}

Response contains the API response

Jump to

Keyboard shortcuts

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