glossary

package
v0.0.0-...-8b5166a Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PendingImportStatus    = "PENDING"
	InProgressImportStatus = "IN_PROGRESS"
	SuccessfulImportStatus = "SUCCESSFUL"
	FailedImportStatus     = "FAILED"
)

Variables

View Source
var (
	ErrGlossaryNotFound = errors.New("glossary not found")
	ErrImportNotFound   = errors.New("glossary import not found")
)

Functions

This section is empty.

Types

type CreateGlossaryRequest

type CreateGlossaryRequest struct {
	GlossaryName     string           `json:"glossaryName"`
	Description      string           `json:"description"`
	VerificationMode bool             `json:"verificationMode"`
	LocaleIDs        []string         `json:"localeIds"`
	FallbackLocales  []FallbackLocale `json:"fallbackLocales"`
}

CreateGlossaryRequest is the JSON body for a glossary-create call.

type CreateGlossaryResponse

type CreateGlossaryResponse struct {
	Code         int
	GlossaryUID  string
	AccountUID   string
	GlossaryName string
}

CreateGlossaryResponse is the public result of a glossary-create call.

type ExportGlossaryDateFilter

type ExportGlossaryDateFilter struct {
	Level string    `json:"level,omitempty"`
	Date  time.Time `json:"date"`
	Type  string    `json:"type,omitempty"`
}

type ExportGlossaryFilter

type ExportGlossaryFilter struct {
	Query                      string                      `json:"query,omitempty"`
	LocaleIds                  []string                    `json:"localeIds,omitempty"`
	EntryUids                  []string                    `json:"entryUids,omitempty"`
	EntryState                 string                      `json:"entryState,omitempty"`
	MissingTranslationLocaleId string                      `json:"missingTranslationLocaleId,omitempty"`
	PresentTranslationLocaleId string                      `json:"presentTranslationLocaleId,omitempty"`
	DntLocaleId                string                      `json:"dntLocaleId,omitempty"`
	ReturnFallbackTranslations bool                        `json:"returnFallbackTranslations,omitempty"`
	Labels                     *ExportGlossaryLabelsFilter `json:"labels,omitempty"`
	DntTermSet                 bool                        `json:"dntTermSet,omitempty"`
	Created                    *ExportGlossaryDateFilter   `json:"created,omitempty"`
	LastModified               *ExportGlossaryDateFilter   `json:"lastModified,omitempty"`
	CreatedBy                  *ExportGlossaryUserFilter   `json:"createdBy,omitempty"`
	LastModifiedBy             *ExportGlossaryUserFilter   `json:"lastModifiedBy,omitempty"`
	Paging                     ExportGlossaryPaging        `json:"paging"`
	Sorting                    *ExportGlossarySorting      `json:"sorting,omitempty"`
}

type ExportGlossaryLabelsFilter

type ExportGlossaryLabelsFilter struct {
	Type string `json:"type,omitempty"`
}

type ExportGlossaryPaging

type ExportGlossaryPaging struct {
	Offset int `json:"offset"`
	Limit  int `json:"limit"`
}

type ExportGlossaryRequest

type ExportGlossaryRequest struct {
	Format        string               `json:"format"`
	TbxVersion    string               `json:"tbxVersion,omitempty"`
	Filter        ExportGlossaryFilter `json:"filter"`
	FocusLocaleId string               `json:"focusLocaleId,omitempty"`
	LocaleIds     []string             `json:"localeIds"`
	SkipEntries   bool                 `json:"skipEntries,omitempty"`
}

type ExportGlossaryResponse

type ExportGlossaryResponse struct {
	Code          int
	Filename      string
	ContentType   string
	ContentLength int64
	Data          io.ReadCloser
}

type ExportGlossarySorting

type ExportGlossarySorting struct {
	Field     string `json:"field,omitempty"`
	Direction string `json:"direction,omitempty"`
	LocaleId  string `json:"localeId,omitempty"`
}

type ExportGlossaryUserFilter

type ExportGlossaryUserFilter struct {
	Level   string   `json:"level,omitempty"`
	UserIds []string `json:"userIds,omitempty"`
}

type FallbackLocale

type FallbackLocale struct {
	FallbackLocaleID string   `json:"fallbackLocaleId"`
	LocaleIDs        []string `json:"localeIds"`
}

type GetGlossaryResponse

type GetGlossaryResponse struct {
	GlossaryUID string
	Name        string
	Description string
	LocaleIDs   []string
}

GetGlossaryResponse is the public representation of a single glossary.

type Glossary

type Glossary interface {
	Get(ctx context.Context, accountUID uid.AccountUID, glossaryUID string) (GetGlossaryResponse, error)
	GetByName(ctx context.Context, accountUID uid.AccountUID, name string) (glossaries []GetGlossaryResponse, err error)
	Import(ctx context.Context, accountUID uid.AccountUID, glossaryUID string, req ImportGlossaryRequest) (ImportGlossaryResponse, error)
	ImportStatus(ctx context.Context, accountUID uid.AccountUID, glossaryUID, importUID string) (ImportStatusResponse, error)
	ImportConfirm(ctx context.Context, accountUID uid.AccountUID, glossaryUID, importUID string) (bool, error)
	Export(ctx context.Context, accountUID uid.AccountUID, glossaryUID string, req ExportGlossaryRequest) (ExportGlossaryResponse, error)
	Create(ctx context.Context, accountUID uid.AccountUID, req CreateGlossaryRequest) (CreateGlossaryResponse, error)
}

Glossary defines the glossary behaviour

func NewGlossary

func NewGlossary(client *smclient.Client) Glossary

NewGlossary returns new Glossary implementation

type ImportEntryChanges

type ImportEntryChanges struct {
	NewEntries           int
	ExistingEntryUpdates int
	NotMatchedEntries    int
	EntriesToArchive     int
}

type ImportGlossaryRequest

type ImportGlossaryRequest struct {
	File        []byte
	FileName    string
	MediaType   string
	ArchiveMode bool
}

type ImportGlossaryResponse

type ImportGlossaryResponse struct {
	Code               int
	GlossaryUID        string
	ImportUID          string
	ImportStatus       string
	EntryChanges       ImportEntryChanges
	TranslationChanges []ImportTranslationChanges
	Warnings           []ImportWarning
}

type ImportStatusResponse

type ImportStatusResponse struct {
	Code         int
	GlossaryUID  string
	ImportUID    string
	ImportStatus string
}

type ImportTranslationChanges

type ImportTranslationChanges struct {
	LocaleID             string
	NewTranslations      int
	UpdatedTranslations  int
	TranslationsToRemove int
}

type ImportWarning

type ImportWarning struct {
	Key     string
	Message string
}

Jump to

Keyboard shortcuts

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