Documentation
¶
Index ¶
- Constants
- Variables
- type Account
- type AccountMTEngine
- type AccountMTEngines
- type AdditionalHeader
- type Callback
- type Client
- func (v *Client) Debug(is bool, w io.Writer)
- func (v *Client) DelCallback() (err error)
- func (v *Client) DelProject(id string) (err error)
- func (v *Client) GetAccount() (out Account, err error)
- func (v *Client) GetAccountMTEngines() (out AccountMTEngines, err error)
- func (v *Client) GetCallback() (out Callback, err error)
- func (v *Client) GetCallbackLastErrors(limit int) (out LastErrors, err error)
- func (v *Client) GetProject(id string) (out Project, err error)
- func (v *Client) ListProject() (out ProjectsList, err error)
- func (v *Client) SetCallback(in Callback) (out Callback, err error)
- func (v *Client) SetProject(id string, in PatchProject) (out Project, err error)
- type Config
- type Cost
- type Document
- type DocumentWorkflowStage
- type ErrorResponse
- type Executive
- type LastError
- type LastErrors
- type PatchProject
- type Project
- type ProjectsList
- type Vendor
- type WorkflowStage
Constants ¶
const ( //HostURL if you are using the European server. HostURL = `https://smartcat.ai` //USHostURL if you are using the American server. USHostURL = `https://us.smartcat.ai` //EAHostURL if you are using the Asian server. EAHostURL = `https://ea.smartcat.ai` )
Variables ¶
var ( //ErrUnknown unknown error ErrUnknown = errors.New("unknown error") )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
IsPersonal bool `json:"isPersonal"`
Type string `json:"type"`
}
Account information about your current account.
func (Account) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Account) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Account) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Account) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type AccountMTEngine ¶
AccountMTEngine information about the machine translation engine
func (AccountMTEngine) MarshalEasyJSON ¶
func (v AccountMTEngine) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountMTEngine) MarshalJSON ¶
func (v AccountMTEngine) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountMTEngine) UnmarshalEasyJSON ¶
func (v *AccountMTEngine) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountMTEngine) UnmarshalJSON ¶
func (v *AccountMTEngine) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AccountMTEngines ¶
type AccountMTEngines []AccountMTEngine
AccountMTEngines list of available machine translation engines
func (AccountMTEngines) MarshalEasyJSON ¶
func (v AccountMTEngines) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AccountMTEngines) MarshalJSON ¶
func (v AccountMTEngines) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AccountMTEngines) UnmarshalEasyJSON ¶
func (v *AccountMTEngines) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AccountMTEngines) UnmarshalJSON ¶
func (v *AccountMTEngines) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type AdditionalHeader ¶ added in v0.0.2
AdditionalHeader additional headers for transmission with a callback
func (AdditionalHeader) MarshalEasyJSON ¶ added in v0.0.2
func (v AdditionalHeader) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (AdditionalHeader) MarshalJSON ¶ added in v0.0.2
func (v AdditionalHeader) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*AdditionalHeader) UnmarshalEasyJSON ¶ added in v0.0.2
func (v *AdditionalHeader) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*AdditionalHeader) UnmarshalJSON ¶ added in v0.0.2
func (v *AdditionalHeader) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Callback ¶ added in v0.0.2
type Callback struct {
URL string `json:"url"`
AdditionalHeaders []AdditionalHeader `json:"additionalHeaders"`
}
Callback callback settings
func (Callback) MarshalEasyJSON ¶ added in v0.0.2
MarshalEasyJSON supports easyjson.Marshaler interface
func (Callback) MarshalJSON ¶ added in v0.0.2
MarshalJSON supports json.Marshaler interface
func (*Callback) UnmarshalEasyJSON ¶ added in v0.0.2
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Callback) UnmarshalJSON ¶ added in v0.0.2
UnmarshalJSON supports json.Unmarshaler interface
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client client connecting to the server
func NewCustomClient ¶
NewCustomClient init client
func (*Client) DelCallback ¶ added in v0.0.2
DelCallback Resetting the configuration of notifications reception
func (*Client) DelProject ¶ added in v0.0.3
DelProject Delete the project
func (*Client) GetAccount ¶ added in v0.0.2
GetAccount Receiving the account details
func (*Client) GetAccountMTEngines ¶ added in v0.0.2
func (v *Client) GetAccountMTEngines() (out AccountMTEngines, err error)
GetAccountMTEngines Receiving MT engines available for the account
func (*Client) GetCallback ¶ added in v0.0.2
GetCallback Reading configurations of notifications reception of the account
func (*Client) GetCallbackLastErrors ¶ added in v0.0.2
func (v *Client) GetCallbackLastErrors(limit int) (out LastErrors, err error)
GetCallbackLastErrors Reading the recent sending errors
func (*Client) GetProject ¶ added in v0.0.3
GetProject Receive the project model
func (*Client) ListProject ¶ added in v0.0.3
func (v *Client) ListProject() (out ProjectsList, err error)
ListProject List all projects
func (*Client) SetCallback ¶ added in v0.0.2
SetCallback Setting configurations of notifications reception of the account
func (*Client) SetProject ¶ added in v0.0.3
func (v *Client) SetProject(id string, in PatchProject) (out Project, err error)
SetProject Change the project model
type Cost ¶ added in v0.0.3
type Cost struct {
Value float64 `json:"value"`
Currency string `json:"currency"`
AccuracyDegree string `json:"accuracyDegree"`
DetailsFileName string `json:"detailsFileName"`
PaymentStatus string `json:"paymentStatus"`
}
Cost model
func (Cost) MarshalEasyJSON ¶ added in v0.0.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Cost) MarshalJSON ¶ added in v0.0.3
MarshalJSON supports json.Marshaler interface
func (*Cost) UnmarshalEasyJSON ¶ added in v0.0.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Cost) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON supports json.Unmarshaler interface
type Document ¶ added in v0.0.3
type Document struct {
ID string `json:"id"`
Name string `json:"name"`
CreationDate string `json:"creationDate"`
Deadline string `json:"deadline"`
SourceLanguage string `json:"sourceLanguage"`
DisassemblingStatus string `json:"documentDisassemblingStatus"`
TargetLanguage string `json:"targetLanguage"`
Status string `json:"status"`
WordsCount uint64 `json:"wordsCount"`
StatusModificationDate string `json:"statusModificationDate"`
PretranslateCompleted bool `json:"pretranslateCompleted"`
WorkflowStages []DocumentWorkflowStage `json:"workflowStages"`
ExternalID string `json:"externalId"`
MetaInfo string `json:"metaInfo"`
PlaceholdersAreEnabled bool `json:"placeholdersAreEnabled"`
}
Document model
func (Document) MarshalEasyJSON ¶ added in v0.0.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Document) MarshalJSON ¶ added in v0.0.3
MarshalJSON supports json.Marshaler interface
func (*Document) UnmarshalEasyJSON ¶ added in v0.0.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Document) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON supports json.Unmarshaler interface
type DocumentWorkflowStage ¶ added in v0.0.3
type DocumentWorkflowStage struct {
Progress uint `json:"progress"`
WordsTranslated uint64 `json:"wordsTranslated"`
UnassignedWordsCount uint64 `json:"unassignedWordsCount"`
Status string `json:"status"`
Executives []Executive `json:"executives"`
}
DocumentWorkflowStage model
func (DocumentWorkflowStage) MarshalEasyJSON ¶ added in v0.0.3
func (v DocumentWorkflowStage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DocumentWorkflowStage) MarshalJSON ¶ added in v0.0.3
func (v DocumentWorkflowStage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DocumentWorkflowStage) UnmarshalEasyJSON ¶ added in v0.0.3
func (v *DocumentWorkflowStage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DocumentWorkflowStage) UnmarshalJSON ¶ added in v0.0.3
func (v *DocumentWorkflowStage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"Message"`
}
ErrorResponse model error response from the server
func (ErrorResponse) MarshalEasyJSON ¶
func (v ErrorResponse) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ErrorResponse) MarshalJSON ¶
func (v ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ErrorResponse) UnmarshalEasyJSON ¶
func (v *ErrorResponse) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ErrorResponse) UnmarshalJSON ¶
func (v *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Executive ¶ added in v0.0.3
type Executive struct {
ID string `json:"id"`
AssignedWordsCount uint64 `json:"assignedWordsCount"`
Progress uint `json:"progress"`
SupplierType string `json:"supplierType"`
}
Executive model
func (Executive) MarshalEasyJSON ¶ added in v0.0.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Executive) MarshalJSON ¶ added in v0.0.3
MarshalJSON supports json.Marshaler interface
func (*Executive) UnmarshalEasyJSON ¶ added in v0.0.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Executive) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON supports json.Unmarshaler interface
type LastError ¶ added in v0.0.2
type LastError struct {
Created string `json:"created"`
URL string `json:"url"`
Reason string `json:"reason"`
Code int `json:"code"`
Content string `json:"content"`
SourceIds []string `json:"sourceIds"`
}
LastError information about callback errors
func (LastError) MarshalEasyJSON ¶ added in v0.0.2
MarshalEasyJSON supports easyjson.Marshaler interface
func (LastError) MarshalJSON ¶ added in v0.0.2
MarshalJSON supports json.Marshaler interface
func (*LastError) UnmarshalEasyJSON ¶ added in v0.0.2
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LastError) UnmarshalJSON ¶ added in v0.0.2
UnmarshalJSON supports json.Unmarshaler interface
type LastErrors ¶ added in v0.0.2
type LastErrors []LastError
LastErrors error list
func (LastErrors) MarshalEasyJSON ¶ added in v0.0.2
func (v LastErrors) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (LastErrors) MarshalJSON ¶ added in v0.0.2
func (v LastErrors) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*LastErrors) UnmarshalEasyJSON ¶ added in v0.0.2
func (v *LastErrors) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*LastErrors) UnmarshalJSON ¶ added in v0.0.2
func (v *LastErrors) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PatchProject ¶ added in v0.0.3
type PatchProject struct {
Name string `json:"name"`
Description string `json:"description"`
Deadline string `json:"deadline"`
ClientID string `json:"clientId"`
DomainID uint64 `json:"domainId"`
VendorAccountIDs []string `json:"vendorAccountIds"`
ExternalTag string `json:"externalTag"`
Specializations []string `json:"specializations"`
WorkflowStages []string `json:"workflowStages"`
}
PatchProject model
func (PatchProject) MarshalEasyJSON ¶ added in v0.0.3
func (v PatchProject) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PatchProject) MarshalJSON ¶ added in v0.0.3
func (v PatchProject) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PatchProject) UnmarshalEasyJSON ¶ added in v0.0.3
func (v *PatchProject) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PatchProject) UnmarshalJSON ¶ added in v0.0.3
func (v *PatchProject) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Project ¶ added in v0.0.3
type Project struct {
ID string `json:"id"`
AccountID string `json:"accountId"`
Name string `json:"name"`
Description string `json:"description"`
Deadline string `json:"deadline"`
CreationDate string `json:"creationDate"`
CreatedByUserID string `json:"createdByUserId"`
CreatedByUserEmail string `json:"createdByUserEmail"`
ModificationDate string `json:"modificationDate"`
SourceLanguageID uint64 `json:"sourceLanguageId"`
SourceLanguage string `json:"sourceLanguage"`
TargetLanguages []string `json:"targetLanguages"`
Status string `json:"status"`
StatusModificationDate string `json:"statusModificationDate"`
DomainID uint64 `json:"domainId"`
ClientID uint64 `json:"clientId"`
Vendors []Vendor `json:"vendors"`
WorkflowStages []WorkflowStage `json:"workflowStages"`
Documents []Document `json:"documents"`
ExternalTag string `json:"externalTag"`
Specializations []string `json:"specializations"`
Managers []string `json:"managers"`
Number []string `json:"number"`
}
Project model
func (Project) MarshalEasyJSON ¶ added in v0.0.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Project) MarshalJSON ¶ added in v0.0.3
MarshalJSON supports json.Marshaler interface
func (*Project) UnmarshalEasyJSON ¶ added in v0.0.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Project) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON supports json.Unmarshaler interface
type ProjectsList ¶ added in v0.0.3
type ProjectsList []Project
ProjectsList model
func (ProjectsList) MarshalEasyJSON ¶ added in v0.0.3
func (v ProjectsList) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ProjectsList) MarshalJSON ¶ added in v0.0.3
func (v ProjectsList) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ProjectsList) UnmarshalEasyJSON ¶ added in v0.0.3
func (v *ProjectsList) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ProjectsList) UnmarshalJSON ¶ added in v0.0.3
func (v *ProjectsList) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Vendor ¶ added in v0.0.3
type Vendor struct {
VendorAccountID string `json:"vendorAccountId"`
RemovedFromProject bool `json:"removedFromProject"`
Cost Cost `json:"cost"`
CostDetailsFileID string `json:"costDetailsFileId"`
}
Vendor model
func (Vendor) MarshalEasyJSON ¶ added in v0.0.3
MarshalEasyJSON supports easyjson.Marshaler interface
func (Vendor) MarshalJSON ¶ added in v0.0.3
MarshalJSON supports json.Marshaler interface
func (*Vendor) UnmarshalEasyJSON ¶ added in v0.0.3
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Vendor) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON supports json.Unmarshaler interface
type WorkflowStage ¶ added in v0.0.3
WorkflowStage model
func (WorkflowStage) MarshalEasyJSON ¶ added in v0.0.3
func (v WorkflowStage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (WorkflowStage) MarshalJSON ¶ added in v0.0.3
func (v WorkflowStage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*WorkflowStage) UnmarshalEasyJSON ¶ added in v0.0.3
func (v *WorkflowStage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*WorkflowStage) UnmarshalJSON ¶ added in v0.0.3
func (v *WorkflowStage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface