api

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionInterface

type ActionInterface interface {
	// GetByName gets an action by name.
	GetByName(ctx context.Context, actionName *name.Action) (*openv1alpha1resource.Action, error)

	// ListAllActions lists all actions in the current organization.
	ListAllActions(ctx context.Context, listOpts *ListActionsOptions) ([]*openv1alpha1resource.Action, error)

	// CreateActionRun creates an action run.
	CreateActionRun(ctx context.Context, action *openv1alpha1resource.Action, record *name.Record) error

	// ListAllActionRuns lists all action runs in the current organization.
	ListAllActionRuns(ctx context.Context, listOpts *ListActionRunsOptions) ([]*openv1alpha1resource.ActionRun, error)

	// ActionId2Name converts an action id or name to an action name.
	ActionId2Name(ctx context.Context, actionIdOrName string, projectNameStr *name.Project) (*name.Action, error)
}

func NewActionClient

func NewActionClient(
	actionServiceClient openv1alpha1connect.ActionServiceClient,
	actionRunServiceClient openv1alpha1connect.ActionRunServiceClient,
) ActionInterface

type FileInterface

type FileInterface interface {
	// GetFile gets a file by name.
	GetFile(ctx context.Context, fileResourceName string) (*openv1alpha1resource.File, error)

	// GenerateFileUploadUrls generates pre-signed URLs for file uploads.
	GenerateFileUploadUrls(ctx context.Context, recordName *name.Record, files []*openv1alpha1resource.File) (map[string]string, error)

	// GenerateFileDownloadUrl generates a pre-signed URL for file download.
	GenerateFileDownloadUrl(ctx context.Context, fileResourceName string) (string, error)
}

func NewFileClient

func NewFileClient(fileServiceClient openv1alpha1connect.FileServiceClient) FileInterface

type LabelInterface

type LabelInterface interface {
	// GetByDisplayNameOrCreate gets a label by display name, creates it if not found.
	GetByDisplayNameOrCreate(ctx context.Context, displayName string, projectName *name.Project) (*openv1alpha1resource.Label, error)
}

func NewLabelClient

func NewLabelClient(labelServiceClient openv1alpha1connect.LabelServiceClient) LabelInterface

type ListActionRunsOptions

type ListActionRunsOptions struct {
	Parent      string
	RecordNames []*name.Record
}

type ListActionsOptions

type ListActionsOptions struct {
	Parent string
}

type ListProjectsOptions

type ListProjectsOptions struct {
}

type ListRecordsOptions

type ListRecordsOptions struct {
	Project        *name.Project
	Titles         []string
	IncludeArchive bool
}

type OrganizationInterface

type OrganizationInterface interface {
	// Slug get org slug.
	Slug(ctx context.Context, org *name.Organization) (string, error)
}

func NewOrganizationClient

func NewOrganizationClient(organizationServiceClient openv1alpha1connect.OrganizationServiceClient) OrganizationInterface

type ProjectInterface

type ProjectInterface interface {
	// Name gets the project resource name from the project slug.
	Name(ctx context.Context, projectSlug string) (*name.Project, error)

	// Get gets a project by name.
	Get(ctx context.Context, projectName *name.Project) (*openv1alpha1resource.Project, error)

	// ListAllUserProjects lists all projects in the current organization.
	ListAllUserProjects(ctx context.Context, listOpts *ListProjectsOptions) ([]*openv1alpha1resource.Project, error)
}

func NewProjectClient

func NewProjectClient(projectServiceClient openv1alpha1connect.ProjectServiceClient) ProjectInterface

type RecordInterface

type RecordInterface interface {
	// Get gets a record by name.
	Get(ctx context.Context, recordName *name.Record) (*openv1alpha1resource.Record, error)

	// Create creates a record.
	Create(ctx context.Context, parent *name.Project, title string, deviceNameStr string, description string, labelDisplayNames []*openv1alpha1resource.Label) (*openv1alpha1resource.Record, error)

	// Copy copies a record to target project.
	Copy(ctx context.Context, recordName *name.Record, targetProjectName *name.Project) (*openv1alpha1resource.Record, error)

	// CopyFiles copies files from src record to dst record.
	CopyFiles(ctx context.Context, srcRecordName *name.Record, dstRecordName *name.Record, files []*openv1alpha1resource.File) error

	// ListAllFiles lists all files in a record.
	ListAllFiles(ctx context.Context, recordName *name.Record) ([]*openv1alpha1resource.File, error)

	// Delete deletes a record by name.
	Delete(ctx context.Context, recordName *name.Record) error

	// Update updates a record.
	Update(ctx context.Context, recordName *name.Record, title string, description string, labels []*openv1alpha1resource.Label, fieldMask []string) error

	//ListAllEvents lists all events in a record.
	ListAllEvents(ctx context.Context, recordName *name.Record) ([]*openv1alpha1resource.Event, error)

	// ListAll lists all records in a project.
	ListAll(ctx context.Context, options *ListRecordsOptions) ([]*openv1alpha1resource.Record, error)

	// GenerateRecordThumbnailUploadUrl generates a pre-signed URL for uploading a record thumbnail.
	GenerateRecordThumbnailUploadUrl(ctx context.Context, recordName *name.Record) (string, error)

	// RecordId2Name converts a record id or name to a record name.
	RecordId2Name(ctx context.Context, recordIdOrName string, projectNameStr *name.Project) (*name.Record, error)
}

func NewRecordClient

func NewRecordClient(recordServiceClient openv1alpha1connect.RecordServiceClient, fileServiceClient openv1alpha1connect.FileServiceClient) RecordInterface

type SecurityTokenInterface

type SecurityTokenInterface interface {
	GenerateSecurityToken(ctx context.Context, project string) (*openDssv1alphaservice.GenerateSecurityTokenResponse, error)
}

func NewSecurityTokenClient

func NewSecurityTokenClient(securityTokenServiceClient openDssv1alphaconnect.SecurityTokenServiceClient) SecurityTokenInterface

type UserInterface

type UserInterface interface {
	// BatchGetUsers gets users by usernames.
	BatchGetUsers(ctx context.Context, userNameList mapset.Set[name.User]) (map[string]*openv1alpha1resource.User, error)
}

func NewUserClient

func NewUserClient(userServiceClient openv1alpha1connect.UserServiceClient) UserInterface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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