Documentation
¶
Index ¶
- type AccessSettings
- type AnalyseSettings
- type Args
- type AsyncRequest
- type AsyncRequestInt
- type AsyncRequestResponse
- type AsyncResponse
- type BusinessUnit
- type By
- type Client
- func (c *Client) Authenticate() error
- func (c *Client) CreateJob(targetLanguages []string, path, filename string, data []byte) error
- func (c *Client) DownloadFile(ctx context.Context, jobUID string, asyncRequestID string) ([]byte, error)
- func (c *Client) GetFileAsync(ctx context.Context, jobUID string) error
- func (c *Client) GetJob(jobUID string) (*Job, error)
- func (c *Client) GetJobs(filename string) ([]Job, error)
- func (c *Client) GetProject(projectID string) (*Project, error)
- func (c *Client) ProcessWebhook(ctx context.Context, originalRequest *http.Request, hookData []byte) (*translations.TranslatableCollection, []common.TranslationData, error)
- func (m *Client) SendToTranslation(ctx context.Context, collection string, data []common.TranslationData) error
- func (c *Client) SetDebug(debug bool)
- func (c *Client) UpdateSource(jobs []string, filename string, data []byte) error
- type Config
- type ContinuousJobInfo
- type CostCenter
- type CreateJobHeader
- type CreatedBy
- type CreationTask
- type Datetime
- type Domain
- type ErrorDetails
- type Errors
- type FinancialSettings
- type ForbiddenStrings
- type ImportResult
- type ImportStatus
- type Job
- type JobOnlyUID
- type JobParts
- type JobReference
- type JobsList
- type LangSettings
- type LastModified
- type LastTask
- type LoginResponse
- type MachineTranslateSettings
- type Metadata
- type Options
- type Organization
- type Owner
- type Parent
- type ParentInt
- type Progress
- type Project
- type Providers
- type QualityAssuranceSettings
- type Reference
- type ResultFileRequest
- type SecuritySettings
- type Settings
- type Status
- type SubDomain
- type TargetLength
- type TargetLengthPercent
- type UpdateSourceRequest
- type Vendor
- type Warnings
- type WebhookEvent
- type WebhookMetadata
- type WebhookPost
- type WorkUnit
- type WorkflowStep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessSettings ¶
type AccessSettings struct { DownloadEnabled bool `json:"downloadEnabled"` WebEditorEnabledForLinguists bool `json:"webEditorEnabledForLinguists"` ShowUserDataToLinguists bool `json:"showUserDataToLinguists"` EmailNotifications bool `json:"emailNotifications"` AllowLoadingExternalContentInEditors bool `json:"allowLoadingExternalContentInEditors"` AllowLoadingIframes bool `json:"allowLoadingIframes"` StrictWorkflowFinish bool `json:"strictWorkflowFinish"` UseVendors bool `json:"useVendors"` LinguistsMayEditLockedSegments bool `json:"linguistsMayEditLockedSegments"` LinguistsMayEditTagContent bool `json:"linguistsMayEditTagContent"` LinguistsMayEditSource bool `json:"linguistsMayEditSource"` LinguistsMaySetAutoPropagation bool `json:"linguistsMaySetAutoPropagation"` UserMaySetInstantQA bool `json:"userMaySetInstantQA"` TriggerWebhooks bool `json:"triggerWebhooks"` }
type AnalyseSettings ¶
type AnalyseSettings struct { Type string `json:"type"` IncludeFuzzyRepetitions bool `json:"includeFuzzyRepetitions"` IncludeNonTranslatables bool `json:"includeNonTranslatables"` IncludeMachineTranslationMatches bool `json:"includeMachineTranslationMatches"` IncludeConfirmedSegments bool `json:"includeConfirmedSegments"` IncludeNumbers bool `json:"includeNumbers"` IncludeLockedSegments bool `json:"includeLockedSegments"` CountSourceUnits bool `json:"countSourceUnits"` IncludeTransMemory bool `json:"includeTransMemory"` NamingPattern string `json:"namingPattern"` AnalyzeByLinguist bool `json:"analyzeByLinguist"` AnalyzeByLanguage bool `json:"analyzeByLanguage"` AllowAutomaticPostAnalysis bool `json:"allowAutomaticPostAnalysis"` ConfirmedSegmentsOnly bool `json:"confirmedSegmentsOnly"` ConfirmedOnlyByUsers []interface{} `json:"confirmedOnlyByUsers"` }
type AsyncRequest ¶
type AsyncRequestInt ¶
type AsyncRequestResponse ¶
type AsyncRequestResponse struct {
AsyncRequest AsyncRequest `json:"asyncRequest"`
}
type AsyncResponse ¶
type AsyncResponse struct { DateCreated Datetime `json:"dateCreated"` ErrorCode string `json:"errorCode"` ErrorDesc string `json:"errorDesc"` ErrorDetails []ErrorDetails `json:"errorDetails"` Warnings []Warnings `json:"warnings"` }
type BusinessUnit ¶
type Client ¶
type Client struct { Config // contains filtered or unexported fields }
Client for Phrase TMS based on https://cloud.memsource.com/web/docs/api
func (*Client) Authenticate ¶
func (*Client) DownloadFile ¶
func (*Client) GetFileAsync ¶
func (*Client) ProcessWebhook ¶
func (c *Client) ProcessWebhook(ctx context.Context, originalRequest *http.Request, hookData []byte) (*translations.TranslatableCollection, []common.TranslationData, error)
func (*Client) SendToTranslation ¶
func (m *Client) SendToTranslation(ctx context.Context, collection string, data []common.TranslationData) error
SendToTranslation sends the data provided to Phrase
type ContinuousJobInfo ¶
type ContinuousJobInfo struct {
DateUpdated Datetime `json:"dateUpdated"`
}
type CostCenter ¶
type CreateJobHeader ¶
type CreationTask ¶
type Datetime ¶
Datetime is a custom JSON date parser that supports "Z" and "+0000" suffix as Phrase can't decide what to use.
func (Datetime) MarshalJSON ¶
func (*Datetime) UnmarshalJSON ¶
type ErrorDetails ¶
type Errors ¶
type Errors struct { CreationTask CreationTask `json:"creationTask"` LastTask LastTask `json:"lastTask"` }
type FinancialSettings ¶
type FinancialSettings struct { }
type ForbiddenStrings ¶
type ForbiddenStrings struct { Enabled bool `json:"enabled"` List []interface{} `json:"list"` }
type ImportResult ¶
type ImportResult struct {
Warnings []interface{} `json:"warnings"`
}
type ImportStatus ¶
type Job ¶
type Job struct { UID string `json:"uid"` InnerID string `json:"innerId"` Status Status `json:"status"` Providers []Providers `json:"providers"` SourceLang string `json:"sourceLang"` TargetLang string `json:"targetLang"` WorkflowLevel int `json:"workflowLevel"` WorkflowStep WorkflowStep `json:"workflowStep"` Filename string `json:"filename"` DateDue Datetime `json:"dateDue"` WordsCount int `json:"wordsCount"` BeginIndex int `json:"beginIndex"` EndIndex int `json:"endIndex"` IsParentJobSplit bool `json:"isParentJobSplit"` UpdateSourceDate Datetime `json:"updateSourceDate"` UpdateTargetDate Datetime `json:"updateTargetDate"` DateCreated Datetime `json:"dateCreated"` JobReference JobReference `json:"jobReference"` Project Project `json:"project"` LastWorkflowLevel int `json:"lastWorkflowLevel"` WorkUnit WorkUnit `json:"workUnit"` ImportStatus ImportStatus `json:"importStatus"` Imported bool `json:"imported"` Continuous bool `json:"continuous"` ContinuousJobInfo ContinuousJobInfo `json:"continuousJobInfo"` OriginalFileDirectory string `json:"originalFileDirectory"` ServerTaskID string `json:"serverTaskId"` }
type JobOnlyUID ¶
type JobOnlyUID struct {
UID string `json:"uid"`
}
type JobParts ¶
type JobParts struct { ID int `json:"id"` UID string `json:"uid"` InternalID string `json:"internalId"` Task string `json:"task"` FileName string `json:"fileName"` TargetLang string `json:"targetLang"` WorkflowLevel int `json:"workflowLevel"` Status Status `json:"status"` WordsCount int `json:"wordsCount"` BeginIndex int `json:"beginIndex"` EndIndex int `json:"endIndex"` IsParentJobSplit bool `json:"isParentJobSplit"` DateCreated Datetime `json:"dateCreated"` Project Project `json:"project"` }
type JobReference ¶
type JobReference struct { UID string `json:"uid"` JobUID string `json:"jobUid"` Filename string `json:"filename"` SourceLocale string `json:"sourceLocale"` TargetLocale string `json:"targetLocale"` SourceLang string `json:"sourceLang"` TargetLang string `json:"targetLang"` WordCount int `json:"wordCount"` Progress int `json:"progress"` Level int `json:"level"` DueDate Datetime `json:"dueDate"` CreatedDate Datetime `json:"createdDate"` JobCreatedDate Datetime `json:"jobCreatedDate"` LastModifiedDate Datetime `json:"lastModifiedDate"` Status Status `json:"status"` Project Project `json:"project"` CreatedBy CreatedBy `json:"createdBy"` Owner Owner `json:"owner"` Providers []Providers `json:"providers"` WorkflowStep WorkflowStep `json:"workflowStep"` Continuous bool `json:"continuous"` LqaScore bool `json:"lqaScore"` Settings Settings `json:"settings"` Warnings []string `json:"warnings"` Errors Errors `json:"errors"` }
type LangSettings ¶
type LangSettings struct {
TargetLang string `json:"targetLang"`
}
type LastModified ¶
type LoginResponse ¶
type Organization ¶
type Project ¶
type Project struct { UID string `json:"uid"` InnerID int `json:"innerId"` Name string `json:"name"` BusinessUnit BusinessUnit `json:"businessUnit"` Domain Domain `json:"domain"` SubDomain SubDomain `json:"subDomain"` Client Client `json:"client"` CostCenter CostCenter `json:"costCenter"` DueDate Datetime `json:"dueDate"` CreatedDate Datetime `json:"createdDate"` CreatedBy CreatedBy `json:"createdBy"` Owner Owner `json:"owner"` Vendor Vendor `json:"vendor"` PurchaseOrder string `json:"purchaseOrder"` SourceLang string `json:"sourceLang"` TargetLangs []string `json:"targetLangs"` Status Status `json:"status"` Progress Progress `json:"progress"` Metadata []Metadata `json:"metadata"` Note string `json:"note"` Deleted bool `json:"deleted"` Archived bool `json:"archived"` }
type QualityAssuranceSettings ¶
type QualityAssuranceSettings struct { EmptyTranslation bool `json:"emptyTranslation"` InconsistentTranslation bool `json:"inconsistentTranslation"` JoinTags bool `json:"joinTags"` MissingNumbers bool `json:"missingNumbers"` SegmentNotConfirmed bool `json:"segmentNotConfirmed"` Terminology bool `json:"terminology"` MultipleSpaces bool `json:"multipleSpaces"` TrailingSpace bool `json:"trailingSpace"` TrailingPunctuation bool `json:"trailingPunctuation"` TargetLength TargetLength `json:"targetLength"` Formatting bool `json:"formatting"` UnresolvedComment bool `json:"unresolvedComment"` EmptyPairTags bool `json:"emptyPairTags"` StrictJobStatus bool `json:"strictJobStatus"` ForbiddenStrings ForbiddenStrings `json:"forbiddenStrings"` ExcludeLockedSegments bool `json:"excludeLockedSegments"` IgnoreNotApprovedTerms bool `json:"ignoreNotApprovedTerms"` SpellCheck bool `json:"spellCheck"` RepeatedWords bool `json:"repeatedWords"` InconsistentTagContent bool `json:"inconsistentTagContent"` EmptyTagContent bool `json:"emptyTagContent"` XliffTags bool `json:"xliffTags"` NestedTags bool `json:"nestedTags"` ForbiddenTerms bool `json:"forbiddenTerms"` TargetLengthPercent TargetLengthPercent `json:"targetLengthPercent"` TargetLengthPerSegment bool `json:"targetLengthPerSegment"` NewerAtPrecedingWorkflowStep bool `json:"newerAtPrecedingWorkflowStep"` LeadingAndTrailingSpaces bool `json:"leadingAndTrailingSpaces"` IgnoreInAllWorkflowSteps bool `json:"ignoreInAllWorkflowSteps"` UnmodifiedFuzzyTranslation bool `json:"unmodifiedFuzzyTranslation"` UnmodifiedFuzzyTranslationTM bool `json:"unmodifiedFuzzyTranslationTM"` UnmodifiedFuzzyTranslationMTNT bool `json:"unmodifiedFuzzyTranslationMTNT"` ExtraNumbers bool `json:"extraNumbers"` TargetSourceIdentical bool `json:"targetSourceIdentical"` FuzzyInconsistency bool `json:"fuzzyInconsistency"` CustomQa bool `json:"customQa"` DoNotTranslate bool `json:"doNotTranslate"` }
type ResultFileRequest ¶
type ResultFileRequest struct { AsyncRequest *AsyncRequest `json:"asyncRequest"` Reference Reference `json:"reference"` }
type SecuritySettings ¶
type Settings ¶
type Settings struct {
SecuritySettings SecuritySettings `json:"securitySettings"`
}
type Status ¶
type Status string
const ( StatusAccepted Status = "ACCEPTED" StatusCancelled Status = "CANCELLED" StatusCompleted Status = "COMPLETED" StatusCompletedByLinguist Status = "COMPLETED_BY_LINGUIST" StatusDeclined Status = "DECLINED" StatusDelivered Status = "DELIVERED" StatusEmailed Status = "EMAILED" StatusNew Status = "NEW" StatusRejected Status = "REJECTED" )
func (Status) IsCompleted ¶
type TargetLength ¶
type TargetLengthPercent ¶
type UpdateSourceRequest ¶
type UpdateSourceRequest struct { Jobs []JobOnlyUID `json:"jobs"` PreTranslate bool `json:"preTranslate"` AllowAutomaticPostAnalysis bool `json:"allowAutomaticPostAnalysis"` CallbackURL string `json:"callbackUrl"` }
type WebhookEvent ¶
type WebhookEvent struct { JobParts []JobParts `json:"jobParts"` Metadata WebhookMetadata `json:"metadata"` Event string `json:"event"` Timestamp int `json:"timestamp"` EventUID string `json:"eventUid"` }
type WebhookMetadata ¶
type WebhookMetadata struct {
Project Project `json:"project"`
}
type WebhookPost ¶
Click to show internal directories.
Click to hide internal directories.