Documentation
¶
Index ¶
- Variables
- func JoinSlice[T any](s []T) string
- type AIFileTranslation
- type AIFileTranslationAttributes
- type AIFileTranslationError
- type AIFileTranslationRequest
- type AIFileTranslationResponse
- type AIPromtsListOptions
- type AIReport
- type AIReportAttributes
- type AIReportGenerateRequest
- type AIReportResponse
- type AIReportSchema
- type AIReportType
- type AIRequestLog
- type AIRequestLogResponse
- type AIRequestLogsExport
- type AIRequestLogsExportAttributes
- type AIRequestLogsExportRequest
- type AIRequestLogsExportResponse
- type AIRequestLogsListOptions
- type AIRequestLogsListResponse
- type AISettings
- type AISettingsResponse
- type AISnippet
- type AISnippetAddRequest
- type AISnippetResponse
- type AISnippetsListResponse
- type AITool
- type AIToolFunction
- type AITranslateStrings
- type AITranslateStringsRequest
- type AITranslateStringsResponse
- type AIUsageMember
- type AIUsageMemberResponse
- type AIUsageMembersListOptions
- type AIUsageMembersListResponse
- type AIUserCostLimitOverride
- type ARBFileFormatSettings
- type ActionRule
- type AddLanguageRequest
- type AdocFileFormatSettings
- type AdocFileImportOptions
- type AdvisorAIMode
- type AdvisorAIRun
- type AdvisorCheck
- type AdvisorCheckAttributes
- type AdvisorCheckCreateRequest
- type AdvisorCheckInspector
- type AdvisorCheckResponse
- type AdvisorInsight
- type AdvisorInsightMetric
- type AdvisorInsightOutcome
- type AdvisorInsightRecommendation
- type AdvisorInsightResponse
- type AdvisorInsightsListOptions
- type AdvisorInsightsListResponse
- type AdvisorInspectorOptions
- type Alignment
- type AllTasksListOptions
- type AndroidFileFormatSettings
- type ApplicationAdvisorInsightRequest
- type ApplicationBundle
- type ApplicationBundleUploadRequest
- type ApplicationConsent
- type ApplicationConsentAddRequest
- type ApplicationConsentResponse
- type ApplicationConsentStatus
- type ApplicationConsentsListOptions
- type ApplicationConsentsListResponse
- type ApplicationDataResponse
- type ApplicationDefaultPermissions
- type ApplicationKVRecord
- type ApplicationKVRecordAddRequest
- type ApplicationKVRecordResponse
- type ApplicationKVRecordsListOptions
- type ApplicationKVRecordsListResponse
- type ApplicationManifest
- type ApplicationManifestModule
- type Approval
- type ApprovalsGetResponse
- type ApprovalsListOptions
- type ApprovalsListResponse
- type AssetReference
- type AssetReferenceAddRequest
- type AssetReferenceListResponse
- type AssetReferenceResponse
- type AssignToScreenshotsRequest
- type AssignToStringsRequest
- type AutoTagRequest
- type BatchValidationError
- type BatchValidationErrorResponse
- type Branch
- type BranchMerge
- type BranchMergeSummary
- type BranchesAddRequest
- type BranchesCloneRequest
- type BranchesGetResponse
- type BranchesListOptions
- type BranchesListResponse
- type BranchesMergeRequest
- type BranchesMergeResponse
- type BranchesMergeSummaryResponse
- type BranchesSearchOptions
- type BuildAttributes
- type BuildError
- type BuildProjectDirectoryTranslation
- type BuildProjectDirectoryTranslationRequest
- type BuildProjectFileTranslationRequest
- type BuildProjectRequest
- type BuildProjectTranslationRequester
- type Bundle
- type BundleAddRequest
- type BundleExport
- type BundleExportAttributes
- type BundleExportRequest
- type BundleExportResponse
- type BundleResponse
- type BundlesListResponse
- type CSVFileFormatSettings
- type ChromeFileFormatSettings
- type ClearGlossaryOptions
- type Client
- type ClientResponse
- type ClientsListResponse
- type CommonFileFormatSettings
- type CommonFileImportOptions
- type Concept
- type ConceptLanguagesDetails
- type ConceptResponse
- type ConceptUpdateRequest
- type ConceptsListOptions
- type ConceptsListResponse
- type ConcordanceSearch
- type ConcordanceSearchConcept
- type ConcordanceSearchGlossary
- type ContributionRawDataSchema
- type ContributionStats
- type CostsEstimationPostEditingSchema
- type CreateProxyChatCompletionRequest
- type CrowdinTaskAssignee
- type CustomPlaceholder
- type CustomPlaceholderAddRequest
- type CustomPlaceholderResponse
- type CustomPlaceholdersListResponse
- type CustomSpellchecker
- type CustomSpellcheckerConfig
- type CustomSpellcheckerResponse
- type CustomSpellcheckersListResponse
- type DOCXFileExportOptions
- type DOCXFileImportOptions
- type DictionariesListOptions
- type DictionariesListResponse
- type Dictionary
- type DictionaryResponse
- type DirectoriesSearchOptions
- type Directory
- type DirectoryAddRequest
- type DirectoryGetResponse
- type DirectoryListOptions
- type DirectoryListResponse
- type Distribution
- type DistributionAddRequest
- type DistributionRelease
- type DistributionReleaseError
- type DistributionReleaseResponse
- type DistributionResponse
- type DistributionsListResponse
- type DitaFileFormatSettings
- type DocxFileFormatSettings
- type DownloadLink
- type DownloadLinkResponse
- type EditorIssuesSchema
- type EnterprisePendingTaskCreateForm
- type EnterpriseTaskCreateForm
- type EnterpriseVendorTaskCreateForm
- type Error
- type ErrorResponse
- type Event
- type ExportMode
- type ExportReportArchiveRequest
- type ExportTranslationRequest
- type ExternalQACheck
- type ExternalQACheckResponse
- type ExternalQAChecksListResponse
- type FJSFileFormatSettings
- type FMHTMLFileFormatSettings
- type FMMDFileFormatSettings
- type Field
- type FieldAddRequest
- type FieldConfig
- type FieldEntity
- type FieldLocation
- type FieldOption
- type FieldPlace
- type FieldResponse
- type FieldType
- type FieldsListOptions
- type FieldsListResponse
- type File
- type FileAddRequest
- type FileExportOptions
- type FileFormatSettings
- type FileGetResponse
- type FileImportOptions
- type FileListOptions
- type FileListResponse
- type FileRevision
- type FileRevisionListResponse
- type FileRevisionResponse
- type FileUpdateRestoreRequest
- type FilesSearchOptions
- type FineTuningDataset
- type FineTuningDatasetAttributes
- type FineTuningDatasetResponse
- type FineTuningEvent
- type FineTuningEventData
- type FineTuningEventsListResponse
- type FineTuningJob
- type FineTuningJobAttributes
- type FineTuningJobCreateRequest
- type FineTuningJobHyperparameters
- type FineTuningJobMetadata
- type FineTuningJobOptions
- type FineTuningJobResponse
- type FineTuningJobsListOptions
- type FineTuningJobsListResponse
- type GeneralFileExportOptions
- type GlossariesListOptions
- type GlossariesListResponse
- type Glossary
- type GlossaryAddRequest
- type GlossaryConcordanceSearchAllRequest
- type GlossaryConcordanceSearchRequest
- type GlossaryConcordanceSearchResponse
- type GlossaryExport
- type GlossaryExportRequest
- type GlossaryExportResponse
- type GlossaryImport
- type GlossaryImportRequest
- type GlossaryImportResponse
- type GlossaryResponse
- type GraphQLError
- type GraphQLErrorResponse
- type Group
- type GroupPreTranslateAccuracySchema
- type GroupQACheckIssuesSchema
- type GroupReportGenerateRequest
- type GroupSavingActivitySchema
- type GroupSourceContentUpdatesSchema
- type GroupTaskUsageSchema
- type GroupTimeSpentSchema
- type GroupTopMembersSchema
- type GroupTransactionCostsPostEditingSchema
- type GroupTranslationActivitySchema
- type GroupTranslatorAccuracySchema
- type GroupsAddRequest
- type GroupsGetResponse
- type GroupsListOptions
- type GroupsListResponse
- type GroupsTeam
- type GroupsTeamsData
- type GroupsTeamsDataEdit
- type HTMLFileFormatSettings
- type HTMLFileImportOptions
- type HTMLWithFrontMatterFileImportOptions
- type IDMLFileFormatSettings
- type IDMLFileImportOptions
- type InstallApplicationRequest
- type Installation
- type InstallationModule
- type InstallationReplaceValue
- type InstallationResponse
- type InstallationUpdate
- type InstallationUpdateApplyRequest
- type InstallationUpdateChange
- type InstallationUpdateResponse
- type InstallationsListOptions
- type InstallationsListResponse
- type IntegrationCrowdinFilesUpdateRequest
- type IntegrationFileProgressResponse
- type IntegrationFilesResponse
- type IntegrationFilesUpdateRequest
- type IntegrationJob
- type IntegrationJobResult
- type IntegrationJobResultResponse
- type IntegrationJobsResponse
- type IntegrationLoginField
- type IntegrationLoginFieldsResponse
- type IntegrationLoginRequest
- type IntegrationSettingsResponse
- type IntegrationSettingsUpdateRequest
- type IntegrationSyncProvider
- type IntegrationSyncSettingsResponse
- type IntegrationSyncSettingsUpdateRequest
- type InviteUserRequest
- type JSONFileFormatSettings
- type JavaScriptFileExportOptions
- type JavaScriptFileFormatSettings
- type Label
- type LabelAddRequest
- type LabelResponse
- type LabelsListOptions
- type LabelsListResponse
- type Language
- type LanguageAccess
- type LanguageMapping
- type LanguageRecognitionProvider
- type LanguageReport
- type LanguageReportFile
- type LanguageReportSkipped
- type LanguageReportSkippedQaCheckCategories
- type LanguageReportStatistics
- type LanguageServicePendingTaskCreateFormdeprecated
- type LanguageServiceTaskCreateFormdeprecated
- type LanguageTranslation
- type LanguageTranslationPlural
- type LanguageTranslationsListOptions
- type LanguageTranslationsListResponse
- type LanguagesAccess
- type LanguagesDetails
- type LanguagesGetResponse
- type LanguagesListResponse
- type ListOptions
- type LogEvent
- type MDFileExportOptions
- type MDFileFormatSettings
- type MDFileImportOptions
- type MDXV1FileFormatSettings
- type MDXV1FileImportOptions
- type MDXV2FileFormatSettings
- type MDXV2FileImportOptions
- type MIFFileFormatSettings
- type MTAddRequest
- type MTECredentials
- type MTListOptions
- type MTTranslation
- type MTTranslationResponse
- type MacOSFileFormatSettings
- type MachineTranslation
- type MachineTranslationsListResponse
- type MachineTranslationsResponse
- type MadCapFLSNPFileFormatSettings
- type Manager
- type ManagerGetResponse
- type ManagerListOptions
- type ManagerResponse
- type MediaWikiFileFormatSettings
- type Module
- type NodeDeleteJob
- type NodeDeleteJobAttributes
- type NodeDeleteJobError
- type NodeDeleteJobResponse
- type Notification
- type NotificationSettings
- type Organization
- type OrganizationAuthMethod
- type OrganizationAuthSettings
- type OrganizationAuthSettingsResponse
- type OrganizationDefault
- type OrganizationInfo
- type OrganizationInfoResponse
- type OrganizationPlan
- type OtherFileFormatSettings
- type OtherFileImportOptions
- type OtherLanguageTranslations
- type Pagination
- type PaginationResponse
- type PatchOp
- type PendingTaskCreateForm
- type Permission
- type PermissionValue
- type PreTranslateAccuracySchema
- type PreTranslateEfficiencySchema
- type PreTranslation
- type PreTranslationAttributes
- type PreTranslationReport
- type PreTranslationReportResponse
- type PreTranslationRequest
- type PreTranslationScope
- type PreTranslationsListOptions
- type PreTranslationsListResponse
- type PreTranslationsResponse
- type Project
- type ProjectAISettings
- type ProjectAISettingsResponse
- type ProjectAiPreTranslate
- type ProjectAiPrompt
- type ProjectMTPreTranslate
- type ProjectMTs
- type ProjectMember
- type ProjectMemberAddRequest
- type ProjectMemberAddResponse
- type ProjectMemberReplaceRequest
- type ProjectMemberResponse
- type ProjectMembersListOptions
- type ProjectMembersListResponse
- type ProjectMembersSchema
- type ProjectPermission
- type ProjectPlaceholder
- type ProjectPlaceholderAddRequest
- type ProjectPlaceholderResponse
- type ProjectPlaceholderType
- type ProjectPlaceholdersListResponse
- type ProjectProgressListOptions
- type ProjectSystemPlaceholder
- type ProjectSystemPlaceholderResponse
- type ProjectSystemPlaceholdersListResponse
- type ProjectTMPenalties
- type ProjectTMPreTranslate
- type ProjectTeam
- type ProjectTeamAddRequest
- type ProjectTeamAddResponse
- type ProjectsAddFileFormatSettingsRequest
- type ProjectsAddRequest
- type ProjectsFileFormatSettings
- type ProjectsFileFormatSettingsListResponse
- type ProjectsFileFormatSettingsResponse
- type ProjectsGetResponse
- type ProjectsListOptions
- type ProjectsListResponse
- type ProjectsStringsExporterSettings
- type ProjectsStringsExporterSettingsListResponse
- type ProjectsStringsExporterSettingsRequest
- type ProjectsStringsExporterSettingsResponse
- type Prompt
- type PromptAction
- type PromptAddRequest
- type PromptCloneRequest
- type PromptCompletion
- type PromptCompletionAttributes
- type PromptCompletionOverridePromptValues
- type PromptCompletionRequest
- type PromptCompletionResources
- type PromptCompletionResponse
- type PromptCompletionTool
- type PromptConfig
- type PromptMode
- type PromptResponse
- type PromptsListResponse
- type PropertyFileExportOptions
- type PropertyFileFormatSettings
- type Provider
- type ProviderAddRequest
- type ProviderConfig
- type ProviderModel
- type ProviderModelResponse
- type ProviderModelsListResponse
- type ProviderResponse
- type ProviderType
- type ProvidersListResponse
- type ProxyChatCompletion
- type ProxyChatCompletionResponse
- type PseudoBuildProjectRequest
- type QACheck
- type QACheckIssuesSchema
- type QACheckListOptions
- type QACheckRevalidation
- type QACheckRevalidationAttributes
- type QACheckRevalidationRequest
- type QACheckRevalidationResponse
- type QACheckValidateRequest
- type QACheckValidation
- type QACheckValidationsResponse
- type QAChecksResponse
- type QAChecksStatus
- type ReactIntlFileFormatSettings
- type ReplaceTagsRequest
- type ReplaceTranslationsOption
- type ReportArchive
- type ReportArchiveListResponse
- type ReportArchiveResponse
- type ReportArchivesListOptions
- type ReportBaseRates
- type ReportFormat
- type ReportGenerateRequest
- type ReportGroupSchema
- type ReportIndividualRates
- type ReportMode
- type ReportName
- type ReportNetRateSchemeMatch
- type ReportNetRateSchemes
- type ReportSchema
- type ReportScopeType
- type ReportSettingsTemplate
- type ReportSettingsTemplateAddRequest
- type ReportSettingsTemplateConfig
- type ReportSettingsTemplateListResponse
- type ReportSettingsTemplateResponse
- type ReportSettingsTemplatesListOptions
- type ReportStatus
- type ReportStatusAttributes
- type ReportStatusResponse
- type ReportUnit
- type ReviewedBuild
- type ReviewedBuildListOptions
- type ReviewedBuildListResponse
- type ReviewedBuildRequest
- type ReviewedBuildResponse
- type RevisionInfo
- type Role
- type RolePermissions
- type SavingActivitySchema
- type Screenshot
- type ScreenshotAddRequest
- type ScreenshotListOptions
- type ScreenshotListResponse
- type ScreenshotResponse
- type ScreenshotUpdateRequest
- type SearchTranslation
- type SearchTranslationResponse
- type SearchTranslationsListOptions
- type SearchTranslationsListResponse
- type SecurityLog
- type SecurityLogResponse
- type SecurityLogsListOptions
- type SecurityLogsListResponse
- type ShortUser
- type SourceContentUpdatesSchema
- type SourceString
- type SourceStringsAddRequest
- type SourceStringsEditOptions
- type SourceStringsGetOptions
- type SourceStringsGetResponse
- type SourceStringsImportOptions
- type SourceStringsListOptions
- type SourceStringsListResponse
- type SourceStringsSearchOptions
- type SourceStringsUpload
- type SourceStringsUploadRequest
- type SourceStringsUploadResponse
- type SpreadsheetFileImportOptions
- type Storage
- type StorageGetResponse
- type StorageListResponse
- type String
- type StringCatalogFileFormatSettings
- type StringCatalogFileImportOptions
- type StringComment
- type StringCommentAttachment
- type StringCommentAttachmentRequest
- type StringCommentFile
- type StringCommentsAddRequest
- type StringCommentsListOptions
- type StringCommentsListResponse
- type StringCommentsResponse
- type StringCorrection
- type StringCorrectionAddRequest
- type StringCorrectionResponse
- type StringCorrectionsListOptions
- type StringCorrectionsListResponse
- type StringTranslationsListOptions
- type StringsExporterSettings
- type StyleGuide
- type StyleGuideCreateRequest
- type StyleGuideResponse
- type StyleGuidesListOptions
- type StyleGuidesListResponse
- type SupportedModel
- type SupportedModelFeatures
- type SupportedModelModalities
- type SupportedModelModality
- type SupportedModelPrice
- type SupportedModelResponse
- type SupportedModelsListOptions
- type SupportedModelsListResponse
- type TMConcordanceSearch
- type TMConcordanceSearchAllRequest
- type TMConcordanceSearchRequest
- type TMConcordanceSearchResponse
- type TMExportFormat
- type TMSegment
- type TMSegmentCreateRecord
- type TMSegmentCreateRequest
- type TMSegmentRecord
- type TMSegmentResponse
- type TMSegmentsListOptions
- type TMSegmentsListResponse
- type TXTFileFormatSettings
- type Tag
- type TagAddRequest
- type TagListResponse
- type TagPosition
- type TagResponse
- type Task
- type TaskAddRequester
- type TaskAssignedTeam
- type TaskAssignee
- type TaskComment
- type TaskCommentAddRequest
- type TaskCommentResponse
- type TaskCommentsListResponse
- type TaskCost
- type TaskCreateForm
- type TaskProgress
- type TaskResponse
- type TaskSettingsTemplate
- type TaskSettingsTemplateAddRequest
- type TaskSettingsTemplateConfig
- type TaskSettingsTemplateLanguage
- type TaskSettingsTemplateResponse
- type TaskSettingsTemplatesListResponse
- type TaskStatus
- type TaskSyncScope
- type TaskType
- type TaskUsageSchema
- type TaskVendor
- type TasksListOptions
- type TasksListResponse
- type Team
- type TeamAddRequest
- type TeamMember
- type TeamMemberAddRequest
- type TeamMemberAddResponse
- type TeamMemberResponse
- type TeamMembersListResponse
- type TeamProjectPermissions
- type TeamProjectPermissionsListResponse
- type TeamProjectPermissionsResponse
- type TeamResponse
- type TeamsGetResponse
- type TeamsListOptions
- type TeamsListResponse
- type Term
- type TermAddRequest
- type TermResponse
- type TermsListOptions
- type TermsListResponse
- type TimeSpentSchema
- type TopMembersSchema
- type TransactionCostsPostEditingSchema
- type TranslateRequest
- type Translation
- type TranslationActivitySchema
- type TranslationAddRequest
- type TranslationAlignment
- type TranslationAlignmentRequest
- type TranslationAlignmentResponse
- type TranslationGetOptions
- type TranslationGetResponse
- type TranslationImport
- type TranslationImportAttributes
- type TranslationImportOptions
- type TranslationImportReport
- type TranslationImportReportItem
- type TranslationImportReportLanguage
- type TranslationImportReportResponse
- type TranslationImportReportSkipped
- type TranslationImportRequest
- type TranslationImportResponse
- type TranslationMemoriesListOptions
- type TranslationMemoriesListResponse
- type TranslationMemory
- type TranslationMemoryAddRequest
- type TranslationMemoryExport
- type TranslationMemoryExportRequest
- type TranslationMemoryExportResponse
- type TranslationMemoryImport
- type TranslationMemoryImportRequest
- type TranslationMemoryImportResponse
- type TranslationMemoryResponse
- type TranslationProgress
- type TranslationProgressResponse
- type TranslationsBuildsListOptions
- type TranslationsListResponse
- type TranslationsProjectBuild
- type TranslationsProjectBuildResponse
- type TranslationsProjectBuildsListResponse
- type TranslatorAccuracySchema
- type TranslatorRole
- type UpdateRequest
- type UploadTranslations
- type UploadTranslationsRequest
- type UploadTranslationsResponse
- type User
- type UserID
- type UserJoinDetails
- type UserPermission
- type UserProjectContribution
- type UserProjectContributionResponse
- type UserProjectContributionsListResponse
- type UserProjectPermissions
- type UserProjectPermissionsListResponse
- type UserProjectPermissionsResponse
- type UserResponse
- type UserTasksListOptions
- type UsersListOptions
- type UsersListResponse
- type VDFFileFormatSettings
- type VDFFileImportOptions
- type VSDXFileImportOptions
- type ValidationError
- type ValidationErrorResponse
- type Vendor
- type VendorGengoTaskCreateFormdeprecated
- type VendorManualPendingTaskCreateFormdeprecated
- type VendorManualTaskCreateFormdeprecated
- type VendorOhtTaskCreateFormdeprecated
- type VendorResponse
- type VendorTaskCreateForm
- type VendorsListResponse
- type Vote
- type VoteAddRequest
- type VoteGetResponse
- type VoteType
- type VotesListOptions
- type VotesListResponse
- type WebXMLFileFormatSettings
- type WebXMLFileImportOptions
- type Webhook
- type WebhookAddRequest
- type WebhookContentType
- type WebhookResponse
- type WebhooksListResponse
- type WordAlignment
- type WorkflowStep
- type WorkflowStepResponse
- type WorkflowStepStringsListOptions
- type WorkflowStepsResponse
- type WorkflowTemplate
- type WorkflowTemplateResponse
- type WorkflowTemplateStep
- type WorkflowTemplateStepConfig
- type WorkflowTemplatesListOptions
- type WorkflowTemplatesListResponse
- type XLIFFFileFormatSettings
- type XLSXFileFormatSettings
- type XMLFileFormatSettings
- type XMLFileImportOptions
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilRequest is returned when a request for a validation is nil. ErrNilRequest = errors.New("request cannot be nil") )
Functions ¶
Types ¶
type AIFileTranslation ¶ added in v0.19.0
type AIFileTranslation struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *AIFileTranslationAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt,omitempty"`
StartedAt *string `json:"startedAt,omitempty"`
FinishedAt *string `json:"finishedAt,omitempty"`
}
AIFileTranslation represents an AI file translation job.
type AIFileTranslationAttributes ¶ added in v0.19.0
type AIFileTranslationAttributes struct {
// Current stage (start, import, translate, export, done).
Stage string `json:"stage"`
Error *AIFileTranslationError `json:"error,omitempty"`
DownloadName *string `json:"downloadName,omitempty"`
// Source language code. If not passed in the request, it is resolved
// after the file is parsed.
SourceLanguageID *string `json:"sourceLanguageId,omitempty"`
TargetLanguageID string `json:"targetLanguageId"`
OriginalFileName string `json:"originalFileName"`
// Detected base file type.
DetectedType *string `json:"detectedType,omitempty"`
// Parser version for the detected file type.
ParserVersion *int `json:"parserVersion,omitempty"`
}
AIFileTranslationAttributes represents the attributes of an AI file translation job.
type AIFileTranslationError ¶ added in v0.19.0
AIFileTranslationError represents an error of an AI file translation job.
type AIFileTranslationRequest ¶ added in v0.19.0
type AIFileTranslationRequest struct {
// Storage identifier of the file to translate.
StorageID int `json:"storageId"`
// Source language identifier. If not specified, auto-detection is used.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Target language identifier.
TargetLanguageID string `json:"targetLanguageId"`
// File type. Default: auto.
Type string `json:"type,omitempty"`
// Parser version. Note: Must be used together with `type`.
ParserVersion int `json:"parserVersion,omitempty"`
// Translation memory identifiers.
TMIDs []int `json:"tmIds,omitempty"`
// Glossary identifiers.
GlossaryIDs []int `json:"glossaryIds,omitempty"`
// Style guide identifiers.
StyleGuideIDs []int `json:"styleGuideIds,omitempty"`
// Pre-translation prompt identifier.
// Note: Can't be used with `aiProviderId` or `aiModelId`.
AIPromptID int `json:"aiPromptId,omitempty"`
// AI provider identifier. Note: Must be used together with `aiModelId`.
AIProviderID int `json:"aiProviderId,omitempty"`
// AI model identifier. Note: Must be used together with `aiProviderId`.
AIModelID string `json:"aiModelId,omitempty"`
// Custom instructions for translation.
Instructions []string `json:"instructions,omitempty"`
// Storage identifiers of images to pass to AI as attachments (max 10).
AttachmentIDs []int `json:"attachmentIds,omitempty"`
}
AIFileTranslationRequest defines the structure of a request to translate a file with AI.
func (*AIFileTranslationRequest) Validate ¶ added in v0.19.0
func (r *AIFileTranslationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AIFileTranslationResponse ¶ added in v0.19.0
type AIFileTranslationResponse struct {
Data *AIFileTranslation `json:"data"`
}
AIFileTranslationResponse defines the structure of a response when getting an AI file translation job.
type AIPromtsListOptions ¶ added in v0.5.0
type AIPromtsListOptions struct {
// Allows to filter the prompts available for the specific action.
ProjectID int `json:"projectId,omitempty"`
// Allows to filter the prompts available for the specific action.
// Enum: pre_translate, qa_check, alignment (Enterprise only).
Action PromptAction `json:"action,omitempty"`
ListOptions
}
AIPromtsListOptions specifies the optional parameters to the AIService.ListPrompts method.
type AIReport ¶ added in v0.19.0
type AIReport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *AIReportAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
ETA string `json:"eta"`
}
AIReport represents an AI report generation job.
type AIReportAttributes ¶ added in v0.19.0
type AIReportAttributes struct {
Format string `json:"format"`
ReportType string `json:"reportType"`
Schema map[string]any `json:"schema"`
}
AIReportAttributes represents the attributes of an AI report.
type AIReportGenerateRequest ¶ added in v0.19.0
type AIReportGenerateRequest struct {
// Report type. Enum: tokens-usage-raw-data, costs-by-users.
Type AIReportType `json:"type"`
// Report schema.
Schema *AIReportSchema `json:"schema"`
}
AIReportGenerateRequest defines the structure of a request to generate an AI report.
func (*AIReportGenerateRequest) Validate ¶ added in v0.19.0
func (r *AIReportGenerateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AIReportResponse ¶ added in v0.19.0
type AIReportResponse struct {
Data *AIReport `json:"data"`
}
AIReportResponse defines the structure of a response when getting an AI report.
type AIReportSchema ¶ added in v0.19.0
type AIReportSchema struct {
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo"`
// Report file format. Enum: json, csv. Default: json.
Format string `json:"format,omitempty"`
// Count only usage from these projects.
ProjectIDs []int `json:"projectIds,omitempty"`
// Count only usage made through these AI prompts.
PromptIDs []int `json:"promptIds,omitempty"`
// Count only usage by these users.
UserIDs []int `json:"userIds,omitempty"`
}
AIReportSchema represents the schema of an AI report.
type AIReportType ¶ added in v0.19.0
type AIReportType string
AIReportType represents the type of an AI report.
const ( // AIReportUsageRawData is a report with one record per AI call. AIReportUsageRawData AIReportType = "tokens-usage-raw-data" // AIReportCostsByUsers is a report with AI spend per user. AIReportCostsByUsers AIReportType = "costs-by-users" )
type AIRequestLog ¶ added in v0.19.0
type AIRequestLog struct {
ID int `json:"id"`
RequestID string `json:"requestId"`
CreatedAt string `json:"createdAt"`
Status string `json:"status"`
HTTPStatus *int `json:"httpStatus,omitempty"`
Model string `json:"model"`
SourceAction string `json:"sourceAction"`
PromptAction *string `json:"promptAction,omitempty"`
SystemCredentials bool `json:"systemCredentials"`
IsAutoTriggered bool `json:"isAutoTriggered"`
DurationMs *int `json:"durationMs,omitempty"`
InputTokens *int `json:"inputTokens,omitempty"`
OutputTokens *int `json:"outputTokens,omitempty"`
TotalCost *float64 `json:"totalCost,omitempty"`
UserID *int `json:"userId,omitempty"`
ProjectID *int `json:"projectId,omitempty"`
PromptID *int `json:"promptId,omitempty"`
AIProviderID int `json:"aiProviderId"`
TokenName *string `json:"tokenName,omitempty"`
OAuthClientID *string `json:"oauthClientId,omitempty"`
OAuthClientName *string `json:"oauthClientName,omitempty"`
IP *string `json:"ip,omitempty"`
UserAgent *string `json:"userAgent,omitempty"`
Error *string `json:"error,omitempty"`
}
AIRequestLog represents an AI request log entry.
type AIRequestLogResponse ¶ added in v0.19.0
type AIRequestLogResponse struct {
Data *AIRequestLog `json:"data"`
}
AIRequestLogResponse defines the structure of a response when getting an AI request log entry.
type AIRequestLogsExport ¶ added in v0.19.0
type AIRequestLogsExport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *AIRequestLogsExportAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt *string `json:"startedAt,omitempty"`
FinishedAt *string `json:"finishedAt,omitempty"`
ETA *string `json:"eta,omitempty"`
}
AIRequestLogsExport represents an AI request logs export job.
type AIRequestLogsExportAttributes ¶ added in v0.19.0
type AIRequestLogsExportAttributes struct {
Format string `json:"format"`
Filters map[string]any `json:"filters"`
}
AIRequestLogsExportAttributes represents the attributes of an AI request logs export.
type AIRequestLogsExportRequest ¶ added in v0.19.0
type AIRequestLogsExportRequest struct {
// Format of the exported file. Enum: csv. Default: csv.
Format string `json:"format,omitempty"`
// Filter by request identifier.
RequestID string `json:"requestId,omitempty"`
// Filter by project.
ProjectID int `json:"projectId,omitempty"`
// Filter by the user attributed to the AI request.
UserID int `json:"userId,omitempty"`
// Filter by AI provider.
AIProviderID int `json:"aiProviderId,omitempty"`
// Filter by AI model.
Model string `json:"model,omitempty"`
// Filter by the feature or channel that produced the request.
SourceAction string `json:"sourceAction,omitempty"`
// Filter by prompt action.
PromptAction string `json:"promptAction,omitempty"`
// Filter by statuses. Enum: pending, success, error, timeout.
Statuses []string `json:"statuses,omitempty"`
// Filter by the name of the personal access token.
TokenName string `json:"tokenName,omitempty"`
// Filter by the OAuth application client_id.
OAuthClientID string `json:"oauthClientId,omitempty"`
// Export only requests that used system-provided credentials.
SystemCredentials *bool `json:"systemCredentials,omitempty"`
// Export only requests triggered automatically.
IsAutoTriggered *bool `json:"isAutoTriggered,omitempty"`
// Filter by requests logged after this date (ISO 8601).
CreatedAfter string `json:"createdAfter,omitempty"`
// Filter by requests logged before this date (ISO 8601).
CreatedBefore string `json:"createdBefore,omitempty"`
}
AIRequestLogsExportRequest defines the structure of a request to export AI request logs. All fields are optional; passing no filters exports every log entry.
func (*AIRequestLogsExportRequest) Validate ¶ added in v0.19.0
func (r *AIRequestLogsExportRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AIRequestLogsExportResponse ¶ added in v0.19.0
type AIRequestLogsExportResponse struct {
Data *AIRequestLogsExport `json:"data"`
}
AIRequestLogsExportResponse defines the structure of a response when getting an AI request logs export.
type AIRequestLogsListOptions ¶ added in v0.19.0
type AIRequestLogsListOptions struct {
// Filter by request identifier.
RequestID string `json:"requestId,omitempty"`
// Filter by project.
ProjectID int `json:"projectId,omitempty"`
// Filter by the user attributed to the AI request.
UserID int `json:"userId,omitempty"`
// Filter by AI provider.
AIProviderID int `json:"aiProviderId,omitempty"`
// Filter by model name.
Model string `json:"model,omitempty"`
// Filter by the feature or channel that produced the request.
// Enum: ai_gateway, ai_proxy, ai_translate_strings, ai_file_translate,
// ai_prompt_completion, pre_translate:manual, pre_translate:workflow,
// ai_alignment, qa_check, ai_suggestion, advisor.
SourceAction string `json:"sourceAction,omitempty"`
// Filter by prompt action.
PromptAction string `json:"promptAction,omitempty"`
// Filter by status. Enum: pending, success, error, timeout.
Statuses []string `json:"statuses,omitempty"`
// Filter by whether the request used system-provided credentials.
SystemCredentials *bool `json:"systemCredentials,omitempty"`
// Filter by whether the request was triggered automatically.
IsAutoTriggered *bool `json:"isAutoTriggered,omitempty"`
// Filter by the name of the personal access token.
TokenName string `json:"tokenName,omitempty"`
// Filter by the OAuth application client_id.
OAuthClientID string `json:"oauthClientId,omitempty"`
// Return logs created after this date (ISO 8601).
CreatedAfter string `json:"createdAfter,omitempty"`
// Return logs created before this date (ISO 8601).
CreatedBefore string `json:"createdBefore,omitempty"`
ListOptions
}
AIRequestLogsListOptions specifies the optional parameters to the AIService.ListRequestLogs method.
type AIRequestLogsListResponse ¶ added in v0.19.0
type AIRequestLogsListResponse struct {
Data []*AIRequestLogResponse `json:"data"`
}
AIRequestLogsListResponse defines the structure of a response when getting a list of AI request logs.
type AISettings ¶ added in v0.19.0
type AISettings struct {
PreTranslationAIPromptID int `json:"preTranslationAiPromptId"`
EditorSuggestionAIPromptID int `json:"editorSuggestionAiPromptId"`
QACheckActionAIPromptID *int `json:"qaCheckActionAiPromptId,omitempty"`
ContextReviewAIPromptID *int `json:"contextReviewAiPromptId,omitempty"`
// Alignment action AI prompt identifier (Enterprise only).
AlignmentActionAIPromptID *int `json:"alignmentActionAiPromptId,omitempty"`
// Maximum total AI cost the organization can spend per day.
DailyCostLimit *float64 `json:"dailyCostLimit,omitempty"`
// Maximum total AI cost the organization can spend per month.
MonthlyCostLimit *float64 `json:"monthlyCostLimit,omitempty"`
// Default maximum AI cost a single user can spend per day.
UserDailyCostLimit *float64 `json:"userDailyCostLimit,omitempty"`
// Default maximum AI cost a single user can spend per month.
UserMonthlyCostLimit *float64 `json:"userMonthlyCostLimit,omitempty"`
// Whether any AI cost limit is currently in force.
IsLimitingActive bool `json:"isLimitingActive"`
// Per-user cost limit overrides.
PerUserOverrides []*AIUserCostLimitOverride `json:"perUserOverrides"`
}
AISettings represents the AI settings.
type AISettingsResponse ¶ added in v0.19.0
type AISettingsResponse struct {
Data *AISettings `json:"data"`
}
AISettingsResponse defines the structure of a response when getting the AI settings.
type AISnippet ¶ added in v0.19.0
type AISnippet struct {
ID int `json:"id"`
Description string `json:"description"`
Placeholder string `json:"placeholder"`
Value string `json:"value"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
AISnippet represents an AI snippet.
type AISnippetAddRequest ¶ added in v0.19.0
type AISnippetAddRequest struct {
// Unique description, between 3 and 255 characters.
Description string `json:"description"`
// Unique placeholder, must start with `%custom:` and end with `%`.
Placeholder string `json:"placeholder"`
// The text that will be used in the prompt (max 4000 characters).
Value string `json:"value"`
}
AISnippetAddRequest defines the structure of a request to add an AI snippet.
func (*AISnippetAddRequest) Validate ¶ added in v0.19.0
func (r *AISnippetAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AISnippetResponse ¶ added in v0.19.0
type AISnippetResponse struct {
Data *AISnippet `json:"data"`
}
AISnippetResponse defines the structure of a response when getting an AI snippet.
type AISnippetsListResponse ¶ added in v0.19.0
type AISnippetsListResponse struct {
Data []*AISnippetResponse `json:"data"`
}
AISnippetsListResponse defines the structure of a response when getting a list of AI snippets.
type AITool ¶ added in v0.19.0
type AITool struct {
// The type of the tool. Currently, only `function` is supported.
Type string `json:"type"`
// The function definition.
Function *AIToolFunction `json:"function"`
}
AITool represents an AI tool.
type AIToolFunction ¶ added in v0.19.0
type AIToolFunction struct {
// A description of what the function does.
Description string `json:"description,omitempty"`
// The name of the function to be called.
Name string `json:"name"`
// The parameters the function accepts, described as a JSON Schema object.
Parameters map[string]any `json:"parameters,omitempty"`
}
AIToolFunction represents a function that can be called by the AI.
type AITranslateStrings ¶ added in v0.19.0
type AITranslateStrings struct {
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageID string `json:"targetLanguageId"`
Translations []string `json:"translations"`
}
AITranslateStrings represents the result of the AI strings translation.
type AITranslateStringsRequest ¶ added in v0.19.0
type AITranslateStringsRequest struct {
// Strings to translate (max 500 strings, each max 10000 characters).
Strings []string `json:"strings"`
// Source language identifier. If not specified, auto-detection is used.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Target language identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Translation memory identifiers.
TMIDs []int `json:"tmIds,omitempty"`
// Glossary identifiers.
GlossaryIDs []int `json:"glossaryIds,omitempty"`
// Style guide identifiers.
StyleGuideIDs []int `json:"styleGuideIds,omitempty"`
// Custom instructions for translation.
Instructions []string `json:"instructions,omitempty"`
// Storage identifiers of images to pass to AI as attachments (max 10).
AttachmentIDs []int `json:"attachmentIds,omitempty"`
// Pre-translation prompt identifier.
// Note: Required if `aiProviderId` and `aiModelId` are not provided.
AIPromptID int `json:"aiPromptId,omitempty"`
// AI provider identifier. Note: Must be used together with `aiModelId`.
AIProviderID int `json:"aiProviderId,omitempty"`
// AI model identifier. Note: Must be used together with `aiProviderId`.
AIModelID string `json:"aiModelId,omitempty"`
}
AITranslateStringsRequest defines the structure of a request to translate strings with AI.
func (*AITranslateStringsRequest) Validate ¶ added in v0.19.0
func (r *AITranslateStringsRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AITranslateStringsResponse ¶ added in v0.19.0
type AITranslateStringsResponse struct {
Data *AITranslateStrings `json:"data"`
}
AITranslateStringsResponse defines the structure of a response when translating strings with AI.
type AIUsageMember ¶ added in v0.19.0
type AIUsageMember struct {
// Organization member the usage and limits belong to.
User *ShortUser `json:"user"`
// Effective daily AI cost limit in USD. `nil` means no limit.
DailyCostLimit *float64 `json:"dailyCostLimit,omitempty"`
// AI cost spent in the current day, in USD.
DailyCostSpent float64 `json:"dailyCostSpent"`
// Date and time when the daily cost limit resets.
DailyResetAt string `json:"dailyResetAt"`
// Effective monthly AI cost limit in USD. `nil` means no limit.
MonthlyCostLimit *float64 `json:"monthlyCostLimit,omitempty"`
// AI cost spent in the current month, in USD.
MonthlyCostSpent float64 `json:"monthlyCostSpent"`
// Date and time when the monthly cost limit resets.
MonthlyResetAt string `json:"monthlyResetAt"`
}
AIUsageMember represents the AI usage and limits of an organization member.
type AIUsageMemberResponse ¶ added in v0.19.0
type AIUsageMemberResponse struct {
Data *AIUsageMember `json:"data"`
}
AIUsageMemberResponse defines the structure of a response when getting the AI usage of a member.
type AIUsageMembersListOptions ¶ added in v0.19.0
type AIUsageMembersListOptions struct {
// Filter by user identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Sort the collection by the specified field.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
AIUsageMembersListOptions specifies the optional parameters to the AIService.ListUsageMembers method.
type AIUsageMembersListResponse ¶ added in v0.19.0
type AIUsageMembersListResponse struct {
Data []*AIUsageMemberResponse `json:"data"`
}
AIUsageMembersListResponse defines the structure of a response when getting a list of AI usage members.
type AIUserCostLimitOverride ¶ added in v0.19.0
type AIUserCostLimitOverride struct {
UserID int `json:"userId"`
// Cost limit mode. Enum: custom, blocked, unlimited.
CostLimitMode string `json:"costLimitMode"`
DailyCostLimit *float64 `json:"dailyCostLimit,omitempty"`
MonthlyCostLimit *float64 `json:"monthlyCostLimit,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
AIUserCostLimitOverride represents a per-user AI cost limit override.
type ARBFileFormatSettings ¶
type ARBFileFormatSettings struct{ CommonFileFormatSettings }
type ActionRule ¶ added in v0.5.0
type ActionRule struct {
// Action name.
Action PromptAction `json:"action"`
// Available AI provider model ids.
AvailableAIModelIDs []string `json:"availableAiModelIds"`
}
ActionRule represents an action rule of an AI provider.
type AddLanguageRequest ¶
type AddLanguageRequest struct {
// Language name.
Name string `json:"name"`
// Custom language code.
Code string `json:"code"`
// Custom language locale code.
LocaleCode string `json:"localeCode"`
// Text direction in custom language. Enum: "ltr" "rtl".
// "ltr" - left-to-right
// "rtl" - right-to-left
TextDirection string `json:"textDirection"`
// Array with category names.
PluralCategoryNames []string `json:"pluralCategoryNames"`
// Custom language 3 letters code. Format: ISO 6393 code.
ThreeLettersCode string `json:"threeLettersCode"`
// Custom language 2 letters code. Format: ISO 6391 code.
TwoLettersCode string `json:"twoLettersCode"`
// Use if custom language is a dialect.
DialectOf string `json:"dialectOf"`
}
AddLanguageRequest defines the structure of a request to add a new custom language.
func (*AddLanguageRequest) Validate ¶
func (r *AddLanguageRequest) Validate() error
Validate checks if the add request is valid. It implements the RequestValidator interface.
type AdocFileFormatSettings ¶
type AdocFileFormatSettings struct {
CommonFileFormatSettings
// Skip Include Directives. Default: false.
ExcludeIncludeDirectives *bool `json:"excludeIncludeDirectives,omitempty"` // Default: false
}
type AdocFileImportOptions ¶
type AdocFileImportOptions struct {
// Skip Include Directives. Default: false.
ExcludeIncludeDirectives *bool `json:"excludeIncludeDirectives,omitempty"`
}
AdocFileImportOptions implements the FileImportOptions interface.
func (*AdocFileImportOptions) ValidateFileImportOptions ¶
func (o *AdocFileImportOptions) ValidateFileImportOptions() error
type AdvisorAIMode ¶ added in v0.19.0
type AdvisorAIMode string
AdvisorAIMode defines the AI validation mode of an advisor inspector.
const ( // AdvisorAIModeAuto lets the backend decide which items need AI validation. AdvisorAIModeAuto AdvisorAIMode = "auto" // AdvisorAIModeAll runs AI validation for all items. AdvisorAIModeAll AdvisorAIMode = "all" )
type AdvisorAIRun ¶ added in v0.19.0
type AdvisorAIRun struct {
Mode AdvisorAIMode `json:"mode"`
PromptID int `json:"promptId"`
At string `json:"at"`
}
AdvisorAIRun describes the most recent AI validation run for an insight.
type AdvisorCheck ¶ added in v0.19.0
type AdvisorCheck struct {
Identifier string `json:"identifier"`
// Status of the underlying job (e.g. created, in_progress, done, failed).
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *AdvisorCheckAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt *string `json:"startedAt"`
FinishedAt *string `json:"finishedAt"`
}
AdvisorCheck represents an advisor check job.
type AdvisorCheckAttributes ¶ added in v0.19.0
type AdvisorCheckAttributes struct {
Category *string `json:"category,omitempty"`
Inspectors []*AdvisorCheckInspector `json:"inspectors,omitempty"`
}
AdvisorCheckAttributes represents the scope of an advisor check. Absence of both fields means an all-inspector check.
type AdvisorCheckCreateRequest ¶ added in v0.19.0
type AdvisorCheckCreateRequest struct {
// Category to scope the check to. Mutually exclusive with `Inspectors`.
Category string `json:"category,omitempty"`
// List of inspectors to re-check. Mutually exclusive with `Category`.
Inspectors []*AdvisorCheckInspector `json:"inspectors,omitempty"`
}
AdvisorCheckCreateRequest defines the structure of a request to create an advisor check. At most one of `Category` or `Inspectors` may be set. If neither is set, every inspector is re-checked.
func (*AdvisorCheckCreateRequest) Validate ¶ added in v0.19.0
func (r *AdvisorCheckCreateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AdvisorCheckInspector ¶ added in v0.19.0
type AdvisorCheckInspector struct {
// Inspector key, e.g. string_context_relevance.
Key string `json:"key"`
// Per-inspector options. Currently only `string_context_relevance`
// supports AI options.
Options *AdvisorInspectorOptions `json:"options,omitempty"`
}
AdvisorCheckInspector represents an inspector to re-check.
type AdvisorCheckResponse ¶ added in v0.19.0
type AdvisorCheckResponse struct {
Data *AdvisorCheck `json:"data"`
}
AdvisorCheckResponse defines the structure of a response when creating or getting an advisor check.
type AdvisorInsight ¶ added in v0.19.0
type AdvisorInsight struct {
ID int `json:"id"`
InspectorKey string `json:"inspectorKey"`
// Category of the inspector. Nil if the inspector is no longer registered.
Category *string `json:"category"`
IsDismissed bool `json:"isDismissed"`
// Enum: pending, checking, outdated, done.
Status string `json:"status"`
// Outcome of the latest check. Nil if not yet checked.
Outcome *AdvisorInsightOutcome `json:"outcome"`
// Enum: high, medium, low. Nil if the inspector is no longer registered.
Severity *string `json:"severity"`
// Enum: hourly, daily. Nil if the inspector is no longer registered.
RefreshPolicy *string `json:"refreshPolicy"`
Metrics []*AdvisorInsightMetric `json:"metrics"`
Recommendations []*AdvisorInsightRecommendation `json:"recommendations"`
// Date when the last check was performed.
CheckedAt *string `json:"checkedAt"`
// The most recent AI validation run for the insight.
LastAIRun *AdvisorAIRun `json:"lastAiRun"`
// Data attached to the insight by the originating `advisor-inspector` app.
Payload map[string]any `json:"payload"`
}
AdvisorInsight represents an advisor insight.
type AdvisorInsightMetric ¶ added in v0.19.0
type AdvisorInsightMetric struct {
Key string `json:"key"`
Value float64 `json:"value"`
// Enum: percent, count.
Unit string `json:"unit,omitempty"`
Threshold *float64 `json:"threshold,omitempty"`
// Enum: default, success, danger.
Tone string `json:"tone,omitempty"`
// What produced the metric. Enum: deterministic, ai, app.
Source string `json:"source,omitempty"`
// Date when the metric was measured.
CheckedAt *string `json:"checkedAt,omitempty"`
}
AdvisorInsightMetric represents a structured metric of an advisor insight.
type AdvisorInsightOutcome ¶ added in v0.19.0
type AdvisorInsightOutcome string
AdvisorInsightOutcome defines the outcome of an advisor insight check.
const ( // AdvisorInsightOutcomeFlagged means an issue was detected. AdvisorInsightOutcomeFlagged AdvisorInsightOutcome = "flagged" // AdvisorInsightOutcomeClear means the project is on target. AdvisorInsightOutcomeClear AdvisorInsightOutcome = "clear" // AdvisorInsightOutcomeNotApplicable means the inspector does not apply to the project. AdvisorInsightOutcomeNotApplicable AdvisorInsightOutcome = "not_applicable" )
type AdvisorInsightRecommendation ¶ added in v0.19.0
type AdvisorInsightRecommendation struct {
ID string `json:"id"`
Primary bool `json:"primary"`
// Parameters provided alongside the recommendation (e.g. `projectId`).
Params map[string]any `json:"params,omitempty"`
}
AdvisorInsightRecommendation represents an actionable recommendation of an advisor insight.
type AdvisorInsightResponse ¶ added in v0.19.0
type AdvisorInsightResponse struct {
Data *AdvisorInsight `json:"data"`
}
AdvisorInsightResponse defines the structure of a response when getting an advisor insight.
type AdvisorInsightsListOptions ¶ added in v0.19.0
type AdvisorInsightsListOptions struct {
// Filter insights by dismissal flag. Nil returns both dismissed
// and active insights.
IsDismissed *bool `json:"isDismissed,omitempty"`
// Filter insights by status. Enum: pending, checking, outdated, done.
Status []string `json:"status,omitempty"`
// Filter insights by outcome. If empty, all checked insights are
// returned (never-checked ones are excluded).
Outcome []AdvisorInsightOutcome `json:"outcome,omitempty"`
ListOptions
}
AdvisorInsightsListOptions specifies the optional parameters to the AdvisorsService.ListInsights method.
type AdvisorInsightsListResponse ¶ added in v0.19.0
type AdvisorInsightsListResponse struct {
Data []*AdvisorInsightResponse `json:"data"`
}
AdvisorInsightsListResponse defines the structure of a response when getting a list of advisor insights.
type AdvisorInspectorOptions ¶ added in v0.19.0
type AdvisorInspectorOptions struct {
// AI validation mode. Enum: auto, all.
Mode AdvisorAIMode `json:"mode,omitempty"`
// AI prompt identifier.
PromptID int `json:"promptId,omitempty"`
}
AdvisorInspectorOptions represents per-inspector AI options.
type Alignment ¶
type Alignment struct {
SourceWord string `json:"sourceWord"`
SourceLemma string `json:"sourceLemma"`
TargetWord string `json:"targetWord"`
TargetLemma string `json:"targetLemma"`
Match int `json:"match"`
Probability int `json:"probability"`
}
Alignment represents a word alignment.
type AllTasksListOptions ¶ added in v0.19.0
type AllTasksListOptions struct {
// Sort a list of tasks by a specified field.
// Example: orderBy=createdAt desc,title.
OrderBy string `json:"orderBy,omitempty"`
// List tasks with specified statuses. It can be one status
// or a list of status values.
// Enum: todo, in_progress, done, closed.
Status []TaskStatus `json:"status,omitempty"`
// Filter by task type. It can be one type or a list of type values.
// Enum: 0 - translate, 1 - proofread, 2 - translate by vendor,
// 3 - proofread by vendor.
Type []TaskType `json:"type,omitempty"`
// Filter by project IDs.
// Cannot be used together with GroupIDs.
ProjectIDs []int `json:"projectIds,omitempty"`
// Filter by group IDs.
// Cannot be used together with ProjectIDs. Enterprise only.
GroupIDs []int `json:"groupIds,omitempty"`
// Filter by assignee user IDs.
AssigneeIDs []int `json:"assigneeIds,omitempty"`
// Filter by creator user IDs.
CreatorIDs []int `json:"creatorIds,omitempty"`
// Filter by target language IDs.
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
// Filter by source language IDs.
SourceLanguageIDs []string `json:"sourceLanguageIds,omitempty"`
// Filter tasks created from this date (ISO 8601).
CreatedAtFrom string `json:"createdAtFrom,omitempty"`
// Filter tasks created until this date (ISO 8601).
CreatedAtTo string `json:"createdAtTo,omitempty"`
// Filter tasks with deadline from this date (ISO 8601).
DeadlineFrom string `json:"deadlineFrom,omitempty"`
// Filter tasks with deadline until this date (ISO 8601).
DeadlineTo string `json:"deadlineTo,omitempty"`
ListOptions
}
AllTasksListOptions specifies the optional parameters to the TasksService.ListAll method.
type AndroidFileFormatSettings ¶
type AndroidFileFormatSettings struct{ CommonFileFormatSettings }
type ApplicationAdvisorInsightRequest ¶ added in v0.19.0
type ApplicationAdvisorInsightRequest struct {
// Result of the app's check. Enum: flagged, clear, not_applicable.
Outcome AdvisorInsightOutcome `json:"outcome"`
// Date when the app performed the check (ISO 8601).
// Defaults to the time the request is received.
CheckedAt string `json:"checkedAt,omitempty"`
// Structured metrics produced by the app (max 100).
Metrics []*AdvisorInsightMetric `json:"metrics,omitempty"`
// Actionable recommendations to surface for the insight (max 20).
Recommendations []*AdvisorInsightRecommendation `json:"recommendations,omitempty"`
// Free-form data to keep attached to the insight.
Payload map[string]any `json:"payload,omitempty"`
}
ApplicationAdvisorInsightRequest defines the structure of a request to create or update an application advisor insight.
func (*ApplicationAdvisorInsightRequest) Validate ¶ added in v0.19.0
func (r *ApplicationAdvisorInsightRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ApplicationBundle ¶ added in v0.19.0
type ApplicationBundle struct {
// Mode enum: internal, external.
Mode string `json:"mode"`
// URL the app is served from. Required for the `external` mode.
URL string `json:"url,omitempty"`
}
ApplicationBundle describes where the app is loaded from. Either Crowdin hosts the app in its own storage (`internal`) or the app is served from an external URL (`external`).
type ApplicationBundleUploadRequest ¶ added in v0.19.0
type ApplicationBundleUploadRequest struct {
// Storage Identifier. The storage file must be a ZIP archive
// containing the application bundle.
StorageID int `json:"storageId"`
}
ApplicationBundleUploadRequest defines the structure of the request to upload a bundle archive for a serverless app.
func (*ApplicationBundleUploadRequest) Validate ¶ added in v0.19.0
func (r *ApplicationBundleUploadRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ApplicationConsent ¶ added in v0.19.0
type ApplicationConsent struct {
ID int `json:"id"`
// The user who installed the application the decision applies to.
InstalledBy *ShortUser `json:"installedBy"`
// Application identifier the decision applies to.
Identifier string `json:"identifier"`
// Name of the application. Nil when the application is no longer installed.
Name *string `json:"name"`
// Whether the application may act on behalf of the current user.
Status ApplicationConsentStatus `json:"status"`
// Scopes the decision was made for.
Scopes []string `json:"scopes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
ApplicationConsent represents the current user's decision on whether an application may act on their behalf.
type ApplicationConsentAddRequest ¶ added in v0.19.0
type ApplicationConsentAddRequest struct {
// Application identifier the decision applies to.
Identifier string `json:"identifier"`
// Identifier of the user who installed the application.
InstalledBy int `json:"installedBy"`
// The decision. Enum: granted, denied.
Status ApplicationConsentStatus `json:"status"`
// Scopes the decision was made for.
Scopes []string `json:"scopes,omitempty"`
}
ApplicationConsentAddRequest defines the structure of the request to record the current user's consent decision for an application.
func (*ApplicationConsentAddRequest) Validate ¶ added in v0.19.0
func (r *ApplicationConsentAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ApplicationConsentResponse ¶ added in v0.19.0
type ApplicationConsentResponse struct {
Data *ApplicationConsent `json:"data"`
}
ApplicationConsentResponse defines the structure of the response when getting an application consent decision.
type ApplicationConsentStatus ¶ added in v0.19.0
type ApplicationConsentStatus string
ApplicationConsentStatus represents the status of an application consent decision.
const ( // ApplicationConsentGranted means the application may act on behalf of the user. ApplicationConsentGranted ApplicationConsentStatus = "granted" // ApplicationConsentDenied means the application may not act on behalf of the user. ApplicationConsentDenied ApplicationConsentStatus = "denied" )
type ApplicationConsentsListOptions ¶ added in v0.19.0
type ApplicationConsentsListOptions struct {
// Filter by application identifier.
Identifier string `json:"identifier,omitempty"`
// Sort consent decisions by the specified fields.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
ApplicationConsentsListOptions specifies the optional parameters to the ApplicationsService.ListConsents method.
type ApplicationConsentsListResponse ¶ added in v0.19.0
type ApplicationConsentsListResponse struct {
Data []*ApplicationConsentResponse `json:"data"`
}
ApplicationConsentsListResponse defines the structure of the response when getting a list of application consent decisions.
type ApplicationDataResponse ¶ added in v0.5.0
type ApplicationDataResponse struct {
Data any `json:"data"`
}
ApplicationDataResponse defines the structure of the response with application data. The data field can contain any application-specific data.
type ApplicationDefaultPermissions ¶ added in v0.19.0
type ApplicationDefaultPermissions struct {
// Which users the app is available to by default.
// Enum: owner, managers, all, guests.
User PermissionValue `json:"user,omitempty"`
// Which projects the app is available in by default.
// Enum: own, restricted.
Project PermissionValue `json:"project,omitempty"`
}
ApplicationDefaultPermissions defines the default permissions of an application.
type ApplicationKVRecord ¶ added in v0.19.0
type ApplicationKVRecord struct {
// Key of the record.
Key string `json:"key"`
// Value of the record. Any JSON value except null.
Value any `json:"value"`
// If true, the value is encrypted at rest.
Secret bool `json:"secret"`
// Date the record was created, in ISO 8601 format.
CreatedAt string `json:"createdAt"`
// Date the record was last updated, in ISO 8601 format.
UpdatedAt string `json:"updatedAt"`
// Date the record expires, in ISO 8601 format. Nil for permanent records.
ExpiresAt *string `json:"expiresAt"`
}
ApplicationKVRecord represents a key-value record in the storage of an installed application.
type ApplicationKVRecordAddRequest ¶ added in v0.19.0
type ApplicationKVRecordAddRequest struct {
// Key of the record. 1-500 characters from `a-z`, `A-Z`, `0-9`, `:`, `.`, `_`, `-`.
// Reserved prefixes `user:{userId}:` and `module:{moduleKey}:` narrow visibility.
Key string `json:"key"`
// Value of the record. Any JSON value except null.
Value any `json:"value"`
// If true, the value is encrypted at rest. Immutable. Default is false.
Secret *bool `json:"secret,omitempty"`
// Time to live in seconds (60-31536000). Omit for a permanent record.
TTL int `json:"ttl,omitempty"`
}
ApplicationKVRecordAddRequest defines the structure of the request to add a new KV record to the application installation's storage.
func (*ApplicationKVRecordAddRequest) Validate ¶ added in v0.19.0
func (r *ApplicationKVRecordAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ApplicationKVRecordResponse ¶ added in v0.19.0
type ApplicationKVRecordResponse struct {
Data *ApplicationKVRecord `json:"data"`
}
ApplicationKVRecordResponse defines the structure of the response when getting an application KV record.
type ApplicationKVRecordsListOptions ¶ added in v0.19.0
type ApplicationKVRecordsListOptions struct {
// Filter results to keys that start with the given prefix.
Prefix string `json:"prefix,omitempty"`
// Sort records by the specified fields.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
ApplicationKVRecordsListOptions specifies the optional parameters to the ApplicationsService.ListKVRecords method.
type ApplicationKVRecordsListResponse ¶ added in v0.19.0
type ApplicationKVRecordsListResponse struct {
Data []*ApplicationKVRecordResponse `json:"data"`
}
ApplicationKVRecordsListResponse defines the structure of the response when getting a list of application KV records.
type ApplicationManifest ¶ added in v0.19.0
type ApplicationManifest struct {
// Display name of the application.
Name string `json:"name"`
// Short description of what the application does.
Description string `json:"description,omitempty"`
// Relative URL (within the application bundle) of the application logo.
Logo string `json:"logo,omitempty"`
// OAuth scopes granted to the app for host-proxied Crowdin API calls.
Scopes []string `json:"scopes,omitempty"`
// Whether the app is offered in string-based projects.
StringBasedAvailable *bool `json:"stringBasedAvailable,omitempty"`
// UI module definitions: keys are UI module types (e.g. `editor-right-panel`)
// and values are arrays of module definitions.
Modules map[string][]*ApplicationManifestModule `json:"modules"`
// Default permissions of the application.
DefaultPermissions *ApplicationDefaultPermissions `json:"default_permissions,omitempty"`
// Where the app is loaded from.
Bundle *ApplicationBundle `json:"bundle,omitempty"`
}
ApplicationManifest defines the inline manifest content used to install an application.
type ApplicationManifestModule ¶ added in v0.19.0
type ApplicationManifestModule struct {
// Unique module key within the app.
Key string `json:"key"`
// Display name of the module.
Name string `json:"name"`
// Relative URL (within the application bundle) of the module logo.
Logo string `json:"logo,omitempty"`
// Short description of the module.
Description string `json:"description,omitempty"`
// Crowdin editions the module is enabled in.
// Enum: crowdin, crowdin-enterprise.
Environments []string `json:"environments,omitempty"`
// Module permissions.
Permissions *UserPermission `json:"permissions,omitempty"`
}
ApplicationManifestModule defines a UI module definition of an inline manifest.
type Approval ¶
type Approval struct {
ID int `json:"id"`
User *ShortUser `json:"user"`
TranslationID int `json:"translationId"`
StringID int `json:"stringId"`
LanguageID string `json:"languageId"`
CreatedAt string `json:"createdAt"`
// File Identifier. Present for asset approvals.
FileID int `json:"fileId,omitempty"`
// Correction Identifier. Present for correction approvals (Crowdin Enterprise only).
CorrectionID int `json:"correctionId,omitempty"`
// Workflow Step Identifier (Crowdin Enterprise only).
WorkflowStepID int `json:"workflowStepId,omitempty"`
}
Approval represents a Crowdin translation approval.
type ApprovalsGetResponse ¶
type ApprovalsGetResponse struct {
Data *Approval `json:"data"`
}
ApprovalsGetResponse defines the structure of the response when getting a single translation approval.
type ApprovalsListOptions ¶
type ApprovalsListOptions struct {
// Sort a list of approvals.
// Enum: id, createdAt. Default: id.
// Example: orderBy=createdAt desc,id.
OrderBy string `json:"orderBy,omitempty"`
// File Identifier.
// Note: Must be used together with `languageId`.
FileID int `json:"fileId,omitempty"`
// Label Identifiers.
// Example: labelIds=1,2,3,4,5
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude Label Identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// String Identifier.
// Note: Must be used together with `languageId`.
StringID int `json:"stringId,omitempty"`
// Language Identifier.
// Note: Must be used together with `stringId` or `fileId`.
LanguageID string `json:"languageId,omitempty"`
// Translation Identifier.
// Note: If specified, `fileId`, `stringId` and `languageId` are ignored.
TranslationID int `json:"translationId,omitempty"`
// Correction Identifier.
// Note: Can't be used with `translationId`, `languageId`, `stringId` or `fileId`.
// Available only for Crowdin Enterprise projects with advanced workflow.
CorrectionID int `json:"correctionId,omitempty"`
ListOptions
}
ApprovalsListOptions specifies the optional parameters to the StringTranslationsService.ListApprovals method.
type ApprovalsListResponse ¶
type ApprovalsListResponse struct {
Data []*ApprovalsGetResponse `json:"data"`
}
ApprovalsListResponse defines the structure of the response when getting a list of translation approvals.
type AssetReference ¶ added in v0.19.0
type AssetReference struct {
ID int `json:"id"`
Name string `json:"name"`
URL string `json:"url"`
User *ShortUser `json:"user"`
CreatedAt string `json:"createdAt"`
// MIME type of the reference file.
MimeType string `json:"mimeType"`
}
AssetReference represents a reference file attached to an asset file.
type AssetReferenceAddRequest ¶ added in v0.19.0
type AssetReferenceAddRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// Reference file name.
Name string `json:"name"`
}
AssetReferenceAddRequest defines the structure of a request to add an asset reference.
func (*AssetReferenceAddRequest) Validate ¶ added in v0.19.0
func (r *AssetReferenceAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AssetReferenceListResponse ¶ added in v0.19.0
type AssetReferenceListResponse struct {
Data []*AssetReferenceResponse `json:"data"`
}
AssetReferenceListResponse describes a response with a list of asset references.
type AssetReferenceResponse ¶ added in v0.19.0
type AssetReferenceResponse struct {
Data *AssetReference `json:"data"`
}
AssetReferenceResponse describes a response with a single asset reference.
type AssignToScreenshotsRequest ¶ added in v0.2.0
type AssignToScreenshotsRequest struct {
// Screenshot identifiers.
// Note: You can assign up to 500 screenshots at a time.
ScreenshotIDs []int `json:"screenshotIds"`
}
AssignToScreenshotsRequest defines the structure of a request to assign label to screenshots.
func (*AssignToScreenshotsRequest) Validate ¶ added in v0.2.0
func (r *AssignToScreenshotsRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AssignToStringsRequest ¶ added in v0.2.0
type AssignToStringsRequest struct {
// String identifiers.
// Note: You can assign up to 500 strings at a time.
StringIDs []int `json:"stringIds"`
}
AssignToStringsRequest defines the structure of a request to assign label to strings.
func (*AssignToStringsRequest) Validate ¶ added in v0.2.0
func (r *AssignToStringsRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type AutoTagRequest ¶ added in v0.2.0
type AutoTagRequest struct {
// Automatically tags screenshot and replaces old tags with new ones.
AutoTag *bool `json:"autoTag"`
// File Identifier. Note: Can't be used with `directoryId` or `branchId`
// in same request.
FileID int `json:"fileId,omitempty"`
// Branch identifier. Note: Can't be used with `fileId` or `directoryId`
// in the same request.
BranchID int `json:"branchId,omitempty"`
// Directory Identifier. Note: Can't be used with `fileId` or `branchId`
// in same request.
DirectoryID int `json:"directoryId,omitempty"`
}
AutoTagRequest defines the structure of a request to automatically tag a screenshot.
func (*AutoTagRequest) Validate ¶ added in v0.2.0
func (r *AutoTagRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BatchValidationError ¶ added in v0.13.0
type BatchValidationError struct {
Index int `json:"index"`
Errors []ValidationError `json:"errors"`
}
BatchValidationError represents the invalid batch request error response schema (string-based API).
func (*BatchValidationError) Error ¶ added in v0.13.0
func (e *BatchValidationError) Error() string
Error implements the Error interface.
type BatchValidationErrorResponse ¶ added in v0.13.0
type BatchValidationErrorResponse struct {
Response *http.Response `json:"-"`
Errors []BatchValidationError `json:"errors"`
Status int
}
BatchValidationErrorResponse is the batch validation error response structure from the API.
func (*BatchValidationErrorResponse) Error ¶ added in v0.13.0
func (r *BatchValidationErrorResponse) Error() string
Error implements the Error interface.
type Branch ¶
type Branch struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
Name string `json:"name"`
Title string `json:"title"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ExportPattern *string `json:"exportPattern,omitempty"`
Priority *string `json:"priority,omitempty"`
// IsProtected is available for string-based projects only.
IsProtected *bool `json:"isProtected,omitempty"`
}
Branch represents a project branch.
type BranchMerge ¶
type BranchMerge struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
SourceBranchID int `json:"sourceBranchId"`
DeleteAfterMerge bool `json:"deleteAfterMerge"`
AcceptSourceChanges bool `json:"acceptSourceChanges,omitempty"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
BranchMerge represents a branch merge status.
type BranchMergeSummary ¶
type BranchMergeSummary struct {
Status string `json:"status"`
SourceBranchID int `json:"sourceBranchId"`
TargetBranchID int `json:"targetBranchId"`
DryRun bool `json:"dryRun"`
Details map[string]int `json:"details"`
}
BranchMergeSummary represents a summary of a branch merge.
type BranchesAddRequest ¶
type BranchesAddRequest struct {
// Branch name.
// Note: Can't contain \ / : * ? " < > | symbols.
Name string `json:"name"`
// Use to provide more details for translators.
// Title is available in UI only.
Title string `json:"title,omitempty"`
// Branch export pattern. Defines branch name and path in resulting
// translations bundle. Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Defines priority level for each branch.
// Enum: low, normal, high. Default: normal.
Priority string `json:"priority,omitempty"`
// If true, the branch is protected from some actions (for example,
// delete or force-push operations may be restricted). Default: false.
// Note: Available for string-based projects only.
IsProtected *bool `json:"isProtected,omitempty"`
}
BranchesAddRequest defines the structure of a request to create a new branch.
func (*BranchesAddRequest) Validate ¶
func (r *BranchesAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesCloneRequest ¶
type BranchesCloneRequest struct {
// Branch name. Note: Can't contain \ / : * ? " < > | symbols.
Name string `json:"name"`
// Title is used to provide more details for translators.
// It is available in UI only.
Title string `json:"title,omitempty"`
// If true, the branch is protected from some actions (for example,
// delete or force-push operations may be restricted). Default: false.
IsProtected *bool `json:"isProtected,omitempty"`
}
BranchesCloneRequest defines the structure of a request to clone a branch.
func (*BranchesCloneRequest) Validate ¶
func (r *BranchesCloneRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesGetResponse ¶
type BranchesGetResponse struct {
Data *Branch `json:"data"`
}
BranchesGetResponse describes a response with a single branch.
type BranchesListOptions ¶
type BranchesListOptions struct {
// Sort branches by the specified fields.
// Enum: id, name, title, createdAt, updatedAt, exportPattern, priority. Default: id.
// Example: orderBy=createdAt desc,name,priority.
// see: https://developer.crowdin.com/enterprise/api/v2/#section/Introduction/Sorting
OrderBy string `json:"orderBy,omitempty"`
// Name of the branch (filter branch by name).
Name string `json:"name,omitempty"`
ListOptions
}
BranchesListOptions specifies the optional parameters to the SourceFilesService.ListBranches method.
type BranchesListResponse ¶
type BranchesListResponse struct {
Data []*BranchesGetResponse `json:"data"`
}
BranchesListResponse describes a response with a list of branches.
type BranchesMergeRequest ¶
type BranchesMergeRequest struct {
// Branch that will be merged.
SourceBranchID int `json:"sourceBranchId"`
// Whether to delete branch after merge. Default: false.
DeleteAfterMerge *bool `json:"deleteAfterMerge,omitempty"`
// Whether to accept source changes. Default: false.
AcceptSourceChanges *bool `json:"acceptSourceChanges,omitempty"`
// Simulate merging without making any real changes. Default: false.
DryRun *bool `json:"dryRun,omitempty"`
}
BranchesMergeRequest defines the structure of a request to merge branches.
func (*BranchesMergeRequest) Validate ¶
func (r *BranchesMergeRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesMergeResponse ¶
type BranchesMergeResponse struct {
Data *BranchMerge `json:"data"`
}
BranchesMergeResponse describes a response with a single branch merge status.
type BranchesMergeSummaryResponse ¶
type BranchesMergeSummaryResponse struct {
Data *BranchMergeSummary `json:"data"`
}
BranchesMergeSummaryResponse describes a response with a single branch merge summary.
type BranchesSearchOptions ¶ added in v0.19.0
type BranchesSearchOptions struct {
// Search branches by `name` or `title` (required).
Filter string `json:"filter"`
// Project identifiers to search across (max 50).
// Omit to search all accessible projects.
// Note: On crowdin.com all projects must belong to the same owner.
ProjectIDs []int `json:"projectIds,omitempty"`
// Owner (user) whose projects to search when `projectIds` is omitted.
// Defaults to your own account.
// Note: Available for crowdin.com only.
UserID int `json:"userId,omitempty"`
ListOptions
}
BranchesSearchOptions specifies the parameters to the BranchesService.Search method.
func (*BranchesSearchOptions) Validate ¶ added in v0.19.0
func (o *BranchesSearchOptions) Validate() error
Validate checks if the search options are valid.
type BuildAttributes ¶ added in v0.2.0
type BuildAttributes struct {
BranchID *int `json:"branchId,omitempty"`
DirectoryID *int `json:"directoryId,omitempty"`
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
Pseudo *bool `json:"pseudo,omitempty"`
Prefix *string `json:"prefix,omitempty"`
Suffix *string `json:"suffix,omitempty"`
LengthTransformation *int `json:"lengthTransformation,omitempty"`
CharTransformation *string `json:"charTransformation,omitempty"`
}
BuildAttributes represents the attributes of a project build.
type BuildError ¶ added in v0.19.0
type BuildError struct {
Message string `json:"message"`
}
BuildError represents the error details of a failed build.
type BuildProjectDirectoryTranslation ¶
type BuildProjectDirectoryTranslation struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
Status string `json:"status"`
Progress int `json:"progress"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
FinishedAt string `json:"finishedAt,omitempty"`
}
BuildProjectDirectoryTranslation represents a project directory build.
type BuildProjectDirectoryTranslationRequest ¶
type BuildProjectDirectoryTranslationRequest struct {
// Specify target languages for build.
// Leave this field empty to build all target languages.
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
// Defines whether to export only translated strings. Default: false.
// Note: true value can't be used with `skipUntranslatedFiles=true` in same request .
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only translated file. Default: false.
// Note: true value can't be used with `skipUntranslatedStrings=true` in same request.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Defines whether to export only approved strings. Default: false.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// Preserve folder hierarchy. Default: false.
PreserveFolderHierarchy *bool `json:"preserveFolderHierarchy,omitempty"`
// Defines whether to export only approved strings.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in same request.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: true value can't be used with `exportWithMinApprovalsCount>0` in same request
// or in projects without an assigned workflow.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
BuildProjectDirectoryTranslationRequest defines the structure of a request to build project directory translation.
func (*BuildProjectDirectoryTranslationRequest) Validate ¶
func (r *BuildProjectDirectoryTranslationRequest) Validate() error
Validate checks if the build project directory translation request is valid. It implements the crowdin.RequestValidator interface.
type BuildProjectFileTranslationRequest ¶
type BuildProjectFileTranslationRequest struct {
// Target Language Identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Defines whether to export only translated strings. Default: false.
// Note: true value can't be used with `skipUntranslatedFiles=true“ in same request.
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only translated file. Default: false.
// Note: true value can't be used with `skipUntranslatedStrings=true` in same request.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Defines whether to export only approved strings. Default: false.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// Defines whether to export only approved strings.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in same request.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: true value can't be used with `exportWithMinApprovalsCount>0` in same request
// or in projects without an assigned workflow.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
BuildProjectFileTranslationRequest defines the structure of a request to build project file translation.
func (*BuildProjectFileTranslationRequest) Validate ¶
func (r *BuildProjectFileTranslationRequest) Validate() error
Validate checks if the build project file translation request is valid. It implements the crowdin.RequestValidator interface.
type BuildProjectRequest ¶
type BuildProjectRequest struct {
// Branch Identifier.
BranchID int `json:"branchId,omitempty"`
// Specify target languages for build.
// Leave this field empty to build all target languages
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
// Defines whether to export only translated strings.
// Note: true value can't be used with `skipUntranslatedFiles=true` in same request.
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only translated files.
// Note: true value can't be used with `skipUntranslatedStrings=true` in same request.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Defines whether to export only approved strings.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// Defines whether to export only approved strings.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in same request.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: true value can't be used with `exportWithMinApprovalsCount>0` in same request
// or in projects without an assigned workflow.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
BuildProjectRequest defines the structure of a request to build a project.
func (*BuildProjectRequest) Validate ¶
func (r *BuildProjectRequest) Validate() error
Validate checks if the build project request is valid. It implements the crowdin.RequestValidator interface.
func (*BuildProjectRequest) ValidateBuildRequest ¶
func (r *BuildProjectRequest) ValidateBuildRequest() error
ValidateBuildRequest implements the BuildProjectTranslationRequest interface.
type BuildProjectTranslationRequester ¶ added in v0.6.0
type BuildProjectTranslationRequester interface {
ValidateBuildRequest() error
}
BuildProjectTranslationRequester interface that allows accepting BuildProjectRequest and PseudoBuildProjectRequest types.
type Bundle ¶ added in v0.2.0
type Bundle struct {
ID int `json:"id"`
Name string `json:"name"`
Format string `json:"format"`
SourcePatterns []string `json:"sourcePatterns"`
IgnorePatterns []string `json:"ignorePatterns"`
ExportPattern string `json:"exportPattern"`
IsMultilingual bool `json:"isMultilingual"`
IncludeProjectSourceLanguage bool `json:"includeProjectSourceLanguage"`
LabelIDs []int `json:"labelIds"`
ExcludeLabelIDs []int `json:"excludeLabelIds"`
WebURL string `json:"webUrl"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
IncludeInContextPseudoLanguage bool `json:"includeInContextPseudoLanguage"`
SourceLanguageExportPattern *string `json:"sourceLanguageExportPattern,omitempty"`
LabelMatchRule *string `json:"labelMatchRule,omitempty"`
ExcludeLabelMatchRule *string `json:"excludeLabelMatchRule,omitempty"`
LanguageIDs []string `json:"languageIds,omitempty"`
}
Bundle represents a Crowdin bundle.
type BundleAddRequest ¶ added in v0.2.0
type BundleAddRequest struct {
// Defines name.
Name string `json:"name"`
// Defines export file format. If not provided, files will be exported
// in their original format.
// Note: Required for string-based projects.
Format string `json:"format,omitempty"`
// Source patterns.
SourcePatterns []string `json:"sourcePatterns"`
// Ignore patterns.
IgnorePatterns []string `json:"ignorePatterns"`
// Bundle export pattern. Defines bundle name in resulting
// translations bundle. Required if `format` is specified.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Export translations in multilingual file.
// Default: false.
IsMultilingual *bool `json:"isMultilingual"`
// Add project source language to bundle.
// Default: false.
IncludeProjectSourceLanguage *bool `json:"includeProjectSourceLanguage"`
// Label Identifiers.
LabelIDs []int `json:"labelIds"`
// Label Identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds"`
// Source language export pattern.
// Note: Works only when `includeProjectSourceLanguage` is enabled.
// Can't contain : * ? " < > | symbols.
SourceLanguageExportPattern string `json:"sourceLanguageExportPattern,omitempty"`
// Add In-Context pseudo-language to bundle. Default: true.
IncludeInContextPseudoLanguage *bool `json:"includeInContextPseudoLanguage,omitempty"`
// Match rule for labels. Enum: all, any. Default: all.
// Note: Can only be used when `labelIds` parameter is provided.
LabelMatchRule string `json:"labelMatchRule,omitempty"`
// Match rule for excluded labels. Enum: all, any. Default: all.
// Note: Can only be used when `excludeLabelIds` parameter is provided.
ExcludeLabelMatchRule string `json:"excludeLabelMatchRule,omitempty"`
// Language Identifiers. If provided, bundle will only export specified languages.
// If not provided, bundle will export all project target languages.
LanguageIDs []string `json:"languageIds,omitempty"`
}
BundleAddRequest defines the structure of a request to add a new bundle.
func (*BundleAddRequest) Validate ¶ added in v0.2.0
func (b *BundleAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BundleExport ¶ added in v0.2.0
type BundleExport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
// Attributes holds only the bundle identifier and is kept for backward
// compatibility. Use ExportAttributes to access all export attributes.
Attributes struct {
BundleID int `json:"bundleId"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// StartedAt is nullable in the API; a null value is decoded as an empty string.
StartedAt string `json:"startedAt"`
// FinishedAt is nullable in the API; a null value is decoded as an empty string.
FinishedAt string `json:"finishedAt"`
// ExportAttributes holds all attributes of the bundle export
// (decoded from the `attributes` object of the response).
ExportAttributes *BundleExportAttributes `json:"-"`
}
BundleExport represents a bundle export progress.
func (*BundleExport) UnmarshalJSON ¶ added in v0.19.0
func (b *BundleExport) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a bundle export, populating both Attributes and ExportAttributes from the `attributes` object.
type BundleExportAttributes ¶ added in v0.19.0
type BundleExportAttributes struct {
BundleID int `json:"bundleId"`
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
BundleExportAttributes represents the attributes of a bundle export.
type BundleExportRequest ¶ added in v0.19.0
type BundleExportRequest struct {
// Specify target languages for export.
// Leave this field empty to export all target languages.
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
// Defines whether to export only translated strings.
// Note: true value can't be used with `skipUntranslatedFiles=true` in the same request.
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only translated files.
// Note: true value can't be used with `skipUntranslatedStrings=true` in the same request.
// Available only for file-based projects.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Defines whether to export only approved strings. Default: false.
// Note: Available only for Crowdin.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// Defines whether to export only strings with a minimum number of approvals.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in the same request. Available only for Crowdin Enterprise.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: true value can't be used with `exportWithMinApprovalsCount>0` in the same
// request. Available only for Crowdin Enterprise.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
BundleExportRequest defines the structure of a request to export a bundle.
func (*BundleExportRequest) Validate ¶ added in v0.19.0
func (r *BundleExportRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BundleExportResponse ¶ added in v0.2.0
type BundleExportResponse struct {
Data *BundleExport `json:"data"`
}
BundleExportResponse defines the structure of a response when exporting a bundle.
type BundleResponse ¶ added in v0.2.0
type BundleResponse struct {
Data *Bundle `json:"data"`
}
BundleResponse defines the structure of a response when getting a single bundle.
type BundlesListResponse ¶ added in v0.2.0
type BundlesListResponse struct {
Data []*BundleResponse `json:"data"`
}
BundlesListResponse defines the structure of a response when getting a list of bundles.
type CSVFileFormatSettings ¶
type CSVFileFormatSettings struct{ CommonFileFormatSettings }
type ChromeFileFormatSettings ¶
type ChromeFileFormatSettings struct{ CommonFileFormatSettings }
type ClearGlossaryOptions ¶ added in v0.3.0
type ClearGlossaryOptions struct {
// Language Identifier.
LanguageID string `json:"languageId,omitempty"`
// Defines whether to delete specific term along with its translations.
ConceptID int `json:"conceptId,omitempty"`
// Defines whether to delete specific term along with its translations.
TranslationOfTermID int `json:"translationOfTermId,omitempty"`
}
ClearGlossaryOptions specifies the optional parameters to the GlossariesService.ClearGlossary method.
type Client ¶ added in v0.19.0
type Client struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
// Client status. Enum: pending, confirmed, rejected.
Status string `json:"status"`
WebURL string `json:"webUrl"`
}
Client represents a client of the organization.
type ClientResponse ¶ added in v0.19.0
type ClientResponse struct {
Data *Client `json:"data"`
}
ClientResponse defines the structure of a response when getting a client.
type ClientsListResponse ¶ added in v0.19.0
type ClientsListResponse struct {
Data []*ClientResponse `json:"data"`
}
ClientsListResponse defines the structure of a response when getting a list of clients.
type CommonFileFormatSettings ¶
type CommonFileFormatSettings struct {
// Defines whether to split long texts into smaller text segments. Default: true.
// Important! This option disables the possibility to upload existing translations for XML files when enabled.
ContentSegmentation *bool `json:"contentSegmentation,omitempty"`
// Storage identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
// File format export pattern. Default: null.
// Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
}
func (*CommonFileFormatSettings) ValidateSettings ¶
func (p *CommonFileFormatSettings) ValidateSettings() error
type CommonFileImportOptions ¶
type CommonFileImportOptions struct {
// Defines whether to split long texts into smaller text segments. Default: true.
ContentSegmentation *bool `json:"contentSegmentation,omitempty"`
// Storage identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
}
CommonFileImportOptions implements the FileImportOptions interface.
func (*CommonFileImportOptions) ValidateFileImportOptions ¶
func (o *CommonFileImportOptions) ValidateFileImportOptions() error
type Concept ¶ added in v0.3.0
type Concept struct {
ID int `json:"id"`
UserID int `json:"userId"`
GlossaryID int `json:"glossaryId"`
Subject string `json:"subject"`
Definition string `json:"definition"`
Translatable bool `json:"translatable"`
Note string `json:"note"`
URL string `json:"url"` // Base URL.
Figure string `json:"figure"` // Figure URL.
LanguagesDetails []*ConceptLanguagesDetails `json:"languagesDetails"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// Custom fields (Enterprise only).
Fields any `json:"fields,omitempty"`
}
Concept represents a concept in a glossary.
type ConceptLanguagesDetails ¶ added in v0.3.0
type ConceptLanguagesDetails struct {
LanguageID string `json:"languageId"`
UserID int `json:"userId"`
Definition string `json:"definition"`
Note string `json:"note"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
ConceptLanguagesDetails represents the language details of a concept.
type ConceptResponse ¶ added in v0.3.0
type ConceptResponse struct {
Data *Concept `json:"data"`
}
ConceptResponse defines the structure of a response when getting a concept.
type ConceptUpdateRequest ¶ added in v0.3.0
type ConceptUpdateRequest struct {
// Concept subject.
Subject string `json:"subject,omitempty"`
// Concept definition.
Definition string `json:"definition,omitempty"`
// Default: true.
Translatable *bool `json:"translatable,omitempty"`
// Any kind of note, such as a usage note, explanation, or instruction.
Note string `json:"note,omitempty"`
// Base URL.
URL string `json:"url,omitempty"`
// Used for an external cross-reference, such as a URL, or to point to
// an external graphic file.
Figure string `json:"figure,omitempty"`
// Concept languages details.
LanguagesDetails []*LanguagesDetails `json:"languagesDetails,omitempty"`
// Custom fields. Keys can be retrieved via the FieldsService.List method.
// Note: Enterprise only.
Fields map[string]any `json:"fields,omitempty"`
}
ConceptUpdateRequest defines the structure of a request to update a concept.
func (*ConceptUpdateRequest) Validate ¶ added in v0.3.0
func (r *ConceptUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ConceptsListOptions ¶ added in v0.3.0
type ConceptsListOptions struct {
// Sort concepts by specified field.
// Enum: id, subject, definition, note, createdAt, updatedAt. Default: id.
// Example: orderBy=createdAt desc,subject,definition
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
ConceptsListOptions specifies the optional parameters to the GlossariesService.ListConcepts method.
type ConceptsListResponse ¶ added in v0.3.0
type ConceptsListResponse struct {
Data []*ConceptResponse `json:"data"`
}
ConceptsListResponse defines the structure of a response when getting a list of concepts.
type ConcordanceSearch ¶ added in v0.3.0
type ConcordanceSearch struct {
Glossary *ConcordanceSearchGlossary `json:"glossary"`
Concept *ConcordanceSearchConcept `json:"concept"`
SourceTerms []*Term `json:"sourceTerms"`
TargetTerms []*Term `json:"targetTerms"`
}
ConcordanceSearch represents the concordance search result.
type ConcordanceSearchConcept ¶ added in v0.3.0
type ConcordanceSearchConcept struct {
ID int `json:"id"`
Subject string `json:"subject"`
Definition string `json:"definition"`
Translatable bool `json:"translatable"`
Note string `json:"note"`
URL string `json:"url"`
Figure string `json:"figure"`
}
ConcordanceSearchConcept represents the concept details in a concordance search.
type ConcordanceSearchGlossary ¶ added in v0.3.0
ConcordanceSearchGlossary represents the glossary details in a concordance search.
type ContributionRawDataSchema ¶ added in v0.4.0
type ContributionRawDataSchema struct {
// Report mode. Enum: translations, approvals, votes.
Mode ReportMode `json:"mode"`
// Report unit. Enum: strings, words, chars, chars_with_spaces.
// Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Task Identifier.
// Used to generate report by task.
TaskID int `json:"taskId,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// User Identifier for which the report should be generated.
UserID string `json:"userId,omitempty"`
// Column names to include in the report.
// Enum: userId, languageId, stringId, translationId, fileId, filePath,
// pluralForm, sourceStringTextHash, mtEngine, mtId, tmName, tmId,
// preTranslated, tmMatch, mtMatch, suggestionMatch, sourceUnits,
// targetUnits, createdAt, updatedAt, mark.
Columns []string `json:"columns,omitempty"`
// List of TM identifiers.
TMIDs []int `json:"tmIds,omitempty"`
// List of MT identifiers.
MTIDs []int `json:"mtIds,omitempty"`
// List of AI prompt identifiers.
AIPromptIDs []int `json:"aiPromptIds,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
ContributionRawDataSchema defines the schema for the contribution raw data report.
func (*ContributionRawDataSchema) ValidateSchema ¶ added in v0.4.0
func (r *ContributionRawDataSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the ContributionRawData schema is valid.
type ContributionStats ¶ added in v0.19.0
ContributionStats represents contribution statistics.
type CostsEstimationPostEditingSchema ¶ added in v0.4.0
type CostsEstimationPostEditingSchema struct {
// Report unit.
// Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Report currency.
// Enum: USD, EUR, JPY, GBP, AUD, CAD, CHF, CNY, SEK, NZD, MXN,
// SGD, HKD, NOK, KRW, TRY, RUB, INR, BRL, ZAR, GEL, UAH, DDK
Currency string `json:"currency,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Base rates.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates (Custom rates for certain languages or users).
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Net Rate Schemes (Percentage paid of full translation rate).
// Note: A new translation will be included in the report at the lowest rate
// if multiple scheme categories can be applied to the translation.
NetRateSchemes *ReportNetRateSchemes `json:"netRateSchemes,omitempty"`
// Calculate internal matches. Default: false.
CalculateInternalMatches *bool `json:"calculateInternalMatches,omitempty"`
// Include pre-translated strings. Default: false.
IncludePreTranslatedStrings *bool `json:"includePreTranslatedStrings,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// List of label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Defines which strings include in report.
// Enum: strings_with_label, strings_without_label. Default: strings_with_label.
LabelIncludeType string `json:"labelIncludeType,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Workflow step identifier (Enterprise only).
WorkflowStepID int `json:"workflowStepId,omitempty"`
// Task Identifier.
// Used to generate report by task.
//
// Deprecated: use TaskIDs instead.
TaskID int `json:"taskId,omitempty"`
// Task identifiers.
// Used to generate report by tasks.
TaskIDs []int `json:"taskIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
CostsEstimationPostEditingSchema defines the schema for the costs estimation post-editing report.
func (*CostsEstimationPostEditingSchema) ValidateSchema ¶ added in v0.4.0
func (r *CostsEstimationPostEditingSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the CostsEstimationPostEditing schema is valid.
type CreateProxyChatCompletionRequest ¶ added in v0.5.0
type CreateProxyChatCompletionRequest struct {
// ID of the model to use (required for Google Gemini providers).
Model string `json:"model,omitempty"`
// ID of the model to use.
//
// Deprecated: the API expects the `model` field; use Model instead.
ModelID string `json:"modelId,omitempty"`
// Tokens will be sent as data-only server-sent events as they become available,
// with the stream terminated by a data: [DONE] message.
Stream *bool `json:"stream,omitempty"`
}
CreateProxyChatCompletionRequest defines the structure of a request to create an AI proxy chat completion.
func (*CreateProxyChatCompletionRequest) Validate ¶ added in v0.5.0
func (r *CreateProxyChatCompletionRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type CrowdinTaskAssignee ¶ added in v0.3.0
type CustomPlaceholder ¶ added in v0.19.0
type CustomPlaceholder struct {
ID int `json:"id"`
// Placeholder definition.
Definition string `json:"definition,omitempty"`
// Custom placeholder description. `nil` when none is set.
Description *string `json:"description,omitempty"`
// Argument delimiter.
ArgumentDelimiter string `json:"argumentDelimiter,omitempty"`
}
CustomPlaceholder represents a custom placeholder of the organization.
type CustomPlaceholderAddRequest ¶ added in v0.19.0
type CustomPlaceholderAddRequest struct {
// Placeholder definition.
Definition string `json:"definition"`
// Custom placeholder description.
Description string `json:"description,omitempty"`
// Argument delimiter. Default: `"`.
ArgumentDelimiter string `json:"argumentDelimiter,omitempty"`
}
CustomPlaceholderAddRequest defines the structure of a request when adding a custom placeholder.
func (*CustomPlaceholderAddRequest) Validate ¶ added in v0.19.0
func (r *CustomPlaceholderAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type CustomPlaceholderResponse ¶ added in v0.19.0
type CustomPlaceholderResponse struct {
Data *CustomPlaceholder `json:"data"`
}
CustomPlaceholderResponse defines the structure of a response when getting a custom placeholder.
type CustomPlaceholdersListResponse ¶ added in v0.19.0
type CustomPlaceholdersListResponse struct {
Data []*CustomPlaceholderResponse `json:"data"`
}
CustomPlaceholdersListResponse defines the structure of a response when getting a list of custom placeholders.
type CustomSpellchecker ¶ added in v0.19.0
type CustomSpellchecker struct {
ID int `json:"id"`
Name string `json:"name"`
Config *CustomSpellcheckerConfig `json:"config,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt,omitempty"`
}
CustomSpellchecker represents a custom spellchecker of the organization.
type CustomSpellcheckerConfig ¶ added in v0.19.0
type CustomSpellcheckerConfig struct {
// Application identifier.
Identifier string `json:"identifier"`
// Application module key.
Key string `json:"key"`
RealTimeCheckEnabled bool `json:"realTimeCheckEnabled"`
EnabledLanguageIDs []string `json:"enabledLanguageIds"`
}
CustomSpellcheckerConfig represents the configuration of a custom spellchecker.
type CustomSpellcheckerResponse ¶ added in v0.19.0
type CustomSpellcheckerResponse struct {
Data *CustomSpellchecker `json:"data"`
}
CustomSpellcheckerResponse defines the structure of a response when getting a custom spellchecker.
type CustomSpellcheckersListResponse ¶ added in v0.19.0
type CustomSpellcheckersListResponse struct {
Data []*CustomSpellcheckerResponse `json:"data"`
}
CustomSpellcheckersListResponse defines the structure of a response when getting a list of custom spellcheckers.
type DOCXFileExportOptions ¶ added in v0.19.0
type DOCXFileExportOptions struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// When checked, run properties in the exported document are minified against
// the style definitions instead of being kept verbatim. Default: true.
AllowWordStyleOptimization *bool `json:"allowWordStyleOptimization,omitempty"`
// When checked, excludes colored text runs inside a spreadsheet cell from
// translation. Default: false.
// Note: Applied when the file is parsed, even though it is set through `exportOptions`.
TranslateExcelExcludeColors *bool `json:"translateExcelExcludeColors,omitempty"`
}
DOCXFileExportOptions implements the FileExportOptions interface.
func (*DOCXFileExportOptions) ValidateFileExportOptions ¶ added in v0.19.0
func (o *DOCXFileExportOptions) ValidateFileExportOptions() error
type DOCXFileImportOptions ¶
type DOCXFileImportOptions struct {
// When checked, strips additional formatting tags related to text spacing. Default: false
// Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm,
// *.dotm, *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
CleanTagsAggressively *bool `json:"cleanTagsAggressively,omitempty"`
// When checked, exposes hidden text for translation. Default: false
// Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm.
TranslateHiddenText *bool `json:"translateHiddenText,omitempty"`
// When checked, exposes hidden hyperlinks for translation. Default: false
// Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm,
// *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
TranslateHyperlinkURLs *bool `json:"translateHyperlinkUrls,omitempty"`
// When checked, exposes hidden rows and columns for translation. Default: false
// Note: Works only for files with the following extensions: *.xlsx, *.xltx, *.xlsm, *.xltm.
TranslateHiddenRowsAndColumns *bool `json:"translateHiddenRowsAndColumns,omitempty"`
// When checked, expose slide notes for translation. Default: true
// Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
ImportNotes *bool `json:"importNotes,omitempty"`
// When checked, exposes hidden slides for translation. Default: false
// Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
ImportHiddenSlides *bool `json:"importHiddenSlides,omitempty"`
// When checked, exposes document properties such as title, subject, and creator
// for translation. Default: false.
TranslateDocProperties *bool `json:"translateDocProperties,omitempty"`
// When checked, exposes comments for translation. Default: true.
TranslateComments *bool `json:"translateComments,omitempty"`
// When checked, formatting that differs only in whitespace no longer produces
// separate tags. Default: false.
// Note: Can be set only when `cleanTagsAggressively` is enabled.
IgnoreWhitespaceStyles *bool `json:"ignoreWhitespaceStyles,omitempty"`
// When checked, a tab inside a text run is exposed as a character instead of a tag.
// Default: false.
AddTabAsCharacter *bool `json:"addTabAsCharacter,omitempty"`
// When checked, a line break inside a text run is exposed as `lineSeparatorReplacement`
// instead of a tag. Default: false.
AddLineSeparatorAsCharacter *bool `json:"addLineSeparatorAsCharacter,omitempty"`
// Character that replaces a line break when `addLineSeparatorAsCharacter` is enabled.
// Note: Must be exactly one character.
LineSeparatorReplacement string `json:"lineSeparatorReplacement,omitempty"`
// When checked, a non-breaking hyphen is exposed as a character instead of a tag.
// Default: false.
ReplaceNoBreakHyphenTag *bool `json:"replaceNoBreakHyphenTag,omitempty"`
// When checked, soft hyphens are removed instead of being exposed as tags.
// Default: false.
IgnoreSoftHyphenTag *bool `json:"ignoreSoftHyphenTag,omitempty"`
// Word complex field types whose text is exposed for translation.
// Note: `HYPERLINK` is always extracted and can't be removed.
ComplexFieldDefinitionsToExtract []string `json:"complexFieldDefinitionsToExtract,omitempty"`
TranslateWordHeadersFooters *bool `json:"translateWordHeadersFooters,omitempty"`
// When checked, exposes the name of a shape or image for translation. Default: true.
TranslateWordGraphicName *bool `json:"translateWordGraphicName,omitempty"`
// When checked, exposes the alternative text of a shape or image for translation.
// Default: false.
TranslateWordGraphicDescription *bool `json:"translateWordGraphicDescription,omitempty"`
// When checked, excludes text whose font color falls between
// `wordFontColorsMinIgnoranceThreshold` and `wordFontColorsMaxIgnoranceThreshold`
// from translation. Default: false.
IgnoreWordFontColors *bool `json:"ignoreWordFontColors,omitempty"`
// Darkest font color ignored when `ignoreWordFontColors` is enabled, as six hexadecimal
// digits with an optional leading hash. Empty means black.
WordFontColorsMinIgnoranceThreshold string `json:"wordFontColorsMinIgnoranceThreshold,omitempty"`
// Lightest font color ignored when `ignoreWordFontColors` is enabled, as six hexadecimal
// digits with an optional leading hash. Empty means white.
WordFontColorsMaxIgnoranceThreshold string `json:"wordFontColorsMaxIgnoranceThreshold,omitempty"`
// Paragraph style names singled out by `translateWordInExcludeStyleMode`,
// for example `Heading1`.
ExcludeWordStyles []string `json:"excludeWordStyles,omitempty"`
// How `excludeWordStyles` is read. If true, the listed styles are excluded from
// translation; if false, only they are translated. Default: true.
TranslateWordInExcludeStyleMode *bool `json:"translateWordInExcludeStyleMode,omitempty"`
// Word highlight colors singled out by `translateWordInExcludeHighlightMode`.
WordHighlightColors []string `json:"wordHighlightColors,omitempty"`
// How `wordHighlightColors` is read. If true, text with the listed highlights is
// excluded from translation; if false, only it is translated. Default: true.
TranslateWordInExcludeHighlightMode *bool `json:"translateWordInExcludeHighlightMode,omitempty"`
// When checked, excludes text whose color is listed in `wordExcludedColors`
// from translation. Default: false.
TranslateWordExcludeColors *bool `json:"translateWordExcludeColors,omitempty"`
// Text colors excluded from translation when `translateWordExcludeColors` is enabled,
// each six hexadecimal digits with an optional leading hash.
WordExcludedColors []string `json:"wordExcludedColors,omitempty"`
// When checked, a cell whose text is shared with another cell is exposed once
// for translation. Default: true.
TranslateExcelCellsCopied *bool `json:"translateExcelCellsCopied,omitempty"`
// When checked, exposes worksheet names for translation. Default: false.
TranslateExcelSheetNames *bool `json:"translateExcelSheetNames,omitempty"`
// Cell fill colors whose cells are excluded from translation, each the six-digit RGB
// with an optional leading hash.
ExcelExcludedColors []string `json:"excelExcludedColors,omitempty"`
// When checked, exposes text inside SmartArt and diagram data for translation.
// Default: false.
TranslateExcelDiagramData *bool `json:"translateExcelDiagramData,omitempty"`
// When checked, exposes text inside drawings and shapes on a worksheet for translation.
// Default: false.
TranslateExcelDrawings *bool `json:"translateExcelDrawings,omitempty"`
// Important: ContentSegmentation option disables the possibility to upload existing translations
// for XML files when enabled.
CommonFileImportOptions
}
DOCXFileImportOptions implements the FileImportOptions interface.
type DictionariesListOptions ¶ added in v0.4.0
type DictionariesListOptions struct {
// Filter progress by language identifiers.
LanguageIDs []string `json:"languageIds,omitempty"`
}
DictionariesListOptions specifies the optional parameters to the DictionariesService.List method.
type DictionariesListResponse ¶ added in v0.4.0
type DictionariesListResponse struct {
Data []*DictionaryResponse `json:"data"`
}
DictionariesListResponse defines the structure of the response when getting a list of dictionaries.
type Dictionary ¶ added in v0.4.0
Dictionary represents a storage of words.
type DictionaryResponse ¶ added in v0.4.0
type DictionaryResponse struct {
Data *Dictionary `json:"data"`
}
DictionaryResponse defines the structure of the response when getting a dictionary.
type DirectoriesSearchOptions ¶ added in v0.19.0
type DirectoriesSearchOptions struct {
// Search directories by `name` or `title` (required).
Filter string `json:"filter"`
// Project identifiers to search across (max 50).
// Omit to search all accessible projects.
// Note: On crowdin.com all projects must belong to the same owner.
ProjectIDs []int `json:"projectIds,omitempty"`
// Owner (user) whose projects to search when `projectIds` is omitted.
// Defaults to your own account.
// Note: Available for crowdin.com only.
UserID int `json:"userId,omitempty"`
ListOptions
}
DirectoriesSearchOptions specifies the parameters to the SourceFilesService.SearchDirectories method.
func (*DirectoriesSearchOptions) Validate ¶ added in v0.19.0
func (o *DirectoriesSearchOptions) Validate() error
Validate checks if the search options are valid.
type Directory ¶
type Directory struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
BranchID *int `json:"branchId,omitempty"`
DirectoryID *int `json:"directoryId,omitempty"`
Name string `json:"name"`
Title string `json:"title"`
ExportPattern string `json:"exportPattern"`
Path string `json:"path"`
Priority string `json:"priority"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Directory represents a project directory.
type DirectoryAddRequest ¶
type DirectoryAddRequest struct {
// Directory name.
// Note: Can't contain \ / : * ? " < > | symbols.
Name string `json:"name"`
// Branch identifier.
// Note: Can't be used with `directoryId` in same request.
BranchID int `json:"branchId,omitempty"`
// Parent Directory Identifier.
// Note: Can't be used with `branchId` in same request.
DirectoryID int `json:"directoryId,omitempty"`
// Title is used to provide more details for translators.
// It is available in UI only.
Title string `json:"title,omitempty"`
// Directory export pattern. Defines directory name and path in resulting
// translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Defines priority level for each branch.
// Enum: low, normal, high. Default: normal.
Priority string `json:"priority,omitempty"`
}
DirectoryAddRequest defines the structure of a request to create a new directory.
func (*DirectoryAddRequest) Validate ¶
func (r *DirectoryAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type DirectoryGetResponse ¶
type DirectoryGetResponse struct {
Data *Directory `json:"data"`
}
DirectoryGetResponse describes a response with a single directory.
type DirectoryListOptions ¶
type DirectoryListOptions struct {
// OrderBy is used to sort directories.
// Enum: id, name, title, createdAt, updatedAt, exportPattern, priority.
// Default: id.
// Example: orderBy=createdAt desc,name,priority.
OrderBy string `json:"orderBy,omitempty"`
// BranchID is the ID of the branch to filter directories by.
// Note: Can't be used with `directoryID` in the same request.
// To list the directories from all the nested levels within the branch,
// ensure to use the `recursion` parameter with the `branchID` parameter.
BranchID int `json:"branchId,omitempty"`
// DirectoryID is the ID of the directory to filter directories by.
// Note: Can't be used with `branchID` in the same request.
// To list the directories from all the nested levels within the directory,
// ensure to use the `recursion` parameter with the `directoryID` parameter.
DirectoryID int `json:"directoryId,omitempty"`
// Filter directories by name.
Filter string `json:"filter,omitempty"`
// Recursion is used to list directories recursively.
// Note: Works only when `directoryID` or `branchID` parameter is specified.
Recursion any `json:"recursion,omitempty"`
ListOptions
}
DirectoryListOptions specifies the optional parameters to the SourceFilesService.ListDirectories method.
type DirectoryListResponse ¶
type DirectoryListResponse struct {
Data []*DirectoryGetResponse `json:"data"`
}
DirectoryListResponse describes a response with a list of directories.
type Distribution ¶ added in v0.4.0
type Distribution struct {
Hash string `json:"hash"`
Name string `json:"name"`
BundleIDs []int `json:"bundleIds"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ExportMode string `json:"exportMode"`
FileIDs []int `json:"fileIds"`
ManifestURL string `json:"manifestUrl"`
}
Distribution represents a distribution in the project.
type DistributionAddRequest ¶ added in v0.4.0
type DistributionAddRequest struct {
// Distribution name.
Name string `json:"name"`
// Export mode.
// Enum: default, bundle. Default: default.
//
// Deprecated: use BundleIDs instead. The `exportMode` parameter is deprecated in the API.
ExportMode ExportMode `json:"exportMode,omitempty"`
// Files ids. Required for `default` export mode.
//
// Deprecated: use BundleIDs instead. The `fileIds` parameter is deprecated in the API.
FileIDs []int `json:"fileIds,omitempty"`
// Bundles ids. Required for `bundle` export mode.
BundleIDs []int `json:"bundleIds,omitempty"`
}
DistributionAddRequest defines the structure of the request when adding a distribution.
func (*DistributionAddRequest) Validate ¶ added in v0.4.0
func (r *DistributionAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type DistributionRelease ¶ added in v0.4.0
type DistributionRelease struct {
Status string `json:"status"` // inProgress, success, failed
Progress int `json:"progress"`
CurrentLanguageID string `json:"currentLanguageId"`
Date string `json:"date"`
CurrentFileID int `json:"currentFileId"`
// Current Branch Identifier (string-based projects).
CurrentBranchID *int `json:"currentBranchId,omitempty"`
// Error is present only when the release status is "failed".
Error *DistributionReleaseError `json:"error,omitempty"`
}
DistributionRelease represents a distribution release.
type DistributionReleaseError ¶ added in v0.19.0
type DistributionReleaseError struct {
Message string `json:"message"`
}
DistributionReleaseError represents the error details of a failed distribution release.
type DistributionReleaseResponse ¶ added in v0.4.0
type DistributionReleaseResponse struct {
Data *DistributionRelease `json:"data"`
}
DistributionReleaseResponse defines the structure of the response when getting a distribution release.
type DistributionResponse ¶ added in v0.4.0
type DistributionResponse struct {
Data *Distribution `json:"data"`
}
DistributionResponse defines the structure of the response when getting a distribution.
type DistributionsListResponse ¶ added in v0.4.0
type DistributionsListResponse struct {
Data []*DistributionResponse `json:"data"`
}
DistributionsListResponse defines the structure of the response when getting a list of distributions.
type DitaFileFormatSettings ¶
type DitaFileFormatSettings struct{ CommonFileFormatSettings }
type DocxFileFormatSettings ¶
type DocxFileFormatSettings struct {
CommonFileFormatSettings
// When checked, strips additional formatting tags related to text spacing. Default: false.
// Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm,
// *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
CleanTagsAggressively *bool `json:"cleanTagsAggressively,omitempty"`
// When checked, exposes hidden text for translation. Default: false.
// Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm.
TranslateHiddenText *bool `json:"translateHiddenText,omitempty"`
// When checked, exposes hidden hyperlinks for translation. Default: false.
// Note: Works only for files with the following extensions: *.docx, *.dotx,
// *.docm, *.dotm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
TranslateHyperlinkUrls *bool `json:"translateHyperlinkUrls,omitempty"`
// When checked, exposes hidden rows and columns for translation. Default: false.
// Note: Works only for files with the following extensions: *.xlsx, *.xltx, *.xlsm, *.xltm.
TranslateHiddenRowsAndColumns *bool `json:"translateHiddenRowsAndColumns,omitempty"`
// When checked, expose slide notes for translation. Default: true.
// Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
ImportNotes *bool `json:"importNotes,omitempty"`
// When checked, exposes hidden slides for translation. Default: false.
// Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm.
ImportHiddenSlides *bool `json:"importHiddenSlides,omitempty"`
// Defines whether to translate document properties. Default: false.
TranslateDocProperties *bool `json:"translateDocProperties,omitempty"`
// Defines whether to translate comments. Default: true.
TranslateComments *bool `json:"translateComments,omitempty"`
// Defines whether to ignore whitespace styles. Default: false.
IgnoreWhitespaceStyles *bool `json:"ignoreWhitespaceStyles,omitempty"`
// Defines whether to add tab as a character. Default: false.
AddTabAsCharacter *bool `json:"addTabAsCharacter,omitempty"`
// Defines whether to add line separator as a character. Default: false.
AddLineSeparatorAsCharacter *bool `json:"addLineSeparatorAsCharacter,omitempty"`
// Defines the line separator replacement. Default: a newline character.
LineSeparatorReplacement *string `json:"lineSeparatorReplacement,omitempty"`
// Defines whether to replace the no-break hyphen tag. Default: false.
ReplaceNoBreakHyphenTag *bool `json:"replaceNoBreakHyphenTag,omitempty"`
// Defines whether to ignore the soft hyphen tag. Default: false.
IgnoreSoftHyphenTag *bool `json:"ignoreSoftHyphenTag,omitempty"`
// Complex field definitions to extract. Default: [].
ComplexFieldDefinitionsToExtract []string `json:"complexFieldDefinitionsToExtract,omitempty"`
TranslateWordHeadersFooters *bool `json:"translateWordHeadersFooters,omitempty"`
// Defines whether to translate Word graphic names. Default: true.
TranslateWordGraphicName *bool `json:"translateWordGraphicName,omitempty"`
// Defines whether to translate Word graphic descriptions. Default: false.
TranslateWordGraphicDescription *bool `json:"translateWordGraphicDescription,omitempty"`
// Defines whether to ignore Word font colors. Default: false.
IgnoreWordFontColors *bool `json:"ignoreWordFontColors,omitempty"`
// Minimum Word font color ignorance threshold. Default: "".
WordFontColorsMinIgnoranceThreshold *string `json:"wordFontColorsMinIgnoranceThreshold,omitempty"`
// Maximum Word font color ignorance threshold. Default: "".
WordFontColorsMaxIgnoranceThreshold *string `json:"wordFontColorsMaxIgnoranceThreshold,omitempty"`
// Word styles to exclude. Default: [].
ExcludeWordStyles []string `json:"excludeWordStyles,omitempty"`
// Defines whether to translate Word content in exclude style mode. Default: true.
TranslateWordInExcludeStyleMode *bool `json:"translateWordInExcludeStyleMode,omitempty"`
// Word highlight colors. Default: [].
WordHighlightColors []string `json:"wordHighlightColors,omitempty"`
// Defines whether to translate Word content in exclude highlight mode. Default: true.
TranslateWordInExcludeHighlightMode *bool `json:"translateWordInExcludeHighlightMode,omitempty"`
// Defines whether to translate Word excluded colors. Default: false.
TranslateWordExcludeColors *bool `json:"translateWordExcludeColors,omitempty"`
// Word excluded colors. Default: [].
WordExcludedColors []string `json:"wordExcludedColors,omitempty"`
// Defines whether to translate copied Excel cells. Default: true.
TranslateExcelCellsCopied *bool `json:"translateExcelCellsCopied,omitempty"`
// Defines whether to translate Excel sheet names. Default: false.
TranslateExcelSheetNames *bool `json:"translateExcelSheetNames,omitempty"`
// Excel excluded colors. Default: [].
ExcelExcludedColors []string `json:"excelExcludedColors,omitempty"`
// Defines whether to translate Excel diagram data. Default: false.
TranslateExcelDiagramData *bool `json:"translateExcelDiagramData,omitempty"`
// Defines whether to translate Excel drawings. Default: false.
TranslateExcelDrawings *bool `json:"translateExcelDrawings,omitempty"`
// Defines whether to allow Word style optimization. Default: true.
AllowWordStyleOptimization *bool `json:"allowWordStyleOptimization,omitempty"`
// Defines whether to translate Excel excluded colors. Default: false.
TranslateExcelExcludeColors *bool `json:"translateExcelExcludeColors,omitempty"`
}
type DownloadLink ¶
type DownloadLink struct {
URL string `json:"url"`
ExpireIn string `json:"expireIn"`
Etag *string `json:"etag,omitempty"`
}
DownloadLink represents a download link.
type DownloadLinkResponse ¶
type DownloadLinkResponse struct {
Data *DownloadLink `json:"data"`
}
DownloadLinkResponse defines the structure of a response when getting a download URL with its expiration time.
type EditorIssuesSchema ¶ added in v0.18.0
type EditorIssuesSchema struct {
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Issue type filter.
IssueType string `json:"issueType,omitempty"`
}
EditorIssuesSchema defines the schema for the editor issues report.
func (*EditorIssuesSchema) ValidateSchema ¶ added in v0.18.0
func (r *EditorIssuesSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the EditorIssues schema is valid.
type EnterprisePendingTaskCreateForm ¶ added in v0.3.0
type EnterprisePendingTaskCreateForm struct {
// Translate task identifier.
PrecedingTaskID int `json:"precedingTaskId"`
// Task type. Enum: 1 - proofread, 3 - proofread by vendor
// (requires `vendor` field).
// Note: One of `type` or `workflowStepId` is required.
// Both cannot be provided simultaneously.
Type TaskType `json:"type,omitempty"`
// Task workflow step identifier.
// Note: One of `type` or `workflowStepId` is required.
// Both cannot be provided simultaneously.
WorkflowStepID int `json:"workflowStepId,omitempty"`
// Task title.
Title string `json:"title"`
// Task description.
Description string `json:"description,omitempty"`
// Vendor identifier. Required when `type` is 3.
Vendor TaskVendor `json:"vendor,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task assigned teams.
AssignedTeams []TaskAssignedTeam `json:"assignedTeams,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
}
func (*EnterprisePendingTaskCreateForm) Validate ¶ added in v0.3.0
func (r *EnterprisePendingTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*EnterprisePendingTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *EnterprisePendingTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type EnterpriseTaskCreateForm ¶ added in v0.3.0
type EnterpriseTaskCreateForm struct {
// Task type. Enum: 0 - translate, 1 - proofread.
// Note: Can't be used with `workflowStepId` in same request.
Type *TaskType `json:"type"`
// Task workflow step id.
// Note: Can't be used with `type` in same request.
WorkflowStepID int `json:"workflowStepId,omitempty"`
// Task title
Title string `json:"title"`
// Task language identifier.
LanguageID string `json:"languageId"`
// Task string identifiers.
// One of stringIds, fileIds, directoryIds or branchIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// Task file identifiers (file-based projects only).
// One of stringIds, fileIds, directoryIds or branchIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Directory identifiers (file-based projects only).
// One of stringIds, fileIds, directoryIds or branchIds is required.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// Branch identifiers.
// One of stringIds, fileIds, directoryIds or branchIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Match rule for labels. Enum: all, any.
LabelMatchRule string `json:"labelMatchRule,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Match rule for excluded labels. Enum: all, any.
ExcludeLabelMatchRule string `json:"excludeLabelMatchRule,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Split content for task.
SplitContent *bool `json:"splitContent,omitempty"`
// Skip strings already included in other tasks. Default: false.
SkipAssignedStrings *bool `json:"skipAssignedStrings,omitempty"`
// Defines which other tasks the `skipAssignedStrings` filter considers.
// Enum: all, sameWorkflowStep.
// Note: Can only be used when `skipAssignedStrings` is `true`.
SkipAssignedStringsScope string `json:"skipAssignedStringsScope,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task assigned teams.
AssignedTeams []TaskAssignedTeam `json:"assignedTeams,omitempty"`
// Defines whether to export only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false`,
// `type=0` or `type=2` in same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
// Task started date. Format: UTC, ISO 8601.
StartedAt string `json:"startedAt,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Start date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateFrom string `json:"translationsUpdatedDateFrom,omitempty"`
// End date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateTo string `json:"translationsUpdatedDateTo,omitempty"`
// Generate cost estimate report for the task. Requires `reportSettingsTemplateId`.
GenerateCostEstimate *bool `json:"generateCostEstimate,omitempty"`
// Generate translation cost report for the task. Requires `reportSettingsTemplateId`.
GenerateTranslationCost *bool `json:"generateTranslationCost,omitempty"`
// Report settings template identifier. Required when `generateCostEstimate`
// or `generateTranslationCost` is `true`.
ReportSettingsTemplateID int `json:"reportSettingsTemplateId,omitempty"`
// Fields for task.
Fields map[string]any `json:"fields,omitempty"`
// Task batch identifier. Allows grouping tasks into a batch.
BatchID int `json:"batchId,omitempty"`
}
func (*EnterpriseTaskCreateForm) Validate ¶ added in v0.3.0
func (r *EnterpriseTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*EnterpriseTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *EnterpriseTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type EnterpriseVendorTaskCreateForm ¶ added in v0.3.0
type EnterpriseVendorTaskCreateForm struct {
// Task workflow step id with type `Translate by Vendor` or `Proofread by Vendor`.
WorkflowStepID int `json:"workflowStepId"`
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// String identifiers.
// One of stringIds, fileIds, directoryIds or branchIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers (file-based projects only).
// One of stringIds, fileIds, directoryIds or branchIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Directory identifiers (file-based projects only).
// One of stringIds, fileIds, directoryIds or branchIds is required.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// Branch identifiers.
// One of stringIds, fileIds, directoryIds or branchIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Match rule for labels. Enum: all, any.
LabelMatchRule string `json:"labelMatchRule,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Match rule for excluded labels. Enum: all, any.
ExcludeLabelMatchRule string `json:"excludeLabelMatchRule,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Skip strings already included in other tasks. Default: false.
SkipAssignedStrings *bool `json:"skipAssignedStrings,omitempty"`
// Defines which other tasks the `skipAssignedStrings` filter considers.
// Enum: all, sameWorkflowStep.
// Note: Can only be used when `skipAssignedStrings` is `true`.
SkipAssignedStringsScope string `json:"skipAssignedStringsScope,omitempty"`
// Defines whether to export only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false`,
// `type=0` or `type=2` in same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
// Task started date. Format: UTC, ISO 8601.
StartedAt string `json:"startedAt,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Start date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateFrom string `json:"translationsUpdatedDateFrom,omitempty"`
// End date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateTo string `json:"translationsUpdatedDateTo,omitempty"`
// Generate cost estimate report for the task. Requires `reportSettingsTemplateId`.
GenerateCostEstimate *bool `json:"generateCostEstimate,omitempty"`
// Generate translation cost report for the task. Requires `reportSettingsTemplateId`.
GenerateTranslationCost *bool `json:"generateTranslationCost,omitempty"`
// Report settings template identifier. Required when `generateCostEstimate`
// or `generateTranslationCost` is `true`.
ReportSettingsTemplateID int `json:"reportSettingsTemplateId,omitempty"`
// Fields for task.
Fields map[string]any `json:"fields,omitempty"`
}
func (*EnterpriseVendorTaskCreateForm) Validate ¶ added in v0.3.0
func (r *EnterpriseVendorTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*EnterpriseVendorTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *EnterpriseVendorTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type Error ¶
Error represents the schema for the error response.
func (*Error) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON unmarshals the code field. It allows the code field to be either an integer or a string.
type ErrorResponse ¶
ErrorResponse is the error response structure from the API.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
Error implements the Error interface.
type Event ¶ added in v0.4.0
type Event string
Event is a type that represents an event that happens in a Crowdin project.
const ( // Project file is added. FileAdded Event = "file.added" // Project file is updated. FileUpdated Event = "file.updated" // Project file is reverted. FileReverted Event = "file.reverted" // Project file is deleted. FileDeleted Event = "file.deleted" // Project file is fully translated. FileTranslated Event = "file.translated" // Project file is fully reviewed. FileApproved Event = "file.approved" // QA check for project file is finished. FileQAFinished Event = "file.qa.finished" // All strings in project are translated. ProjectTranslated Event = "project.translated" // All strings in project are approved. ProjectApproved Event = "project.approved" // QA check for project is finished. ProjectQAFinished Event = "project.qa.finished" // Project are successfully built. ProjectBuilt Event = "project.built" // Pre-translation is completed. PreTranslationCompleted Event = "preTranslation.completed" // Final translation of string is updated (using Replace in suggestions feature). TranslationUpdated Event = "translation.updated" // Source string is added. StringAdded Event = "string.added" // Source string is updated. StringUpdated Event = "string.updated" // Source string is deleted. StringDeleted Event = "string.deleted" // String comment/issue is added. StringCommentCreated Event = "stringComment.created" // String comment/issue is updated. StringCommentUpdated Event = "stringComment.updated" // String comment/issue is deleted. StringCommentDeleted Event = "stringComment.deleted" // String comment/issue is restored. StringCommentRestored Event = "stringComment.restored" // One of source strings is translated. SuggestionAdded Event = "suggestion.added" // Translation for source string is updated (using Replace in suggestions feature). SuggestionUpdated Event = "suggestion.updated" // One of translations is deleted. SuggestionDeleted Event = "suggestion.deleted" // Translation for string is approved. SuggestionApproved Event = "suggestion.approved" // Approval for previously added translation is removed. SuggestionDisapproved Event = "suggestion.disapproved" // Task is added. TaskAdded Event = "task.added" // Task status was changed. TaskStatusChanged Event = "task.statusChanged" // Task is updated. TaskUpdated Event = "task.updated" // Task is deleted. TaskDeleted Event = "task.deleted" // Organization webhook events. // Project is created. ProjectCreated Event = "project.created" // Project is deleted. ProjectDeleted Event = "project.deleted" // Group is created (Enterprise only). GroupCreated Event = "group.created" // Group is deleted (Enterprise only). GroupDeleted Event = "group.deleted" )
type ExportMode ¶ added in v0.4.0
type ExportMode string
ExportMode is a type representing the export mode of a distribution. Can be either `default` or `bundle`.
const ( ExportModeDefault ExportMode = "default" ExportModeBundle ExportMode = "bundle" )
type ExportReportArchiveRequest ¶ added in v0.4.0
type ExportReportArchiveRequest struct {
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
}
ExportReportArchiveRequest defines the structure of a request to export a report archive.
type ExportTranslationRequest ¶
type ExportTranslationRequest struct {
// Specify target language for export.
TargetLanguageID string `json:"targetLanguageId"`
// Defines export file format. Use API Type feature specified at the
// corresponding file format from Crowdin Store.
// Note: the `format` parameter is required in all cases except when you'd like
// to export translations for a single file in its original format.
Format string `json:"format,omitempty"`
// Label Identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Branch Identifiers.
// Note: Can't be used with `directoryIds` or `fileIds` in same request.
BranchIDs []int `json:"branchIds,omitempty"`
// Directory Identifiers.
// Note: Can't be used with `branchIds` or `fileIds` in same request.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// File Identifiers.
// Note: Can't be used with `branchIds` or `directoryIds` in same request.
FileIDs []int `json:"fileIds,omitempty"`
// Defines whether to export only translated strings. Default is false.
// Note: Can't be used with `skipUntranslatedFiles` in same request.
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only translated file. Default is false.
// Note: Can't be used with `skipUntranslatedStrings` in same request.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Defines whether to export only approved strings. Default is false.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// Defines whether to export only approved strings.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in same request.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: true value can't be used with `exportWithMinApprovalsCount>0` in same request
// or in projects without an assigned workflow.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
}
ExportTranslationRequest defines the structure of a request to export translations.
func (*ExportTranslationRequest) Validate ¶
func (r *ExportTranslationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ExternalQACheck ¶ added in v0.19.0
type ExternalQACheck struct {
ID int `json:"id"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Config map[string]any `json:"config,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt *string `json:"updatedAt,omitempty"`
}
ExternalQACheck represents an external QA check of the organization.
type ExternalQACheckResponse ¶ added in v0.19.0
type ExternalQACheckResponse struct {
Data *ExternalQACheck `json:"data"`
}
ExternalQACheckResponse defines the structure of a response when getting an external QA check.
type ExternalQAChecksListResponse ¶ added in v0.19.0
type ExternalQAChecksListResponse struct {
Data []*ExternalQACheckResponse `json:"data"`
}
ExternalQAChecksListResponse defines the structure of a response when getting a list of external QA checks.
type FJSFileFormatSettings ¶
type FJSFileFormatSettings struct{ CommonFileFormatSettings }
type FMHTMLFileFormatSettings ¶
type FMHTMLFileFormatSettings struct {
CommonFileFormatSettings
// Specify the inline tags.
InlineTags []string `json:"inlineTags,omitempty"`
// Specify CSS selectors for elements that should not be imported.
ExcludedElements []string `json:"excludedElements,omitempty"`
// Specify front matter elements that should not be imported.
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
}
FMHTMLFileFormatSettings defines the Front Matter HTML file format settings.
type FMMDFileFormatSettings ¶
type FMMDFileFormatSettings struct{ CommonFileFormatSettings }
type Field ¶ added in v0.4.0
type Field struct {
ID int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Type string `json:"type"`
Config *FieldConfig `json:"config,omitempty"`
Entities []string `json:"entities"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Field represents a field.
type FieldAddRequest ¶ added in v0.4.0
type FieldAddRequest struct {
// Field name.
Name string `json:"name"`
// Field slug.
Slug string `json:"slug"`
// Field type.
// Enum: checkbox, radiobuttons, date, datetime, number, labels,
// select, multiselect, text, textarea, url.
Type FieldType `json:"type"`
// Entities that will be associated with field.
Entities []FieldEntity `json:"entities"`
// Field description.
Description string `json:"description,omitempty"`
// Config represents the configuration for the field. It can contains
// a variety of fields.
//
// For list field config:
// - Options
// - Locations
// For number field config:
// - Min
// - Max
// - Units
// - Locations
// For other type field config:
// - Locations
Config FieldConfig `json:"config,omitempty"`
}
FieldAddRequest defines the structure of a request when adding a field.
func (*FieldAddRequest) Validate ¶ added in v0.4.0
func (r *FieldAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FieldConfig ¶ added in v0.4.0
type FieldConfig struct {
Options []FieldOption `json:"options,omitempty"`
Locations []FieldLocation `json:"locations,omitempty"`
// Minimal value of the field.
Min int `json:"min,omitempty"`
// Maximum value of the field.
Max int `json:"max,omitempty"`
// Units label that will be display next to input.
Units string `json:"units,omitempty"`
}
FieldConfig represents the configuration for the field.
type FieldEntity ¶ added in v0.4.0
type FieldEntity string
const ( EntityProject FieldEntity = "project" EntityUser FieldEntity = "user" EntityTask FieldEntity = "task" EntityFile FieldEntity = "file" EntityTranslation FieldEntity = "translation" EntityString FieldEntity = "string" )
type FieldLocation ¶ added in v0.4.0
type FieldLocation struct {
// Enum: projectCreateModal, projectHeader, projectDetails, projectCrowdsourceDetails,
// projectSettings, projectTaskEditCreate, projectTaskDetails, fileDetails, fileSettings,
// userEditModal, userDetails, userPopover, stringEditModal, stringDetails,
// translationUnderContent.
Place FieldPlace `json:"place,omitempty"`
}
FieldLocation represents a location for a field config.
type FieldOption ¶ added in v0.4.0
type FieldOption struct {
Label string `json:"label,omitempty"`
Value string `json:"value,omitempty"`
}
FieldOption represents an option for a field config.
type FieldPlace ¶ added in v0.4.0
type FieldPlace string
const ( ProjectCreateModal FieldPlace = "projectCreateModal" ProjectHeader FieldPlace = "projectHeader" ProjectDetails FieldPlace = "projectDetails" ProjectCrowdsourceDetails FieldPlace = "projectCrowdsourceDetails" ProjectSettings FieldPlace = "projectSettings" ProjectTaskEditCreate FieldPlace = "projectTaskEditCreate" ProjectTaskDetails FieldPlace = "projectTaskDetails" FileDetails FieldPlace = "fileDetails" FileSettings FieldPlace = "fileSettings" UserEditModal FieldPlace = "userEditModal" UserDetails FieldPlace = "userDetails" UserPopover FieldPlace = "userPopover" StringEditModal FieldPlace = "stringEditModal" StringDetails FieldPlace = "stringDetails" TranslationUnderContent FieldPlace = "translationUnderContent" )
type FieldResponse ¶ added in v0.4.0
type FieldResponse struct {
Data *Field `json:"data"`
}
FieldResponse defines the structure of a response when getting a field.
type FieldType ¶ added in v0.4.0
type FieldType string
const ( TypeCheckbox FieldType = "checkbox" TypeDate FieldType = "date" TypeDatetime FieldType = "datetime" TypeNumber FieldType = "number" TypeLabels FieldType = "labels" TypeSelect FieldType = "select" TypeMultiselect FieldType = "multiselect" TypeText FieldType = "text" TypeTextarea FieldType = "textarea" TypeURL FieldType = "url" )
type FieldsListOptions ¶ added in v0.4.0
type FieldsListOptions struct {
// Search fields by `slug` or `name`.
Search string `json:"search,omitempty"`
// Filter fields by entity.
// Enum: project, user, task, file, translation, string.
Entity FieldEntity `json:"entity,omitempty"`
// Filter fields by type.
// Enum: checkbox, radiobuttons, date, datetime, number, labels,
// select, multiselect, text, textarea, url.
Type FieldType `json:"type,omitempty"`
ListOptions
}
FieldsListOptions specifies the optional parameters to the FieldsService.List method.
type FieldsListResponse ¶ added in v0.4.0
type FieldsListResponse struct {
Data []*FieldResponse `json:"data"`
}
FieldsListResponse defines the structure of a response when getting a list of fields.
type File ¶
type File struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
BranchID *int `json:"branchId,omitempty"`
DirectoryID *int `json:"directoryId,omitempty"`
Name string `json:"name"`
Title *string `json:"title,omitempty"`
Context *string `json:"context,omitempty"`
Type string `json:"type"`
Path string `json:"path"`
Status string `json:"status"`
Fields any `json:"fields,omitempty"`
RevisionID int `json:"revisionId"`
Priority string `json:"priority"`
ImportOptions map[string]any `json:"importOptions,omitempty"`
ExportOptions map[string]any `json:"exportOptions,omitempty"`
ExcludeTargetLanguages []string `json:"excludedTargetLanguages,omitempty"`
ParserVersion *int `json:"parserVersion,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
}
File represents a project file.
type FileAddRequest ¶
type FileAddRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// File name.
// Note: Can't contain \ / : * ? " < > | symbols. ZIP files are not allowed.
Name string `json:"name"`
// Branch Identifier — defines branch to which file will be added.
// Note: Can't be used with directoryId in same request.
BranchID int `json:"branchId,omitempty"`
// Directory Identifier — defines directory to which file will be added.
// Note: Can't be used with branchId in same request.
DirectoryID int `json:"directoryId,omitempty"`
// Title is used to provide more details for translators.
// It is available in UI only.
Title string `json:"title,omitempty"`
// Context is used to provide context about whole file.
Context string `json:"context,omitempty"`
// Type of the file. Default: auto.
// Enum: auto, android, macosx, resx, properties, gettext, yaml, php, json,
// xml, ini, rc, resw, resjson, qtts, joomla, chrome, dtd, dklang,
// flex, nsh, wxl, xliff, xliff_two, html, haml, txt, csv, md, mdx_v1,
// mdx_v2, flsnp, fm_html, fm_md, mediawiki, docx, xlsx, sbv, properties_play,
// properties_xml, maxthon, go_json, dita, idml, mif, stringsdict, plist, vtt,
// vdf, srt, stf, toml, contentful_rt, svg, js, coffee, ts, i18next_json, xaml,
// arb, adoc, fbt, webxml, nestjs_i18n.
Type string `json:"type,omitempty"`
// Using latest parser version by default.
// Note: Must be used together with type.
ParserVersion int `json:"parserVersion,omitempty"`
// File import options.
ImportOptions FileImportOptions `json:"importOptions,omitempty"`
// File export options.
ExportOptions FileExportOptions `json:"exportOptions,omitempty"`
// Set Target Languages the file should not be translated into.
// Do not use this option if the file should be available for all project languages.
ExcludedTargetLanguages []string `json:"excludedTargetLanguages,omitempty"`
// Attach labels to strings.
AttachLabelIDs []int `json:"attachLabelIds,omitempty"`
// Fields.
Fields map[string]any `json:"fields,omitempty"`
}
FileAddRequest defines the structure of a request to create a new file.
func (*FileAddRequest) Validate ¶
func (r *FileAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FileExportOptions ¶
type FileExportOptions interface{ ValidateFileExportOptions() error }
type FileFormatSettings ¶
type FileFormatSettings interface {
ValidateSettings() error
}
type FileGetResponse ¶
type FileGetResponse struct {
Data *File `json:"data"`
}
FileGetResponse describes a response with a single file.
type FileImportOptions ¶
type FileImportOptions interface{ ValidateFileImportOptions() error }
type FileListOptions ¶
type FileListOptions struct {
// OrderBy is used to sort files.
// Enum: id, name, title, status, exportPattern, priority, createdAt, updatedAt.
// Default: id.
// Example: orderBy=createdAt desc,name,priority.
OrderBy string `json:"orderBy,omitempty"`
// BranchID is the ID of the branch to filter files by.
// Note: Can't be used with `directoryId` in the same request.
// To list the files from all the nested levels within the branch,
// ensure to use the `recursion` parameter with the `branchId` parameter.
BranchID int `json:"branchId,omitempty"`
// DirectoryID is the ID of the directory to filter files by.
// Note: Can't be used with `branchId` in the same request.
// To list the files from all the nested levels within the directory,
// ensure to use the `recursion` parameter with the `directoryId` parameter.
DirectoryID int `json:"directoryId,omitempty"`
// Filter files by name.
Filter string `json:"filter,omitempty"`
// Recursion is used to list files recursively.
// Note: Works only when `directoryID` or `branchID` parameter is specified.
Recursion any `json:"recursion,omitempty"`
ListOptions
}
FileListOptions specifies the optional parameters to the SourceFilesService.ListFiles method.
type FileListResponse ¶
type FileListResponse struct {
Data []*FileGetResponse `json:"data"`
}
FileListResponse describes a response with a list of files.
type FileRevision ¶
type FileRevision struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
FileID int `json:"fileId"`
RestoreToRevision *int `json:"restoreToRevision,omitempty"`
Info struct {
Added RevisionInfo `json:"added"`
Deleted RevisionInfo `json:"deleted"`
Updated RevisionInfo `json:"updated"`
} `json:"info"`
Date string `json:"date"`
}
FileRevision represents a file revision.
type FileRevisionListResponse ¶
type FileRevisionListResponse struct {
Data []*FileRevisionResponse `json:"data"`
}
FileRevisionListResponse describes a response with a list of file revisions.
type FileRevisionResponse ¶
type FileRevisionResponse struct {
Data *FileRevision `json:"data"`
}
FileRevisionResponse describes a response with a single file revision.
type FileUpdateRestoreRequest ¶
type FileUpdateRestoreRequest struct {
// Revision Identifier.
RevisionID int `json:"revisionId,omitempty"`
// Storage Identifier.
StorageID int `json:"storageId,omitempty"`
// File name.
// Note: Can't contain \ / : * ? " < > | symbols.
Name string `json:"name,omitempty"`
// Update Option defines whether to keep existing translations and
// approvals for updated strings. Default: `clear_translations_and_approvals`.
// Enum: `clear_translations_and_approvals`, `keep_translations`, `keep_translations_and_approvals`.
UpdateOption string `json:"updateOption,omitempty"`
// File import options.
ImportOptions FileImportOptions `json:"importOptions,omitempty"`
// File export options.
ExportOptions FileExportOptions `json:"exportOptions,omitempty"`
// Attach labels to updated strings.
AttachLabelIDs []int `json:"attachLabelIds,omitempty"`
// Detach labels from updated strings.
DetachLabelIDs []int `json:"detachLabelIds,omitempty"`
// Enable to replace context, that have been modified in Crowdin.
// Default: false.
ReplaceModifiedContext *bool `json:"replaceModifiedContext,omitempty"`
}
FileUpdateRestoreRequest defines the structure of a request to update or restore a file.
func (*FileUpdateRestoreRequest) Validate ¶
func (r *FileUpdateRestoreRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FilesSearchOptions ¶ added in v0.19.0
type FilesSearchOptions struct {
// Search files by `name` or `title` (required).
Filter string `json:"filter"`
// Project identifiers to search across (max 50).
// Omit to search all accessible projects.
// Note: On crowdin.com all projects must belong to the same owner.
ProjectIDs []int `json:"projectIds,omitempty"`
// Owner (user) whose projects to search when `projectIds` is omitted.
// Defaults to your own account.
// Note: Available for crowdin.com only.
UserID int `json:"userId,omitempty"`
ListOptions
}
FilesSearchOptions specifies the parameters to the SourceFilesService.SearchFiles method.
func (*FilesSearchOptions) Validate ¶ added in v0.19.0
func (o *FilesSearchOptions) Validate() error
Validate checks if the search options are valid.
type FineTuningDataset ¶ added in v0.12.0
type FineTuningDataset struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *FineTuningDatasetAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
FineTuningDataset represents a fine-tuning dataset.
type FineTuningDatasetAttributes ¶ added in v0.12.0
type FineTuningDatasetAttributes struct {
// Project identifiers from which the dataset will be generated.
// Note: Required if `tmIds` is not provided.
ProjectIDs []int `json:"projectIds,omitempty"`
// TM identifiers from which the dataset will be generated.
// Note: This parameter is not supported for the prompt with the
// external configuraion.
TMIDs []int `json:"tmIds,omitempty"`
// Purpose of the dataset. Enum: training, validation. Default: training.
Purpose string `json:"purpose,omitempty"`
// Start date for dataset generation.
DateFrom string `json:"dateFrom,omitempty"`
// End date for dataset generation.
DateTo string `json:"dateTo,omitempty"`
// Maximum dataset file size in bytes.
// Note: If not provided, default limits based on the model will be applied.
MaxFileSize int `json:"maxFileSize,omitempty"`
// Minimum number of examples in the dataset.
// Note: If not provided, default limits based on the model will be applied.
MinExamplesCount int `json:"minExamplesCount,omitempty"`
// Maximum number of examples in the dataset.
// Note: If not provided, default limits based on the model will be applied.
MaxExamplesCount int `json:"maxExamplesCount,omitempty"`
}
FineTuningDatasetAttributes represents the attributes of a fine-tuning dataset. It is used to generate a fine-tuning dataset.
func (*FineTuningDatasetAttributes) Validate ¶ added in v0.12.0
func (r *FineTuningDatasetAttributes) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FineTuningDatasetResponse ¶ added in v0.12.0
type FineTuningDatasetResponse struct {
Data *FineTuningDataset `json:"data"`
}
FineTuningDatasetResponse defines the structure of a response when getting a single fine-tuning dataset.
type FineTuningEvent ¶ added in v0.12.0
type FineTuningEvent struct {
ID string `json:"id"`
Type string `json:"type"` // enum: message, metrics
Message string `json:"message"`
Data *FineTuningEventData `json:"data,omitempty"`
CreatedAt string `json:"createdAt"`
}
FineTuningEvent represents a fine-tuning event.
type FineTuningEventData ¶ added in v0.12.0
type FineTuningEventData struct {
Step int `json:"step"`
TotalSteps int `json:"totalSteps"`
TrainingLoss float64 `json:"trainingLoss"`
ValidationLoss float64 `json:"validationLoss"`
FullValidationLoss float64 `json:"fullValidationLoss"`
}
FineTuningEventData represents the data of a fine-tuning event.
type FineTuningEventsListResponse ¶ added in v0.12.0
type FineTuningEventsListResponse struct {
Data []struct {
Data *FineTuningEvent `json:"data"`
} `json:"data"`
}
FineTuningEventsListResponse defines the structure of a response when getting a list of fine-tuning events.
type FineTuningJob ¶ added in v0.12.0
type FineTuningJob struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *FineTuningJobAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
FineTuningJob represents a fine-tuning job.
type FineTuningJobAttributes ¶ added in v0.12.0
type FineTuningJobAttributes struct {
DryRun bool `json:"dryRun"`
AIPromptID int `json:"aiPromptId"`
Hyperparameters *FineTuningJobHyperparameters `json:"hyperparameters"`
TrainingOptions *FineTuningJobOptions `json:"trainingOptions"`
ValidationOptions *FineTuningJobOptions `json:"validationOptions"`
BaseModel string `json:"baseModel"`
FineTunedModel string `json:"fineTunedModel"`
TrainedTokensCount int `json:"trainedTokensCount"`
TrainingDatasetURL string `json:"trainingDatasetUrl"`
ValidationDatasetURL string `json:"validationDatasetUrl"`
Metadata *FineTuningJobMetadata `json:"metadata"`
}
FineTuningJobAttributes represents the attributes of a fine-tuning job.
type FineTuningJobCreateRequest ¶ added in v0.12.0
type FineTuningJobCreateRequest struct {
// Options for generating the fine-tuning dataset.
TrainingOptions *FineTuningJobOptions `json:"trainingOptions"`
// Options for generating the fine-tuning dataset.
ValidationOptions *FineTuningJobOptions `json:"validationOptions,omitempty"`
// The hyperparameters used for the fine-tuning job.
Hyperparameters *FineTuningJobHyperparameters `json:"hyperparameters,omitempty"`
// Simulate the fine-tuning of job creation without actually
// creating them. Default: false.
DryRun *bool `json:"dryRun,omitempty"`
}
FineTuningJobCreateRequest defines the structure of a request to create a fine-tuning job.
func (*FineTuningJobCreateRequest) Validate ¶ added in v0.12.0
func (r *FineTuningJobCreateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FineTuningJobHyperparameters ¶ added in v0.12.0
type FineTuningJobHyperparameters struct {
// Number of examples in each batch. A larger batch size means that model
// parameters are updated less frequently, but with lower variance.
// Note: This parameter is not supported by Mistral AI.
BatchSize int `json:"batchSize,omitempty"`
// Scaling factor for the learning rate. A smaller learning rate may be useful
// to avoid overfitting. Note: This parameter is not supported by Mistral AI.
LearningRateMultiplier float64 `json:"learningRateMultiplier,omitempty"`
// The number of epochs to train the model for. An epoch refers to one full
// cycle through the training dataset.
NEpochs int `json:"nEpochs,omitempty"`
}
FineTuningJobHyperparameters represents the hyperparameters of a fine-tuning job.
type FineTuningJobMetadata ¶ added in v0.12.0
type FineTuningJobMetadata struct {
Cost float64 `json:"cost"`
CostCurrency string `json:"costCurrency"`
}
FineTuningJobMetadata represents the metadata of a fine-tuning job.
type FineTuningJobOptions ¶ added in v0.12.0
type FineTuningJobOptions struct {
// Project identifiers from which the dataset will be generated.
// Note: Required if `tmIds` is not provided.
ProjectIDs []int `json:"projectIds,omitempty"`
// TM identifiers from which the dataset will be generated.
// Note: This parameteris not supported for the prompt with
// external configuraion.
TMIDs []int `json:"tmIds,omitempty"`
// Start date for the dataset generation.
DateFrom string `json:"dateFrom,omitempty"`
// End date for the dataset generation.
DateTo string `json:"dateTo,omitempty"`
// Maximum dataset file size in bytes.
// Note: If not provided, default limits based on the model will be applied.
MaxFileSize int `json:"maxFileSize,omitempty"`
// Minimum number of examples in the dataset.
// Note: If not provided, default limits based on the model will be applied.
MinExamplesCount int `json:"minExamplesCount,omitempty"`
// Maximum number of examples in the dataset.
// Note: If not provided, default limits based on the model will be applied.
MaxExamplesCount int `json:"maxExamplesCount,omitempty"`
}
FineTuningJobOptions represents the options of a fine-tuning job.
type FineTuningJobResponse ¶ added in v0.12.0
type FineTuningJobResponse struct {
Data *FineTuningJob `json:"data"`
}
FineTuningJobResponse defines the structure of a response when getting a fine-tuning job.
type FineTuningJobsListOptions ¶ added in v0.12.0
type FineTuningJobsListOptions struct {
// Filter the collection by the specified status. It can be one status or
// a list of comma-separated ones.
// Enum: created, in_progress, canceled, failed, finished.
Statuses []string `json:"statuses,omitempty"`
// Sort the collection by the specified field. Example: orderBy=createdAt desc.
// Enum: createdAt, updatedAt, startedAt, finishedAt.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
FineTuningJobsListOptions specifies the optional parameters to the AIService.ListFineTuningJobs method.
type FineTuningJobsListResponse ¶ added in v0.12.0
type FineTuningJobsListResponse struct {
Data []*FineTuningJobResponse `json:"data"`
}
FineTuningJobsListResponse defines the structure of a response when getting a list of fine-tuning jobs.
type GeneralFileExportOptions ¶
type GeneralFileExportOptions struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
}
SpreadsheetsFileExportOptions implements the FileExportOptions interface.
func (*GeneralFileExportOptions) ValidateFileExportOptions ¶
func (o *GeneralFileExportOptions) ValidateFileExportOptions() error
type GlossariesListOptions ¶ added in v0.3.0
type GlossariesListOptions struct {
// Sort glossaries by specified field.
// Enum: id, name, groupId, userId, createdAt. Default: id.
// Example: orderBy=createdAt desc,name
OrderBy string `json:"orderBy,omitempty"`
// Group Identifier.
// Note: Set 0 to see glossaries of root group.
GroupID *int `json:"groupId,omitempty"`
// List glossaries of specific user.
UserID int `json:"userId,omitempty"`
// Filter glossaries by name.
Filter string `json:"filter,omitempty"`
ListOptions
}
GlossariesListOptions specifies the optional parameters to the GlossariesService.List method.
type GlossariesListResponse ¶ added in v0.3.0
type GlossariesListResponse struct {
Data []*GlossaryResponse `json:"data"`
}
GlossariesListResponse defines the structure of a response when getting a list of glossaries.
type Glossary ¶ added in v0.3.0
type Glossary struct {
ID int `json:"id"`
Name string `json:"name"`
GroupID int `json:"groupId"`
UserID int `json:"userId"`
Terms int `json:"terms"`
LanguageID string `json:"languageId"`
LanguageIDs []string `json:"languageIds"`
DefaultProjectIDs []int `json:"defaultProjectIds"`
ProjectIDs []int `json:"projectIds"`
WebURL string `json:"webUrl"`
CreatedAt string `json:"createdAt"`
}
Glossary represents a Crowdin glossary.
type GlossaryAddRequest ¶ added in v0.3.0
type GlossaryAddRequest struct {
// Glossary name.
Name string `json:"name"`
// Glossary Language Identifier.
LanguageID string `json:"languageId"`
// Group Identifier - defines group to which Glossary is added.
// If `0` – Glossary will be available for all projects and groups
// in your workspace. Default: 0.
GroupID *int `json:"groupId,omitempty"`
// the account (Crowdin) or the group (Crowdin Enterprise).
IsShared *bool `json:"isShared,omitempty"`
}
GlossaryAddRequest defines the structure of a request to add a glossary.
func (*GlossaryAddRequest) Validate ¶ added in v0.3.0
func (r *GlossaryAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GlossaryConcordanceSearchAllRequest ¶ added in v0.19.0
type GlossaryConcordanceSearchAllRequest struct {
GlossaryConcordanceSearchRequest
// Owner (user) whose glossaries to search. Only glossaries you own or manage
// are searched. Defaults to your own account.
// Note: Crowdin only.
UserID int `json:"userId,omitempty"`
}
GlossaryConcordanceSearchAllRequest defines the structure of a request to search for concordance in all glossaries available to the user.
func (*GlossaryConcordanceSearchAllRequest) Validate ¶ added in v0.19.0
func (r *GlossaryConcordanceSearchAllRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GlossaryConcordanceSearchRequest ¶ added in v0.3.0
type GlossaryConcordanceSearchRequest struct {
// Source Language Identifier.
SourceLanguageID string `json:"sourceLanguageId"`
// Target Language Identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Expressions to search.
Expressions []string `json:"expressions"`
}
GlossaryConcordanceSearchRequest defines the structure of a request to search for concordance in glossaries.
func (*GlossaryConcordanceSearchRequest) Validate ¶ added in v0.3.0
func (r *GlossaryConcordanceSearchRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GlossaryConcordanceSearchResponse ¶ added in v0.3.0
type GlossaryConcordanceSearchResponse struct {
Data []struct {
Data *ConcordanceSearch `json:"data"`
} `json:"data"`
}
GlossaryConcordanceSearchResponse defines the structure of a response when searching for concordance in glossaries.
type GlossaryExport ¶ added in v0.3.0
type GlossaryExport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
Format string `json:"format"`
ExportFields []string `json:"exportFields"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
GlossaryExport represents a glossary export status.
type GlossaryExportRequest ¶ added in v0.3.0
type GlossaryExportRequest struct {
// Export format.
// Enum: tbx, tbx_v3, csv, xlsx. Default: tbx.
Format string `json:"format,omitempty"`
// Array fields for export.
// Default: ["term","description","partOfSpeech"]
// Enum: term, description, partOfSpeech, type, status, gender, note, url,
// conceptDefinition, conceptSubject, conceptNote, conceptUrl, conceptFigure.
// Enterprise also accepts custom fields: `field_{fieldSlug}` for a term field
// and `conceptField_{fieldSlug}` for a concept field.
// Note: Used for export CSV or XLSX format only.
ExportFields []string `json:"exportFields,omitempty"`
// Determines whether the export keeps every term of a matching concept
// (`concepts`) or only the terms that match the active filters (`terms`).
// Enum: concepts, terms. Default: concepts.
ExportType string `json:"exportType,omitempty"`
// Filter terms by text.
Text string `json:"text,omitempty"`
// Defines whether the text search is case sensitive. Default: false.
// Note: Must be used together with `text`.
CaseSensitive *bool `json:"caseSensitive,omitempty"`
// Defines whether to use strict text search. Default: false.
// Note: Must be used together with `text`.
SearchStrict *bool `json:"searchStrict,omitempty"`
// Defines whether to search for a full match of the text. Default: false.
// Note: Must be used together with `text`.
SearchFullMatch *bool `json:"searchFullMatch,omitempty"`
// Filter terms by one or more statuses.
// Enum: PREFERRED, ADMITTED, NOT_RECOMMENDED, OBSOLETE, DRAFT.
Statuses []string `json:"statuses,omitempty"`
// Filter terms by one or more parts of speech.
// Enum: NOUN, VERB, ADJ, PRON, PROPN, DET, ADV, ADP, CCONJ, SCONJ, NUM,
// INTJ, AUX, PRT, SYM, X.
PartsOfSpeech []string `json:"partsOfSpeech,omitempty"`
// Filter terms by one or more types.
// Enum: FULL_FORM, ACRONYM, ABBREVIATION, SHORT_FORM, PHRASE, VARIANT.
Types []string `json:"types,omitempty"`
// Filter terms by one or more genders.
// Enum: MASCULINE, FEMININE, NEUTER, COMMON, OTHER.
Genders []string `json:"genders,omitempty"`
// Filter terms by one or more authors. Up to 50 values.
AuthorIDs []int `json:"authorIds,omitempty"`
// Filter terms by one or more language identifiers. Up to 50 values.
LanguageIDs []string `json:"languageIds,omitempty"`
// Export date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Export date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
GlossaryExportRequest defines the structure of a request to export a glossary.
func (*GlossaryExportRequest) Validate ¶ added in v0.3.0
func (r *GlossaryExportRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GlossaryExportResponse ¶ added in v0.3.0
type GlossaryExportResponse struct {
Data *GlossaryExport `json:"data"`
}
GlossaryExportResponse defines the structure of a response when exporting a glossary or getting the status of an export.
type GlossaryImport ¶ added in v0.3.0
type GlossaryImport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
StorageID int `json:"storageId"`
Scheme map[string]int `json:"scheme"`
FirstLineContainsHeader bool `json:"firstLineContainsHeader"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
GlossaryImport represents a glossary import status.
type GlossaryImportRequest ¶ added in v0.3.0
type GlossaryImportRequest struct {
// Storage Identifier. Supported file formats: TBX, CSV, XLS/XLSX
StorageID int `json:"storageId"`
// Defines data columns mapping. Acceptable value is combination of
// following constants:
// term_{%language_code%} – column with terms
// description_{%language_code%} – column with terms description
// partOfSpeech_{%language_code%} – column with terms part of speech
// status_{%language_code%} – column with terms status
// type_{%language_code%} – column with terms type
// gender_{%language_code%} – column with terms
// url_{%language_code%} – column with terms url
// note_{%language_code%} – column with terms note
// where %language_code% – placeholder for your language code
// conceptDefinition – column with concepts definition
// conceptSubject – column with concepts subject
// conceptNote – column with concepts note
// conceptUrl – column with concepts url
// conceptFigure – column with concepts figure
// Note: Used for upload of CSV or XLS/XLSX files only.
Scheme map[string]int `json:"scheme"`
// Defines whether file includes first row header that should not be imported.
// Default: false.
// Note: Used for upload of CSV or XLS/XLSX files only.
FirstLineContainsHeader *bool `json:"firstLineContainsHeader"`
}
GlossaryImportRequest defines the structure of a request to import a glossary.
func (*GlossaryImportRequest) Validate ¶ added in v0.3.0
func (r *GlossaryImportRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GlossaryImportResponse ¶ added in v0.3.0
type GlossaryImportResponse struct {
Data *GlossaryImport `json:"data"`
}
GlossaryImportResponse defines the structure of a response when importing a glossary or getting the status of an import.
type GlossaryResponse ¶ added in v0.3.0
type GlossaryResponse struct {
Data *Glossary `json:"data"`
}
GlossaryResponse defines the structure of a response when getting a glossary.
type GraphQLError ¶ added in v0.10.0
type GraphQLError struct {
Message string `json:"message"`
Extensions map[string]any `json:"extensions"`
Locations []struct {
Line int `json:"line"`
Column int `json:"column"`
} `json:"locations"`
}
GraphQLError represents a single GraphQL error.
func (GraphQLError) Error ¶ added in v0.10.0
func (e GraphQLError) Error() string
Error implements error interface.
type GraphQLErrorResponse ¶ added in v0.10.0
type GraphQLErrorResponse struct {
Errors []GraphQLError `json:"errors"`
}
GraphQLErrorResponse represents a GraphQL error response.
func (*GraphQLErrorResponse) Error ¶ added in v0.10.0
func (r *GraphQLErrorResponse) Error() string
Error implements the Error interface.
type Group ¶
type Group struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
ParentID int `json:"parentId"`
OrganizationID int `json:"organizationId"`
UserID int `json:"userId"`
SubgroupsCount int `json:"subgroupsCount"`
ProjectsCount int `json:"projectsCount"`
WebURL string `json:"webUrl"`
// Report settings template identifier. Available only for group
// managers and organization admins.
SavingsReportSettingsTemplateID *int `json:"savingsReportSettingsTemplateId,omitempty"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Group represents a Crowdin group.
type GroupPreTranslateAccuracySchema ¶ added in v0.19.0
type GroupPreTranslateAccuracySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Split into categories by match score. Ranges should be in
// descending order (e.g., 100-90, 89-80).
MatchScoreCategories []string `json:"matchScoreCategories,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Task identifiers. Used to generate report by tasks.
TaskIDs []int `json:"taskIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
GroupPreTranslateAccuracySchema defines the schema for the group pre-translation accuracy report.
func (*GroupPreTranslateAccuracySchema) ValidateGroupSchema ¶ added in v0.19.0
func (r *GroupPreTranslateAccuracySchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupPreTranslateAccuracy schema is valid.
type GroupQACheckIssuesSchema ¶ added in v0.18.0
type GroupQACheckIssuesSchema struct {
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
GroupQACheckIssuesSchema defines the schema for the group QA check issues report.
func (*GroupQACheckIssuesSchema) ValidateGroupSchema ¶ added in v0.18.0
func (r *GroupQACheckIssuesSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupQACheckIssues schema is valid.
type GroupReportGenerateRequest ¶ added in v0.4.0
type GroupReportGenerateRequest struct {
// Report name.
Name ReportName `json:"name"`
// Schema for the group report generation request.
// One of the following types:
// - GroupTransactionCostsPostEditingSchema
// - GroupTopMembersSchema
// - GroupTaskUsageSchema
// - GroupQACheckIssuesSchema
// - GroupTranslationActivitySchema
// - GroupSourceContentUpdatesSchema
// - GroupTimeSpentSchema
// - GroupPreTranslateAccuracySchema
// - GroupTranslatorAccuracySchema
// - GroupSavingActivitySchema
Schema ReportGroupSchema `json:"schema"`
}
GroupReportGenerateRequest defines the structure of a request to generate a group or organization report.
func (*GroupReportGenerateRequest) Validate ¶ added in v0.4.0
func (r *GroupReportGenerateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GroupSavingActivitySchema ¶ added in v0.19.0
type GroupSavingActivitySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Report mode. Enum: relative, currency.
// Note: `currency` mode is available only if the group has
// the savingsReportSettingsTemplateId set.
Mode string `json:"mode,omitempty"`
}
GroupSavingActivitySchema defines the schema for the group saving activity report.
func (*GroupSavingActivitySchema) ValidateGroupSchema ¶ added in v0.19.0
func (r *GroupSavingActivitySchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupSavingActivity schema is valid.
type GroupSourceContentUpdatesSchema ¶ added in v0.19.0
type GroupSourceContentUpdatesSchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
GroupSourceContentUpdatesSchema defines the schema for the group source content updates report.
func (*GroupSourceContentUpdatesSchema) ValidateGroupSchema ¶ added in v0.19.0
func (r *GroupSourceContentUpdatesSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupSourceContentUpdates schema is valid.
type GroupTaskUsageSchema ¶ added in v0.18.0
type GroupTaskUsageSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report type filter.
Type string `json:"type,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Group results by the specified attribute.
GroupBy string `json:"groupBy,omitempty"`
// Task type identifier filter.
TypeTasks int `json:"typeTasks,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Task creator identifier filter.
CreatorID int `json:"creatorId,omitempty"`
// Task assignee identifier filter.
AssigneeID int `json:"assigneeId,omitempty"`
// Words count from (used with type `time`).
WordsCountFrom int `json:"wordsCountFrom,omitempty"`
// Words count to (used with type `time`).
WordsCountTo int `json:"wordsCountTo,omitempty"`
// Task statuses to filter by (used with type `cost`).
// Enum: todo, in_progress, done, closed, review.
Statuses []string `json:"statuses,omitempty"`
}
GroupTaskUsageSchema defines the schema for the group task usage report.
func (*GroupTaskUsageSchema) ValidateGroupSchema ¶ added in v0.18.0
func (r *GroupTaskUsageSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupTaskUsage schema is valid.
type GroupTimeSpentSchema ¶ added in v0.19.0
type GroupTimeSpentSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Grouping parameter. Enum: user, language, task, project.
GroupBy string `json:"groupBy,omitempty"`
// Base rates. Only the `hourly` rate is used.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates. Only the `hourly` rate is used.
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Task type. Enum: 0 - translate, 1 - proofread,
// 2 - translate by vendor, 3 - proofread by vendor.
TypeTasks *int `json:"typeTasks,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Task identifiers.
TaskIDs []int `json:"taskIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
GroupTimeSpentSchema defines the schema for the group time spent report.
func (*GroupTimeSpentSchema) ValidateGroupSchema ¶ added in v0.19.0
func (r *GroupTimeSpentSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupTimeSpent schema is valid.
type GroupTopMembersSchema ¶ added in v0.4.0
type GroupTopMembersSchema struct {
// Project Identifier for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Defines report unit.
// Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
}
GroupTopMembersSchema defines the schema for the group top members report.
func (*GroupTopMembersSchema) ValidateGroupSchema ¶ added in v0.4.0
func (r *GroupTopMembersSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupTopMembers schema is valid.
type GroupTransactionCostsPostEditingSchema ¶ added in v0.4.0
type GroupTransactionCostsPostEditingSchema struct {
// Project Identifier for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Report unit.
// Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Report currency.
// Enum: USD, EUR, JPY, GBP, AUD, CAD, CHF, CNY, SEK, NZD, MXN,
// SGD, HKD, NOK, KRW, TRY, RUB, INR, BRL, ZAR, GEL, UAH, DDK
Currency string `json:"currency,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Base rates.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates (Custom rates for certain languages or users).
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Net Rate Schemes (Percentage paid of full translation rate).
// Note: A new translation will be included in the report at the lowest rate
// if multiple scheme categories can be applied to the translation.
NetRateSchemes *ReportNetRateSchemes `json:"netRateSchemes,omitempty"`
// Exclude approvals when the same user has made translations for the string.
//
// Deprecated: the API no longer supports this field.
ExcludeApprovalsForEditedTranslations *bool `json:"excludeApprovalsForEditedTranslations,omitempty"`
// Approvals are treated as submitting an identical translation at the
// 100% match rate of the corresponding category.
UseCategoryBasedProofreadRates *bool `json:"useCategoryBasedProofreadRates,omitempty"`
// Calculations are based on the edit distance between the TM match
// and final translation.
UseTmEditDistance *bool `json:"useTmEditDistance,omitempty"`
// Grouping parameter.
// Enum: user, language, project. Default: user.
GroupBy string `json:"groupBy,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// User Identifier for which the report should be generated.
UserIDs []int `json:"userIds,omitempty"`
// Task identifiers. Used to generate report by tasks.
TaskIDs []int `json:"taskIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
GroupTransactionCostsPostEditingSchema defines the schema for the group translation costs post-editing report.
func (*GroupTransactionCostsPostEditingSchema) ValidateGroupSchema ¶ added in v0.4.0
func (r *GroupTransactionCostsPostEditingSchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupCostsEstimationPostEditing schema is valid.
type GroupTranslationActivitySchema ¶ added in v0.18.0
type GroupTranslationActivitySchema struct {
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of user identifiers for filtering.
UserIDs []int `json:"userIds,omitempty"`
}
GroupTranslationActivitySchema defines the schema for the group translation activity report.
func (*GroupTranslationActivitySchema) ValidateGroupSchema ¶ added in v0.18.0
func (r *GroupTranslationActivitySchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupTranslationActivity schema is valid.
type GroupTranslatorAccuracySchema ¶ added in v0.19.0
type GroupTranslatorAccuracySchema struct {
// Split into categories by match score. Ranges should be in
// descending order (e.g., 100-90, 89-80).
MatchScoreCategories []string `json:"matchScoreCategories,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Project identifiers for which the report should be generated.
ProjectIDs []int `json:"projectIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
GroupTranslatorAccuracySchema defines the schema for the group translator accuracy report.
func (*GroupTranslatorAccuracySchema) ValidateGroupSchema ¶ added in v0.19.0
func (r *GroupTranslatorAccuracySchema) ValidateGroupSchema() error
ValidateGroupSchema checks if the GroupTranslatorAccuracy schema is valid.
type GroupsAddRequest ¶
type GroupsAddRequest struct {
// Group Name (required).
Name string `json:"name"`
// Parent Group Identifier.
ParentID int `json:"parentId,omitempty"`
// Group description.
Description string `json:"description,omitempty"`
// Report settings template identifier.
SavingsReportSettingsTemplateID int `json:"savingsReportSettingsTemplateId,omitempty"`
}
GroupsAddRequest defines the structure of a request to add a group.
func (*GroupsAddRequest) Validate ¶
func (r *GroupsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type GroupsGetResponse ¶
type GroupsGetResponse struct {
Data *Group `json:"data"`
}
GroupsGetResponse defines the structure of a response when retrieving a group.
type GroupsListOptions ¶
type GroupsListOptions struct {
ListOptions
// Parent group identifier.
ParentID int `json:"parentId,omitempty"`
// Sort a list of groups by a specified field.
// Example: orderBy=createdAt desc,name.
OrderBy string `json:"orderBy,omitempty"`
// Filter groups by `name`.
Filter string `json:"filter,omitempty"`
}
GroupsListOptions specifies the optional parameters to the GroupsService.List method.
type GroupsListResponse ¶
type GroupsListResponse struct {
Data []*GroupsGetResponse `json:"data"`
Pagination *Pagination `json:"pagination"`
}
GroupsListResponse defines the structure of a response when getting a list of groups.
type GroupsTeam ¶ added in v0.15.0
GroupsTeam represents a group team.
type GroupsTeamsData ¶ added in v0.15.0
type GroupsTeamsData struct {
Data []*TeamsGetResponse `json:"data"`
Pagination *Pagination `json:"pagination"`
}
GroupsTeamsData defines the structure of the response when list groups of teams.
type GroupsTeamsDataEdit ¶ added in v0.15.0
type GroupsTeamsDataEdit struct {
Data []*TeamsGetResponse `json:"data"`
}
GroupsTeamsDataEdit defines the structure of the response when edinting groups of teams.
type HTMLFileFormatSettings ¶
type HTMLFileFormatSettings struct {
CommonFileFormatSettings
// Specify CSS selectors for elements that should not be imported.
ExcludedElements []string `json:"excludedElements,omitempty"`
// Specify the inline tags.
InlineTags []string `json:"inlineTags,omitempty"`
}
type HTMLFileImportOptions ¶
type HTMLFileImportOptions struct {
// Specify CSS selectors for elements that should not be imported.
ExcludedElements []string `json:"excludedElements,omitempty"`
// Specify tags that should be considered inline.
InlineTags []string `json:"inlineTags,omitempty"`
// HTML attributes (e.g., src, href, data) will be imported as hidden strings.
// Default: false.
HideAttributeValues *bool `json:"hideAttributeValues,omitempty"`
CommonFileImportOptions
}
HTMLFileImportOptions implements the FileImportOptions interface.
type HTMLWithFrontMatterFileImportOptions ¶
type HTMLWithFrontMatterFileImportOptions struct {
// Specify CSS selectors for elements that should not be imported.
ExcludedElements []string `json:"excludedElements,omitempty"`
// Specify elements that should not be imported.
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Specify tags that should be considered inline.
InlineTags []string `json:"inlineTags,omitempty"`
// HTML attributes (e.g., src, href, data) will be imported as hidden strings.
// Default: false.
HideAttributeValues *bool `json:"hideAttributeValues,omitempty"`
CommonFileImportOptions
}
HTMLWithFrontMatterFileImportOptions implements the FileImportOptions interface.
type IDMLFileFormatSettings ¶
type IDMLFileFormatSettings struct {
CommonFileFormatSettings
// Defines whether to inline hyperlink text. Default: false.
InlineHyperlinkText *bool `json:"inlineHyperlinkText,omitempty"`
}
IDMLFileFormatSettings defines the IDML file format settings.
type IDMLFileImportOptions ¶ added in v0.19.0
type IDMLFileImportOptions struct {
// When checked, a hyperlink's text is extracted as part of the surrounding
// sentence so it can be translated in context. Default: false.
InlineHyperlinkText *bool `json:"inlineHyperlinkText,omitempty"`
CommonFileImportOptions
}
IDMLFileImportOptions implements the FileImportOptions interface.
type InstallApplicationRequest ¶ added in v0.5.0
type InstallApplicationRequest struct {
// Manifest URL of the application.
URL string `json:"url,omitempty"`
// Manifest is the inline manifest content of the application.
// Supported only for serverless apps (apps without `baseUrl`).
Manifest *ApplicationManifest `json:"manifest,omitempty"`
// Permissions to set for the application.
Permissions *ProjectPermission `json:"permissions,omitempty"`
// Modules with permissions to set for the application.
Modules []*InstallationModule `json:"modules,omitempty"`
// Assign Agent as a manager to all existing projects.
// Available only when installing from a manifest URL.
AssignAgent *bool `json:"assignAgent,omitempty"`
}
InstallApplicationRequest defines the structure of the request to install an application. Either URL or Manifest must be set.
func (*InstallApplicationRequest) Validate ¶ added in v0.5.0
func (r *InstallApplicationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type Installation ¶ added in v0.5.0
type Installation struct {
Identifier string `json:"identifier"`
Name string `json:"name"`
Description string `json:"description"`
Logo string `json:"logo"`
BaseURL string `json:"baseUrl"`
ManifestURL string `json:"manifestUrl"`
CreatedAt string `json:"createdAt"`
Modules []*Module `json:"modules"`
Scopes []string `json:"scopes"`
Permissions ProjectPermission `json:"permissions"`
DefaultPermissions struct {
User PermissionValue `json:"user"`
Project PermissionValue `json:"project"`
} `json:"defaultPermissions"`
LimitReached bool `json:"limitReached"`
// InstalledBy is the user who installed the application.
InstalledBy *ShortUser `json:"installedBy,omitempty"`
// LogoURL is the absolute URL the logo is served from.
LogoURL *string `json:"logoUrl,omitempty"`
// Agent is the agent user of the application.
Agent *ShortUser `json:"agent,omitempty"`
// Manifest is the manifest of the installation as authored.
// It is nil for applications installed from a manifest URL.
Manifest map[string]any `json:"manifest,omitempty"`
// ManifestUpdatedAt is the date when the installation's manifest was last synced.
ManifestUpdatedAt *string `json:"manifestUpdatedAt,omitempty"`
// IsManifestOutdated reports whether the installed manifest is outdated
// compared to the latest available manifest.
IsManifestOutdated bool `json:"isManifestOutdated"`
// StringBasedAvailable reports whether the app is offered in string-based projects.
StringBasedAvailable bool `json:"stringBasedAvailable"`
// Bundle describes where the app is loaded from.
Bundle *ApplicationBundle `json:"bundle,omitempty"`
}
Installation represents an application installation.
type InstallationModule ¶ added in v0.5.0
type InstallationModule struct {
Key string `json:"key,omitempty"`
Permissions UserPermission `json:"permissions,omitempty"`
}
type InstallationReplaceValue ¶ added in v0.5.0
type InstallationReplaceValue struct {
User Permission `json:"user,omitempty"`
// Available only for application permissions.
Project Permission `json:"project,omitempty"`
}
InstallationReplaceValue represents the structure of the values to be replaced. Can be used to update permissions or module permissions with the replace operation in the ApplicationsService.EditInstallation method.
type InstallationResponse ¶ added in v0.5.0
type InstallationResponse struct {
Data *Installation `json:"data"`
}
InstallationResponse defines the structure of the response when getting an installation.
type InstallationUpdate ¶ added in v0.19.0
type InstallationUpdate struct {
// Hash of the latest manifest. Pass it back in the apply request.
ManifestHash *string `json:"manifestHash"`
// Full latest manifest payload.
LatestManifest map[string]any `json:"latestManifest"`
// Scopes added in the latest manifest.
AddedScopes []string `json:"addedScopes"`
// Scopes removed in the latest manifest.
RemovedScopes []string `json:"removedScopes"`
// Modules added in the latest manifest.
AddedModules []map[string]any `json:"addedModules"`
// Modules removed in the latest manifest.
RemovedModules []map[string]any `json:"removedModules"`
// Modules that still exist but whose behavior fields (url, permissions) changed.
ChangedModules []map[string]any `json:"changedModules"`
// Lifecycle event URLs that changed (installed/uninstall/status).
ChangedEvents map[string]*InstallationUpdateChange `json:"changedEvents"`
// The baseUrl change (host that serves the app).
BaseURLChanged *InstallationUpdateChange `json:"baseUrlChanged"`
// Authentication type change. It cannot be applied as an update,
// the app must be uninstalled and reinstalled.
AuthenticationTypeChanged *InstallationUpdateChange `json:"authenticationTypeChanged"`
// Whether the manifest has any changes.
HasChanges bool `json:"hasChanges"`
}
InstallationUpdate represents a pending update (diff) between the installed application and the latest manifest.
type InstallationUpdateApplyRequest ¶ added in v0.19.0
type InstallationUpdateApplyRequest struct {
// Hash of the manifest version that was reviewed
// (from the ApplicationsService.GetInstallationUpdate response).
ManifestHash string `json:"manifestHash"`
}
InstallationUpdateApplyRequest defines the structure of the request to apply the latest manifest to an installed application.
func (*InstallationUpdateApplyRequest) Validate ¶ added in v0.19.0
func (r *InstallationUpdateApplyRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type InstallationUpdateChange ¶ added in v0.19.0
InstallationUpdateChange represents a change of a single value.
type InstallationUpdateResponse ¶ added in v0.19.0
type InstallationUpdateResponse struct {
Data *InstallationUpdate `json:"data"`
}
InstallationUpdateResponse defines the structure of the response when getting an application installation update.
type InstallationsListOptions ¶ added in v0.19.0
type InstallationsListOptions struct {
// Filter installations by the identifier of the user who installed the application.
InstalledBy int `json:"installedBy,omitempty"`
// Sort installations by the specified fields.
// Example: orderBy=createdAt desc,name.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
InstallationsListOptions specifies the optional parameters to the ApplicationsService.ListInstallationsWithOptions method.
type InstallationsListResponse ¶ added in v0.5.0
type InstallationsListResponse struct {
Data []*InstallationResponse `json:"data"`
}
InstallationsListResponse defines the structure of the response when getting a list of installations.
type IntegrationCrowdinFilesUpdateRequest ¶ added in v0.19.0
type IntegrationCrowdinFilesUpdateRequest struct {
// Project Identifier.
ProjectID int `json:"projectId"`
// Integration files to sync. Each file is a free-form object
// (e.g. id, name, parentId, type, node_type).
Files []map[string]any `json:"files"`
// Upload existing translations from the integration.
UploadTranslations *bool `json:"uploadTranslations,omitempty"`
}
IntegrationCrowdinFilesUpdateRequest defines the structure of the request to update Crowdin files from the integration.
func (*IntegrationCrowdinFilesUpdateRequest) Validate ¶ added in v0.19.0
func (r *IntegrationCrowdinFilesUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type IntegrationFileProgressResponse ¶ added in v0.19.0
type IntegrationFileProgressResponse struct {
Data *TranslationProgress `json:"data"`
}
IntegrationFileProgressResponse defines the structure of the response when getting file progress of an integration application.
type IntegrationFilesResponse ¶ added in v0.19.0
IntegrationFilesResponse defines the structure of the response when listing Crowdin or integration files of an integration application. Each file is a free-form object (e.g. id, name, parentId, type, node_type).
type IntegrationFilesUpdateRequest ¶ added in v0.19.0
type IntegrationFilesUpdateRequest struct {
// Project Identifier.
ProjectID int `json:"projectId"`
// Crowdin file ID mapped to the list of language IDs.
// Example: {"102": ["de", "fr"]}.
Files map[string][]string `json:"files"`
}
IntegrationFilesUpdateRequest defines the structure of the request to update integration files from Crowdin.
func (*IntegrationFilesUpdateRequest) Validate ¶ added in v0.19.0
func (r *IntegrationFilesUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type IntegrationJob ¶ added in v0.19.0
type IntegrationJob struct {
// The unique identifier for the job.
ID string `json:"id"`
// The progress of the job.
Progress int `json:"progress"`
// The current status of the job.
Status string `json:"status"`
// The title of the job.
Title string `json:"title"`
}
IntegrationJob represents a job of an integration application.
type IntegrationJobResult ¶ added in v0.19.0
type IntegrationJobResult struct {
JobID string `json:"jobId"`
}
IntegrationJobResult represents the result of starting an integration job.
type IntegrationJobResultResponse ¶ added in v0.19.0
type IntegrationJobResultResponse struct {
Data *IntegrationJobResult `json:"data"`
}
IntegrationJobResultResponse defines the structure of the response when starting an integration job.
type IntegrationJobsResponse ¶ added in v0.19.0
type IntegrationJobsResponse struct {
Data []*IntegrationJob `json:"data"`
}
IntegrationJobsResponse defines the structure of the response when getting integration jobs.
type IntegrationLoginField ¶ added in v0.19.0
IntegrationLoginField represents an integration login form field.
type IntegrationLoginFieldsResponse ¶ added in v0.19.0
type IntegrationLoginFieldsResponse struct {
Data []*IntegrationLoginField `json:"data"`
}
IntegrationLoginFieldsResponse defines the structure of the response when getting integration login form fields.
type IntegrationLoginRequest ¶ added in v0.19.0
type IntegrationLoginRequest struct {
// Project Identifier.
ProjectID int `json:"projectId"`
// Login form fields values. Get the keys via
// the ApplicationsService.ListIntegrationLoginFields method.
Credentials map[string]any `json:"credentials"`
}
IntegrationLoginRequest defines the structure of the request to log in to an integration.
func (*IntegrationLoginRequest) Validate ¶ added in v0.19.0
func (r *IntegrationLoginRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type IntegrationSettingsResponse ¶ added in v0.19.0
IntegrationSettingsResponse defines the structure of the response when getting integration application settings.
type IntegrationSettingsUpdateRequest ¶ added in v0.19.0
type IntegrationSettingsUpdateRequest struct {
// Project Identifier.
ProjectID int `json:"projectId"`
// Application settings.
Config map[string]any `json:"config"`
}
IntegrationSettingsUpdateRequest defines the structure of the request to update integration application settings.
func (*IntegrationSettingsUpdateRequest) Validate ¶ added in v0.19.0
func (r *IntegrationSettingsUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type IntegrationSyncProvider ¶ added in v0.19.0
type IntegrationSyncProvider string
IntegrationSyncProvider represents the provider of integration sync settings.
const ( // IntegrationSyncProviderCrowdin is the Crowdin provider. IntegrationSyncProviderCrowdin IntegrationSyncProvider = "crowdin" // IntegrationSyncProviderIntegration is the integration provider. IntegrationSyncProviderIntegration IntegrationSyncProvider = "integration" )
type IntegrationSyncSettingsResponse ¶ added in v0.19.0
type IntegrationSyncSettingsResponse struct {
Data any `json:"data"`
}
IntegrationSyncSettingsResponse defines the structure of the response when getting integration sync settings. The data is either an object (file ID to language IDs) or an array of file objects.
type IntegrationSyncSettingsUpdateRequest ¶ added in v0.19.0
type IntegrationSyncSettingsUpdateRequest struct {
// Project Identifier.
ProjectID int `json:"projectId"`
// Provider. Enum: crowdin, integration.
Provider IntegrationSyncProvider `json:"provider"`
// Files to sync. Either an object (file ID to language IDs,
// e.g. map[string][]string) or an array of file objects
// (e.g. []map[string]any).
Files any `json:"files"`
}
IntegrationSyncSettingsUpdateRequest defines the structure of the request to update integration sync settings.
func (*IntegrationSyncSettingsUpdateRequest) Validate ¶ added in v0.19.0
func (r *IntegrationSyncSettingsUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type InviteUserRequest ¶ added in v0.3.0
type InviteUserRequest struct {
// Invited user email.
Email string `json:"email"`
// Invited user first name.
FirstName string `json:"firstName,omitempty"`
// Invited user last name.
LastName string `json:"lastName,omitempty"`
// Invited user timezone.
Timezone string `json:"timezone,omitempty"`
// Grant admin access to an organization.
// Default: false.
AdminAccess *bool `json:"adminAccess,omitempty"`
}
InviteUserRequest defines the structure of the request when inviting a new user.
func (*InviteUserRequest) Validate ¶ added in v0.3.0
func (r *InviteUserRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type JSONFileFormatSettings ¶
type JSONFileFormatSettings struct {
CommonFileFormatSettings
// Enum: "i18next_json", "nestjs_i18n".
Type string `json:"type,omitempty"`
}
type JavaScriptFileExportOptions ¶
type JavaScriptFileExportOptions struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Acceptable values are: `single`, `double`. Default is `single`.
// `single` - Output will be enclosed in single quotes.
// `double` - Output will be enclosed in double quotes.
ExportQuotes string `json:"exportQuotes,omitempty"`
}
JavaScriptFileExportOptions implements the FileExportOptions interface.
func (*JavaScriptFileExportOptions) ValidateFileExportOptions ¶
func (o *JavaScriptFileExportOptions) ValidateFileExportOptions() error
type JavaScriptFileFormatSettings ¶
type JavaScriptFileFormatSettings struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
// Enum: "single" "double". Default: "single".
// single - Output will be enclosed in single quotes.
// double - Output will be enclosed in double quotes.
ExportQuotes *string `json:"exportQuotes,omitempty"`
}
func (*JavaScriptFileFormatSettings) ValidateSettings ¶
func (p *JavaScriptFileFormatSettings) ValidateSettings() error
type Label ¶ added in v0.2.0
type Label struct {
ID int `json:"id"`
Title string `json:"title"`
// therefore read-only (Crowdin Enterprise only).
IsShared *bool `json:"isShared,omitempty"`
// Indicates whether the label is a system label (string-based projects only).
IsSystem *bool `json:"isSystem,omitempty"`
}
Label represents a Crowdin label.
type LabelAddRequest ¶ added in v0.2.0
type LabelAddRequest struct {
// Label title.
Title string `json:"title"`
}
LabelAddRequest defines the structure of a request to add a label.
func (*LabelAddRequest) Validate ¶ added in v0.2.0
func (r *LabelAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type LabelResponse ¶ added in v0.2.0
type LabelResponse struct {
Data *Label `json:"data"`
}
LabelResponse defines the structure of a response when getting a label.
type LabelsListOptions ¶ added in v0.2.0
type LabelsListOptions struct {
// Sort labels by the specified field. Enum: id, title. Default: id.
// Example: orderBy=title desc,id
OrderBy string `json:"orderBy,omitempty"`
// Filter labels by isSystem value. Enum: 0, 1.
// Note: Available for string-based projects only.
IsSystem *int `json:"isSystem,omitempty"`
ListOptions
}
LabelsListOptions specifies the optional parameters to the LabelsService.List method.
type LabelsListResponse ¶ added in v0.2.0
type LabelsListResponse struct {
Data []*LabelResponse `json:"data"`
}
LabelsListResponse defines the structure of a response when getting a list of labels.
type Language ¶
type Language struct {
ID string `json:"id"`
Name string `json:"name"`
EditorCode string `json:"editorCode"`
TwoLettersCode string `json:"twoLettersCode"`
ThreeLettersCode string `json:"threeLettersCode"`
Locale string `json:"locale"`
AndroidCode string `json:"androidCode"`
BCP47Code string `json:"bcp47Code"`
OSXCode string `json:"osxCode"`
OSXLocale string `json:"osxLocale"`
PluralCategoryNames []string `json:"pluralCategoryNames"`
PluralRules string `json:"pluralRules"`
PluralExamples []string `json:"pluralExamples"`
TextDirection string `json:"textDirection"`
DialectOf string `json:"dialectOf"`
}
Language represents a language in Crowdin.
type LanguageAccess ¶ added in v0.3.0
type LanguageAccess struct {
// Access to all workflow steps for given language.
// Default: false.
AllContent *bool `json:"allContent,omitempty"`
// Workflow Step Identifiers.
WorkflowStepIDs []int `json:"workflowStepIds,omitempty"`
}
LanguageAccess represents access to a language.
type LanguageMapping ¶ added in v0.2.0
type LanguageMapping struct {
Name string `json:"name"`
TwoLettersCode string `json:"two_letters_code"`
ThreeLettersCode string `json:"three_letters_code"`
Locale string `json:"locale"`
LocaleWithUnderscore string `json:"locale_with_underscore"`
AndroidCode string `json:"android_code"`
OSXCode string `json:"osx_code"`
OSXLocale string `json:"osx_locale"`
}
LanguageMapping represents a project language mapping.
type LanguageRecognitionProvider ¶ added in v0.3.0
type LanguageRecognitionProvider string
LanguageRecognitionProvider represents a provider for language recognition services. It is one of the following values: crowdin, engine.
const ( // LanguageRecognitionProviderCrowdin represents the crowdin language recognition provider. LanguageRecognitionProviderCrowdin LanguageRecognitionProvider = "crowdin" // LanguageRecognitionProviderEngine represents the engine language recognition provider. LanguageRecognitionProviderEngine LanguageRecognitionProvider = "engine" )
type LanguageReport ¶ added in v0.18.0
type LanguageReport struct {
ID string `json:"id"`
Files []*LanguageReportFile `json:"files"`
Skipped *LanguageReportSkipped `json:"skipped,omitempty"`
SkippedQaCheckCategories *LanguageReportSkippedQaCheckCategories `json:"skippedQaCheckCategories,omitempty"`
}
type LanguageReportFile ¶ added in v0.18.0
type LanguageReportFile struct {
ID string `json:"id"`
Statistics *LanguageReportStatistics `json:"statistics"`
}
type LanguageReportSkipped ¶ added in v0.18.0
type LanguageReportSkippedQaCheckCategories ¶ added in v0.18.0
type LanguageReportStatistics ¶ added in v0.18.0
type LanguageServicePendingTaskCreateForm
deprecated
added in
v0.3.0
type LanguageServicePendingTaskCreateForm struct {
// Translate task identifier.
PrecedingTaskID int `json:"precedingTaskId"`
// Task type. Enum: 3 - proofread by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: "crowdin_language_service".
Vendor TaskVendor `json:"vendor"`
// Task title.
Title string `json:"title"`
// Task description.
Description string `json:"description,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
}
LanguageServicePendingTaskCreateForm defines the structure of the request to create a pending Crowdin Language Service task.
Deprecated: use PendingTaskCreateForm with the Vendor field instead.
func (*LanguageServicePendingTaskCreateForm) Validate ¶ added in v0.3.0
func (r *LanguageServicePendingTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*LanguageServicePendingTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *LanguageServicePendingTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type LanguageServiceTaskCreateForm
deprecated
added in
v0.3.0
type LanguageServiceTaskCreateForm struct {
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 2 - translate by vendor, 3 - proofread by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: "crowdin_language_service".
Vendor TaskVendor `json:"vendor"`
// Branch identifiers.
// One of branchIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// String identifiers.
// One of branchIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers.
// One of branchIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Defines whether to include only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false` or
// `includeUntranslatedStringsOnly=true` in the same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
LanguageServiceTaskCreateForm defines the structure of the request to create a Crowdin Language Service task.
Deprecated: use VendorTaskCreateForm instead.
func (*LanguageServiceTaskCreateForm) Validate ¶ added in v0.3.0
func (r *LanguageServiceTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*LanguageServiceTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *LanguageServiceTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type LanguageTranslation ¶
type LanguageTranslation struct {
StringID int `json:"stringId"`
ContentType string `json:"contentType"`
TranslationID *int `json:"translationId,omitempty"`
Text *string `json:"text,omitempty"`
User *ShortUser `json:"user,omitempty"`
CreatedAt *string `json:"createdAt,omitempty"`
Provider *string `json:"provider,omitempty"`
ProviderID *int `json:"providerId,omitempty"`
IsPreTranslated *bool `json:"isPreTranslated,omitempty"`
MatchRate *int `json:"matchRate,omitempty"`
MatchType *string `json:"matchType,omitempty"`
// QA Issues Status. Enum: inProgress, failed, passed.
QAIssuesStatus *string `json:"qaIssuesStatus,omitempty"`
// Asset URL. Present for asset translations.
URL *string `json:"url,omitempty"`
Plurals []*LanguageTranslationPlural `json:"plurals,omitempty"`
}
LanguageTranslation represents a language translation. Contains the plain, plural, or ICU translation.
type LanguageTranslationPlural ¶
type LanguageTranslationPlural struct {
TranslationID int `json:"translationId"`
Text string `json:"text"`
PluralForm string `json:"pluralForm"`
User *ShortUser `json:"user"`
CreatedAt string `json:"createdAt"`
Provider *string `json:"provider,omitempty"`
ProviderID *int `json:"providerId,omitempty"`
IsPreTranslated *bool `json:"isPreTranslated,omitempty"`
MatchRate *int `json:"matchRate,omitempty"`
MatchType *string `json:"matchType,omitempty"`
}
LanguageTranslationPlural represents a plural language translation and is part of the LanguageTranslation.
type LanguageTranslationsListOptions ¶
type LanguageTranslationsListOptions struct {
// Sort a list of translations.
// Enum: text, stringId, translationId, createdAt. Default: stringId.
// Example: orderBy=createdAt desc,text
OrderBy string `json:"orderBy,omitempty"`
// String Identifiers. Filter translations by `stringIds`.
// Example: stringIds=1,2,3,4,5
StringIDs []int `json:"stringIds,omitempty"`
// Label Identifiers. Filter translations by `labelIds`.
// Example: labelIds=1,2,3,4,5
LabelIDs []int `json:"labelIds,omitempty"`
// File Identifier. Filter translations by `fileId`.
// Note: Can't be used with `branchId` or `directoryId` in the same request.
FileID int `json:"fileId,omitempty"`
// Branch Identifier. Filter translations by `branchId`.
// Note: Can't be used with `fileId` or `directoryId` in the same request.
BranchID int `json:"branchId,omitempty"`
// Directory Identifier. Filter translations by `directoryId`.
// Note: Can't be used with `fileId` or `branchId` in the same request.
DirectoryID int `json:"directoryId,omitempty"`
// Filter translations by CroQL.
// Note: Can't be used with `stringIds`, `labelIds` or `fileId`
// in the same request.
CroQL string `json:"croql,omitempty"`
// Enable denormalize placeholders.
// Enum: 0, 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
// Only approved translations. Enum: 0, 1.
// Note: Can't be used with `croql` in the same request. Available only for Crowdin.
ApprovedOnly *int `json:"approvedOnly,omitempty"`
// Only translations that passed workflow. Enum: 0, 1.
// Note: Can't be used with `minApprovalCount` in the same request.
// Available only for Crowdin Enterprise.
PassedWorkflow *int `json:"passedWorkflow,omitempty"`
// Minimum approval count.
// Note: Can't be used with `passedWorkflow` in the same request.
// Available only for Crowdin Enterprise.
MinApprovalCount int `json:"minApprovalCount,omitempty"`
ListOptions
}
LanguageTranslationsListOptions specifies the optional parameters to the StringTranslationsService.ListLanguageTranslations method.
type LanguageTranslationsListResponse ¶
type LanguageTranslationsListResponse struct {
Data []struct {
Data *LanguageTranslation `json:"data"`
} `json:"data"`
}
LanguageTranslationsGetResponse defines the structure of the response when retrieving a list of language translations.
type LanguagesAccess ¶ added in v0.9.0
type LanguagesAccess map[string]*LanguageAccess
LanguagesAccess store the access to specific languages. It is a custom type used to unmarshal the JSON response.
func (*LanguagesAccess) UnmarshalJSON ¶ added in v0.9.0
func (l *LanguagesAccess) UnmarshalJSON(data []byte) error
UnmarshalJSON handles the unmarshaling of LanguagesAccess from both empty arrays and maps.
type LanguagesDetails ¶ added in v0.3.0
type LanguagesGetResponse ¶
type LanguagesGetResponse struct {
Data *Language `json:"data"`
}
LanguagesGetResponse defines the structure of a response when getting a single language.
type LanguagesListResponse ¶
type LanguagesListResponse struct {
Data []*LanguagesGetResponse `json:"data"`
Pagination *Pagination `json:"pagination"`
}
LanguagesListResponse defines the structure of a response when getting a list of languages.
type ListOptions ¶
type ListOptions struct {
// A maximum number of items to retrieve (default 25, max 500).
Limit int `json:"limit,omitempty"`
// A starting offset in the collection of items (default 0).
Offset int `json:"offset,omitempty"`
}
ListOptions specifies the optional parameters to methods that support pagination.
type LogEvent ¶ added in v0.4.0
type LogEvent string
LogEvent is a type representing a security log event.
const ( Login LogEvent = "login" PasswordSet LogEvent = "password.set" PasswordChange LogEvent = "password.change" EmailChange LogEvent = "email.change" LoginChange LogEvent = "login.change" PersonalTokenIssued LogEvent = "personal_token.issued" PersonalTokenRevoked LogEvent = "personal_token.revoked" MFAEnabled LogEvent = "mfa.enabled" MFADisabled LogEvent = "mfa.disabled" SessionRevoke LogEvent = "session.revoke" SessionRevokeAll LogEvent = "session.revoke_all" SSOConnect LogEvent = "sso.connect" SSODisconnect LogEvent = "sso.disconnect" UserRegistered LogEvent = "user.registered" UserRemove LogEvent = "user.remove" ApplicationConnected LogEvent = "application.connected" ApplicationDisconnected LogEvent = "application.disconnected" WebAuthnCreated LogEvent = "webauthn.created" WebAuthnDeleted LogEvent = "webauthn.deleted" TrustedDeviceRemove LogEvent = "trusted_device.remove" TrustedDeviceRemoveAll LogEvent = "trusted_device.remove_all" DeviceVerificationEnabled LogEvent = "device_verification.enabled" DeviceVerificationDisabled LogEvent = "device_verification.disabled" )
type MDFileExportOptions ¶ added in v0.19.0
type MDFileExportOptions struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Marker to use for strong. Enum: asterisk, underscore. Default: asterisk.
StrongMarker string `json:"strongMarker,omitempty"`
// Marker to use for emphasis. Enum: asterisk, underscore. Default: underscore.
EmphasisMarker string `json:"emphasisMarker,omitempty"`
// Marker to use for unordered list bullet. Enum: asterisks, plus, dash. Default: dash.
UnorderedListBullet string `json:"unorderedListBullet,omitempty"`
// Table formatting. Enum: consolidate, evenly_distribute_cells.
// Default: evenly_distribute_cells.
TableColumnWidth string `json:"tableColumnWidth,omitempty"`
// Export front matter values in quotes. Enum: auto, single, double. Default: auto.
// Note: Markdown files only.
FrontMatterQuotes string `json:"frontMatterQuotes,omitempty"`
}
MDFileExportOptions implements the FileExportOptions interface. It is also used for MDX v1 and MDX v2 files (`frontMatterQuotes` is supported for Markdown files only).
func (*MDFileExportOptions) ValidateFileExportOptions ¶ added in v0.19.0
func (o *MDFileExportOptions) ValidateFileExportOptions() error
type MDFileFormatSettings ¶
type MDFileFormatSettings struct {
CommonFileFormatSettings
// Specify the inline tags.
InlineTags []string `json:"inlineTags,omitempty"`
// Defines the marker used for bold text. Enum: "asterisk", "underscore". Default: "asterisk".
StrongMarker string `json:"strongMarker,omitempty"`
// Defines the marker used for italic text. Enum: "asterisk", "underscore". Default: "underscore".
EmphasisMarker string `json:"emphasisMarker,omitempty"`
// Defines the bullet used for unordered lists. Enum: "asterisks", "plus", "dash". Default: "dash".
UnorderedListBullet string `json:"unorderedListBullet,omitempty"`
// Defines the table column width. Enum: "consolidate", "evenly_distribute_cells".
// Default: "evenly_distribute_cells".
TableColumnWidth string `json:"tableColumnWidth,omitempty"`
// Defines the quotes used in front matter. Enum: "auto", "single", "double". Default: "auto".
FrontMatterQuotes string `json:"frontMatterQuotes,omitempty"`
}
MDFileFormatSettings defines the Markdown file format settings.
type MDFileImportOptions ¶ added in v0.19.0
type MDFileImportOptions struct {
// Specify elements that should not be imported.
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Defines whether to import code blocks. Default: false.
ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"`
// Specify tags that should be considered inline.
InlineTags []string `json:"inlineTags,omitempty"`
CommonFileImportOptions
}
MDFileImportOptions implements the FileImportOptions interface.
type MDXV1FileFormatSettings ¶
type MDXV1FileFormatSettings struct {
CommonFileFormatSettings
// Specify elements that should not be imported.
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Defines whether to import code blocks. Default: false.
ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"`
// Default: "mdx_v1". Enum: "mdx_v1", "mdx_v2"
Type string `json:"type,omitempty"`
// Defines the marker used for bold text. Enum: "asterisk", "underscore". Default: "asterisk".
StrongMarker string `json:"strongMarker,omitempty"`
// Defines the marker used for italic text. Enum: "asterisk", "underscore". Default: "underscore".
EmphasisMarker string `json:"emphasisMarker,omitempty"`
// Defines the bullet used for unordered lists. Enum: "asterisks", "plus", "dash". Default: "dash".
UnorderedListBullet string `json:"unorderedListBullet,omitempty"`
// Defines the table column width. Enum: "consolidate", "evenly_distribute_cells".
// Default: "evenly_distribute_cells".
TableColumnWidth string `json:"tableColumnWidth,omitempty"`
}
type MDXV1FileImportOptions ¶
type MDXV1FileImportOptions struct {
// Specify elements that should not be imported
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Defines whether to import code blocks. Default: false.
ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"`
CommonFileImportOptions
}
MDXV1FileImportOptions implements the FileImportOptions interface.
type MDXV2FileFormatSettings ¶
type MDXV2FileFormatSettings struct {
CommonFileFormatSettings
// Specify elements that should not be imported.
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Defines whether to import code blocks. Default: false.
ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"`
// Defines the marker used for bold text. Enum: "asterisk", "underscore". Default: "asterisk".
StrongMarker string `json:"strongMarker,omitempty"`
// Defines the marker used for italic text. Enum: "asterisk", "underscore". Default: "underscore".
EmphasisMarker string `json:"emphasisMarker,omitempty"`
// Defines the bullet used for unordered lists. Enum: "asterisks", "plus", "dash". Default: "dash".
UnorderedListBullet string `json:"unorderedListBullet,omitempty"`
// Defines the table column width. Enum: "consolidate", "evenly_distribute_cells".
// Default: "evenly_distribute_cells".
TableColumnWidth string `json:"tableColumnWidth,omitempty"`
}
type MDXV2FileImportOptions ¶
type MDXV2FileImportOptions struct {
// Specify elements that should not be imported
ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"`
// Defines whether to import code blocks. Default: false.
ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"`
CommonFileImportOptions
}
MDXV2FileImportOptions implements the FileImportOptions interface.
type MIFFileFormatSettings ¶
type MIFFileFormatSettings struct{ CommonFileFormatSettings }
type MTAddRequest ¶ added in v0.3.0
type MTAddRequest struct {
// Machine Translation engine name.
Name string `json:"name"`
// MT engine type.
// Enum: google, google_automl, microsoft, deepl,
// amazon, modernmt, custom_mt.
Type string `json:"type"`
// MT engine credentials.
Credentials *MTECredentials `json:"credentials"`
// Group Identifier that defines the group to which the MT is added.
// If `0`, the MT will be available for all projects and groups
// in your workspace.
// Default: 0.
GroupID *int `json:"groupId,omitempty"`
// List of language IDs.
EnabledLanguageIDs []string `json:"enabledLanguageIds,omitempty"`
// List of project IDs.
EnabledProjectIDs []int `json:"enabledProjectIds,omitempty"`
// Defines whether to enable the MT engine.
// Default: true.
IsEnabled *bool `json:"isEnabled,omitempty"`
}
MTAddRequest defines the structure of a request to add a machine translation engine.
func (*MTAddRequest) Validate ¶ added in v0.3.0
func (r *MTAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type MTECredentials ¶ added in v0.3.0
type MTECredentials struct {
APIKey string `json:"apiKey,omitempty"`
Credentials string `json:"credentials,omitempty"`
Model string `json:"model,omitempty"`
IsSystemCredentials *bool `json:"isSystemCredentials,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
AccessKey string `json:"accessKey,omitempty"`
SecretKey string `json:"secretKey,omitempty"`
URL string `json:"url,omitempty"`
}
MTECredentials represents the credentials for a machine translation engine. The structure of the credentials field depends on the type of the MT engine. The following are the possible fields for each type of MT engine:
Google Translate:
APIKey (string): Your Google Translate API key.
Google AutoML Translate:
Credentials (string): Your Google Translate credentials as a
JSON (base64 encoded) file.
Microsoft Translate:
APIKey (string): Your Microsoft Translate API key. Model (string): Custom model (optional).
DeepL Pro:
APIKey (string): Your DeepL Pro API key.
IsSystemCredentials (bool): This option will enable the paid service
DeepL via Crowdin. Default: false.
Amazon Translate:
AccessKey (string): Your Amazon Translate access key. SecretKey (string): Your Amazon Translate secret key.
ModernMT Translate:
APIKey (string): Your ModernMT Translate API key.
Custom MT Translate:
URL (string): Your custom MT engine URL.
type MTListOptions ¶ added in v0.3.0
type MTListOptions struct {
// Group Identifier.
// Note: Set `0` to see MTs of root group.
GroupID *int `json:"groupId,omitempty"`
ListOptions
}
MTListOptions specifies the optional parameters to the MachineTranslationEnginesService.List method.
type MTTranslation ¶ added in v0.3.0
type MTTranslation struct {
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageID string `json:"targetLanguageId"`
Strings []string `json:"strings"`
Translations []string `json:"translations"`
}
MTTranslation represents a translation using a machine translation engine.
type MTTranslationResponse ¶ added in v0.3.0
type MTTranslationResponse struct {
Data *MTTranslation `json:"data"`
}
MTTranslationResponse defines the structure of a response to get a translation using a MTE.
type MacOSFileFormatSettings ¶
type MacOSFileFormatSettings struct{ CommonFileFormatSettings }
type MachineTranslation ¶ added in v0.3.0
type MachineTranslation struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Credentials struct {
CrowdinNMT string `json:"crowdin_nmt"`
CrowdinNMTMultiTranslations string `json:"crowdin_nmt_multi_translations"`
} `json:"credentials"`
SupportedLanguageIDs []string `json:"supportedLanguageIds"`
SupportedLanguagePairs map[string][]string `json:"supportedLanguagePairs"`
GroupID *int `json:"groupId,omitempty"`
EnabledLanguageIDs []string `json:"enabledLanguageIds,omitempty"`
EnabledProjectIDs []int `json:"enabledProjectIds,omitempty"`
ProjectIDs []int `json:"projectIds,omitempty"`
IsEnabled *bool `json:"isEnabled,omitempty"`
}
MachineTranslation represents a machine translation engine (MTE).
type MachineTranslationsListResponse ¶ added in v0.3.0
type MachineTranslationsListResponse struct {
Data []*MachineTranslationsResponse `json:"data"`
}
MachineTranslationsListResponse defines the structure of a response to list machine translation engines.
type MachineTranslationsResponse ¶ added in v0.3.0
type MachineTranslationsResponse struct {
Data *MachineTranslation `json:"data"`
}
MachineTranslationsResponse defines the structure of a response to get a machine translation engine.
type MadCapFLSNPFileFormatSettings ¶
type MadCapFLSNPFileFormatSettings struct{ CommonFileFormatSettings }
type ManagerGetResponse ¶ added in v0.15.0
type ManagerGetResponse struct {
Data *Manager `json:"data"`
}
ManagerGetResponse defines the structure of the response when getting a group manager.
type ManagerListOptions ¶ added in v0.15.0
type ManagerListOptions struct {
// Filter by team identifiers.
TeamIDs []int `json:"teamIds,omitempty"`
// Sort a list of managers by a specified field.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
ManagerListOptions specifies the optional parameters to the GroupManagersService.List method.
type ManagerResponse ¶ added in v0.15.0
type ManagerResponse struct {
Data []*ManagerGetResponse `json:"data"`
}
ManagerResponse defines the structure of the response when getting a list of group managers.
type MediaWikiFileFormatSettings ¶
type MediaWikiFileFormatSettings struct {
// Storage identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
// File format export pattern. Defines file name and path in resulting
// translations bundle.
// Default: null. Note: Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
}
func (*MediaWikiFileFormatSettings) ValidateSettings ¶
func (p *MediaWikiFileFormatSettings) ValidateSettings() error
type Module ¶ added in v0.5.0
type Module struct {
Key string `json:"key"`
Type string `json:"type"`
Data any `json:"data"`
Permissions UserPermission `json:"permissions"`
AuthenticationType string `json:"authenticationType"`
// Integration module fields.
Identifier *string `json:"identifier,omitempty"`
Scopes any `json:"scopes,omitempty"`
Iframe any `json:"iframe,omitempty"`
// Module type specific fields. Each field is present only
// for the module types that support it.
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
URL *string `json:"url,omitempty"`
Logo *string `json:"logo,omitempty"`
LogoURL *string `json:"logoUrl,omitempty"`
BaseURL *string `json:"baseUrl,omitempty"`
Modes any `json:"modes,omitempty"`
Mode *string `json:"mode,omitempty"`
Options any `json:"options,omitempty"`
SignaturePatterns any `json:"signaturePatterns,omitempty"`
FileNamePattern *string `json:"fileNamePattern,omitempty"`
FileType *string `json:"fileType,omitempty"`
Multilingual *bool `json:"multilingual,omitempty"`
Severity *string `json:"severity,omitempty"`
Category *string `json:"category,omitempty"`
RefreshPolicy *string `json:"refreshPolicy,omitempty"`
Title *string `json:"title,omitempty"`
Summary *string `json:"summary,omitempty"`
RecheckURL *string `json:"recheckUrl,omitempty"`
ConfiguratorIframe any `json:"configuratorIframe,omitempty"`
CompileURL *string `json:"compileUrl,omitempty"`
ChatCompletionsURL *string `json:"chatCompletionsUrl,omitempty"`
ModelsURL *string `json:"modelsUrl,omitempty"`
Placement *string `json:"placement,omitempty"`
InputSchemaURL *string `json:"inputSchemaUrl,omitempty"`
OutputSchemaURL *string `json:"outputSchemaUrl,omitempty"`
ExecuteURL *string `json:"executeUrl,omitempty"`
ValidateSettingsURL *string `json:"validateSettingsUrl,omitempty"`
InvocationWaitMode *string `json:"invocationWaitMode,omitempty"`
BatchSizeURL *string `json:"batchSizeUrl,omitempty"`
RunQaCheckURL *string `json:"runQaCheckUrl,omitempty"`
UpdateSettingsURL *string `json:"updateSettingsUrl,omitempty"`
DeleteSettingsURL *string `json:"deleteSettingsUrl,omitempty"`
EditorMode *string `json:"editorMode,omitempty"`
Boundaries any `json:"boundaries,omitempty"`
}
Module represents an application module.
type NodeDeleteJob ¶ added in v0.19.0
type NodeDeleteJob struct {
// Delete operation identifier (UUID).
Identifier string `json:"identifier"`
// Job status. Enum: created, in_progress, finished, failed.
Status string `json:"status"`
// Progress in percentages.
Progress int `json:"progress"`
// The deleted node identifier, keyed by resource type.
Attributes NodeDeleteJobAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
// Error is present only when the operation failed with
// a user-actionable reason.
Error *NodeDeleteJobError `json:"error,omitempty"`
}
NodeDeleteJob represents an asynchronous delete job of a branch, directory or file.
type NodeDeleteJobAttributes ¶ added in v0.19.0
type NodeDeleteJobAttributes struct {
BranchID *int `json:"branchId,omitempty"`
DirectoryID *int `json:"directoryId,omitempty"`
FileID *int `json:"fileId,omitempty"`
}
NodeDeleteJobAttributes contains the identifier of the deleted node. Only one of the fields is set, depending on the resource type.
type NodeDeleteJobError ¶ added in v0.19.0
type NodeDeleteJobError struct {
Message string `json:"message"`
}
NodeDeleteJobError describes the reason of a failed delete job.
type NodeDeleteJobResponse ¶ added in v0.19.0
type NodeDeleteJobResponse struct {
Data *NodeDeleteJob `json:"data"`
}
NodeDeleteJobResponse describes a response with a single delete job.
type Notification ¶ added in v0.5.0
type Notification struct {
// Message text. Up to 10000 characters.
Message string `json:"message,omitempty"`
// User identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Enum: owner, manager.
Role string `json:"role,omitempty"`
}
Notification represents a notification request. It can be used to send a notification to an authenticated user, organization members, or project members.
func (*Notification) Validate ¶ added in v0.5.0
func (r *Notification) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type NotificationSettings ¶ added in v0.2.0
type NotificationSettings struct {
// Notify translators about new strings. Default: false.
TranslatorNewStrings *bool `json:"translatorNewStrings,omitempty"`
// Notify project managers about new strings. Default: false.
ManagerNewStrings *bool `json:"managerNewStrings,omitempty"`
// Notify project managers about language translation/validation completion.
// Default: false.
ManagerLanguageCompleted *bool `json:"managerLanguageCompleted,omitempty"`
}
NotificationSettings represents a project notification settings.
type Organization ¶ added in v0.2.0
type OrganizationAuthMethod ¶ added in v0.19.0
type OrganizationAuthMethod struct {
Name string `json:"name"`
IsEnabled bool `json:"isEnabled"`
IsDefault bool `json:"isDefault"`
}
OrganizationAuthMethod represents an authentication method of the organization.
type OrganizationAuthSettings ¶ added in v0.19.0
type OrganizationAuthSettings struct {
AllowSignUp bool `json:"allowSignUp"`
TwoFactorAuthentication bool `json:"twoFactorAuthentication"`
AuthMethods []*OrganizationAuthMethod `json:"authMethods"`
}
OrganizationAuthSettings represents the authentication settings of the organization.
type OrganizationAuthSettingsResponse ¶ added in v0.19.0
type OrganizationAuthSettingsResponse struct {
Data *OrganizationAuthSettings `json:"data"`
}
OrganizationAuthSettingsResponse defines the structure of a response when getting the organization authentication settings.
type OrganizationDefault ¶ added in v0.19.0
type OrganizationDefault struct {
Name string `json:"name"`
IsLocked bool `json:"isLocked"`
DefaultValue string `json:"defaultValue"`
}
OrganizationDefault represents a default setting of the organization.
type OrganizationInfo ¶ added in v0.19.0
type OrganizationInfo struct {
ID int `json:"id"`
Domain string `json:"domain"`
Name string `json:"name"`
Logo *string `json:"logo,omitempty"`
DefaultLogo string `json:"defaultLogo"`
Description *string `json:"description,omitempty"`
InternalDescription *string `json:"internalDescription,omitempty"`
CName *string `json:"cname,omitempty"`
IsVendor bool `json:"isVendor"`
// Default view of the public projects. Enum: grid, list.
DefaultPublicProjectsView string `json:"defaultPublicProjectsView"`
Plan *OrganizationPlan `json:"plan,omitempty"`
Defaults []*OrganizationDefault `json:"defaults,omitempty"`
}
OrganizationInfo represents the information about the organization.
type OrganizationInfoResponse ¶ added in v0.19.0
type OrganizationInfoResponse struct {
Data *OrganizationInfo `json:"data"`
}
OrganizationInfoResponse defines the structure of a response when getting the organization info.
type OrganizationPlan ¶ added in v0.19.0
type OrganizationPlan struct {
Name string `json:"name"`
WordsLimit *int `json:"wordsLimit,omitempty"`
ManagersLimit *int `json:"managersLimit,omitempty"`
}
OrganizationPlan represents the subscription plan of the organization.
type OtherFileFormatSettings ¶
type OtherFileFormatSettings struct {
// File format export pattern. Defines file name and path in resulting translations bundle.
// Default: null. Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
}
func (*OtherFileFormatSettings) ValidateSettings ¶
func (p *OtherFileFormatSettings) ValidateSettings() error
type OtherFileImportOptions ¶
type OtherFileImportOptions struct {
// Only for xml, md, flsnp, docx, mif, idml, dita, android8 files.
//
// Note: When Content segmentation is enabled, the translation upload is handled by an
// experimental machine learning technology. To achieve the best results, we recommend
// uploading translation files with the same or as close as possible file structure
// as in source files.
CommonFileImportOptions
}
OtherFileImportOptions implements the FileImportOptions interface.
type OtherLanguageTranslations ¶ added in v0.5.0
type OtherLanguageTranslations struct {
IsEnabled *bool `json:"isEnabled,omitempty"`
LanguageIDs []string `json:"languageIds,omitempty"`
}
OtherLanguageTranslations represents the other language translations settings of an AI prompt configuration.
type Pagination ¶
type Pagination struct {
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
// Total is the total number of items in the collection. Returned by some list endpoints only.
Total int `json:"total,omitempty"`
}
Pagination represents the pagination information.
type PaginationResponse ¶
type PaginationResponse struct {
Pagination Pagination `json:"pagination"`
}
PaginationResponse is the pagination response structure from the API.
type PendingTaskCreateForm ¶ added in v0.3.0
type PendingTaskCreateForm struct {
// Translate task identifier.
PrecedingTaskID int `json:"precedingTaskId"`
// Task type. Enum: 1 - proofread, 3 - proofread by vendor
// (requires `vendor` field).
Type TaskType `json:"type"`
// Task title.
Title string `json:"title"`
// Task description.
Description string `json:"description,omitempty"`
// Vendor identifier. Required when `type` is 3.
Vendor TaskVendor `json:"vendor,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
}
func (*PendingTaskCreateForm) Validate ¶ added in v0.3.0
func (r *PendingTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*PendingTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *PendingTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type Permission ¶ added in v0.5.0
type Permission struct {
// Value of the permission.
Value PermissionValue `json:"value,omitempty"`
// IDs is only available for restricted value.
IDs []int `json:"ids,omitempty"`
}
Permission represents a permission value for a project or a user.
type PermissionValue ¶ added in v0.5.0
type PermissionValue string
const ( PermissionOwn PermissionValue = "own" // All projects (Enterprise) / Own project PermissionOwner PermissionValue = "owner" // Only organization admins (Enterprise) / All project members PermissionManagers PermissionValue = "managers" // Organization admins, project managers and developers PermissionAll PermissionValue = "all" // All users in the organization projects PermissionGuests PermissionValue = "guests" // All users, including guests (unauthenticated users) PermissionRestricted PermissionValue = "restricted" // Selected projects )
type PreTranslateAccuracySchema ¶ added in v0.13.0
type PreTranslateAccuracySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces.
// Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Split into categories by edit distance.
//
// Deprecated: use MatchScoreCategories instead.
PostEditingCategories []string `json:"postEditingCategories,omitempty"`
// Split into categories by match score. Ranges should be in
// descending order (e.g., 100-90, 89-80).
MatchScoreCategories []string `json:"matchScoreCategories,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Task Identifier for which the report should be generated.
TaskID int `json:"taskId,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// List of label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Defines which strings include in report.
// Enum: strings_with_label, strings_without_label.
LabelIncludeType string `json:"labelIncludeType,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
PreTranslateAccuracySchema defines the schema for pre translate accuracy report.
func (*PreTranslateAccuracySchema) ValidateSchema ¶ added in v0.13.0
func (r *PreTranslateAccuracySchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the PreTranslateAccuracy schema is valid.
type PreTranslateEfficiencySchema ¶ added in v0.8.0
type PreTranslateEfficiencySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces.
// Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Split into categories by edit distance.
PostEditingCategories []string `json:"postEditingCategories,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
PreTranslateEfficiencySchema defines the schema for pre translate efficiency report. Deprecated: Use PreTranslateAccuracySchema instead.
func (*PreTranslateEfficiencySchema) ValidateSchema ¶ added in v0.8.0
func (r *PreTranslateEfficiencySchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the PreTranslateEfficiency schema is valid.
type PreTranslation ¶
type PreTranslation struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *PreTranslationAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt,omitempty"`
FinishedAt string `json:"finishedAt,omitempty"`
}
PreTranslation represents a pre-translation status.
type PreTranslationAttributes ¶
type PreTranslationAttributes struct {
LanguageIDs []string `json:"languageIds"`
BranchIDs []int `json:"branchIds,omitempty"`
FileIDs []int `json:"fileIds,omitempty"`
DirectoryIDs []int `json:"directoryIds,omitempty"`
TaskID *int `json:"taskId,omitempty"`
Method *string `json:"method,omitempty"`
AutoApproveOption *string `json:"autoApproveOption,omitempty"`
DuplicateTranslations *bool `json:"duplicateTranslations,omitempty"`
SkipApprovedTranslations *bool `json:"skipApprovedTranslations,omitempty"`
// Deprecated: use Scope instead.
TranslateUntranslatedOnly *bool `json:"translateUntranslatedOnly,omitempty"`
Scope *string `json:"scope,omitempty"`
TranslationModifiedBefore *string `json:"translationModifiedBefore,omitempty"`
TranslationModifiedAfter *string `json:"translationModifiedAfter,omitempty"`
ReplaceTranslationsOption *string `json:"replaceTranslationsOption,omitempty"`
ResetApprovalStatus *bool `json:"resetApprovalStatus,omitempty"`
TranslateWithPerfectMatchOnly *bool `json:"translateWithPerfectMatchOnly,omitempty"`
MinimumMatchRatio *int `json:"minimumMatchRatio,omitempty"`
Priority *string `json:"priority,omitempty"`
NotifyOnCompletion *bool `json:"notifyOnCompletion,omitempty"`
}
type PreTranslationReport ¶ added in v0.18.0
type PreTranslationReport struct {
Languages []*LanguageReport `json:"languages"`
PreTranslateType string `json:"preTranslateType"`
}
type PreTranslationReportResponse ¶ added in v0.18.0
type PreTranslationReportResponse struct {
Data *PreTranslationReport `json:"data"`
}
PreTranslationReportResponse defines the structure of a response when getting a pre-translation report.
type PreTranslationRequest ¶
type PreTranslationRequest struct {
// Set of languages to which pre-translation should be applied.
// Note: Required unless `taskId` is set.
LanguageIDs []string `json:"languageIds,omitempty"`
// Files array that should be translated.
// Note: Required unless `directoryIds` or `branchIds` is set (file-based projects).
FileIDs []int `json:"fileIds,omitempty"`
// Directories array that should be translated. Includes all nested files.
// Note: Available only for file-based projects.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// Branches array that should be translated.
BranchIDs []int `json:"branchIds,omitempty"`
// Task Identifier. Applies pre-translation to the strings of the specified task.
// The target language is taken from the task.
TaskID int `json:"taskId,omitempty"`
// Style Guide Identifiers used during pre-translation.
StyleGuideIDs []int `json:"styleGuideIds,omitempty"`
// Defines pre-translation method. Enum: "tm", "mt", "ai". Default: "tm".
// - tm – pre-translation via Translation Memory.
// - mt – pre-translation via Machine Translation. "mt" should be used with `engineId` parameter.
// - ai – pre-translation via AI. "ai" should be used with `aiPromptId` parameter.
Method string `json:"method,omitempty"`
// Machine Translation engine Identifier. Required if `method` is set to "mt".
EngineID int `json:"engineId,omitempty"`
// AI Prompt Identifier. Required if `method` is set to "ai".
AIPromptID int `json:"aiPromptId,omitempty"`
// Defines which translations added by TM pre-translation should be auto-approved. Default: "none".
// Enum: "all", "exceptAutoSubstituted", "perfectMatchApprovedOnly", "perfectMatchOnly", "none"
// - all – all
// - perfectMatchOnly – with perfect TM match
// - exceptAutoSubstituted – all (skip auto-substituted suggestions)
// - perfectMatchApprovedOnly - with perfect TM match (approved previously)
// - none – no auto-approve
AutoApproveOption string `json:"autoApproveOption,omitempty"`
// Adds translations even if the same translation already exists. Default is false.
// Note: Works only with TM pre-translation method.
DuplicateTranslations *bool `json:"duplicateTranslations,omitempty"`
// Skip approved translations. Default is false.
// Note: Works only with TM pre-translation method.
SkipApprovedTranslations *bool `json:"skipApprovedTranslations,omitempty"`
// Applies pre-translation for untranslated strings only. Default is true.
// Note: Cannot be used together with `scope` in the same request.
//
// Deprecated: use Scope instead. PreTranslationScopeUntranslated is equivalent
// to `true` and PreTranslationScopeAll is equivalent to `false`.
TranslateUntranslatedOnly *bool `json:"translateUntranslatedOnly,omitempty"`
// Which strings to apply pre-translation to.
// Enum: "untranslated", "translated", "all". Default: "untranslated".
// Note: Cannot be used together with the deprecated `translateUntranslatedOnly`.
Scope PreTranslationScope `json:"scope,omitempty"`
// Re-translates only if a string's current translation was modified prior to
// this date (ISO 8601 date-time).
// Note: Requires `scope` to be "translated" or "all".
TranslationModifiedBefore string `json:"translationModifiedBefore,omitempty"`
// Re-translates only if a string's current translation was modified after
// this date (ISO 8601 date-time).
// Note: Cannot be later than `translationModifiedBefore`.
// Requires `scope` to be "translated" or "all".
TranslationModifiedAfter string `json:"translationModifiedAfter,omitempty"`
// Defines whether to replace existing translations with new pre-translations.
// Enum: "none", "autoTranslated", "all". Default: "none".
// Note: Values other than "none" require `scope` to be "translated" or "all".
ReplaceTranslationsOption ReplaceTranslationsOption `json:"replaceTranslationsOption,omitempty"`
// Removes approval on existing translations when applying pre-translations.
// Default is false.
// Note: Requires `scope` to be "translated" or "all". Cannot be used together with
// `skipApprovedTranslations`, `autoApproveOption` (other than "none"), or when
// `replaceTranslationsOption` is "all".
ResetApprovalStatus *bool `json:"resetApprovalStatus,omitempty"`
// If true, the user who started the pre-translation is notified when it
// finishes, fails or is canceled. Default is false.
NotifyOnCompletion *bool `json:"notifyOnCompletion,omitempty"`
// Applies pre-translation only for the strings with perfect match
// (source text and contextual information are identical). Default is false.
// Note: Works only with TM pre-translation method.
TranslateWithPerfectMatchOnly *bool `json:"translateWithPerfectMatchOnly,omitempty"`
// Add translation when TM match is greater or equal to minimum match ratio.
// Acceptable values: 40-100. Default: 100.
// Note: Works only with TM pre-translation method. Available only for Crowdin Enterprise.
MinimumMatchRatio int `json:"minimumMatchRatio,omitempty"`
// Pre-translation priority. Enum: "low", "normal", "high". Default: "normal".
Priority string `json:"priority,omitempty"`
// Defines fallback languages mapping. The passed value should contain a map of
// languageID as a key and an array of fallback language IDs as a value.
// - languageID – Crowdin ID for the specified language.
// - []string – an array containing fallback language IDs.
// Note: Available only for TM Pre-Translation.
FallbackLanguages map[string][]string `json:"fallbackLanguages,omitempty"`
// Source language identifier.
// Note: Available only for Crowdin.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Custom instruction for AI pre-translation. This instruction will be appended
// to the AI prompt text. Max length: 10000 characters.
// Note: Available only for AI pre-translation method.
CustomInstruction string `json:"customInstruction,omitempty"`
// Label Identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude Label Identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
}
PreTranslationRequest defines the structure of a request to apply pre-translation.
func (*PreTranslationRequest) Validate ¶
func (r *PreTranslationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type PreTranslationScope ¶ added in v0.19.0
type PreTranslationScope string
PreTranslationScope defines which strings pre-translation is applied to.
const ( // PreTranslationScopeUntranslated applies pre-translation to strings without // an existing translation (default). PreTranslationScopeUntranslated PreTranslationScope = "untranslated" // PreTranslationScopeTranslated applies pre-translation to strings that // already have a translation (re-translation). PreTranslationScopeTranslated PreTranslationScope = "translated" // PreTranslationScopeAll applies pre-translation to both untranslated // and translated strings. PreTranslationScopeAll PreTranslationScope = "all" )
type PreTranslationsListOptions ¶ added in v0.19.0
type PreTranslationsListOptions struct {
// Sort a list of pre-translations.
// Example: orderBy=createdAt desc.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
PreTranslationsListOptions specifies the optional parameters to the TranslationsService.ListPreTranslationsWithOptions method.
type PreTranslationsListResponse ¶ added in v0.9.0
type PreTranslationsListResponse struct {
Data []*PreTranslationsResponse `json:"data"`
}
PreTranslationsListResponse defines the structure of a response when getting a list of pre-translations.
type PreTranslationsResponse ¶
type PreTranslationsResponse struct {
Data *PreTranslation `json:"data"`
}
PreTranslationsResponse defines the structure of a response when getting a pre-translation status.
type Project ¶
type Project struct {
ID int `json:"id"`
GroupID int `json:"groupId,omitempty"`
Type int `json:"type"`
UserID int `json:"userId"`
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageIDs []string `json:"targetLanguageIds"`
LanguageAccessPolicy string `json:"languageAccessPolicy"`
Name string `json:"name"`
Cname string `json:"cname,omitempty"`
Identifier string `json:"identifier"`
Description string `json:"description"`
Visibility string `json:"visibility"`
Logo string `json:"logo"`
IsExternal bool `json:"isExternal,omitempty"`
ExternalType string `json:"externalType,omitempty"`
WorkflowID int `json:"workflowId,omitempty"`
HasCrowdsourcing bool `json:"hasCrowdsourcing,omitempty"`
PublicDownloads bool `json:"publicDownloads"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
LastActivity string `json:"lastActivity"`
SourceLanguage *Language `json:"sourceLanguage"`
TargetLanguages []*Language `json:"targetLanguages"`
WebURL string `json:"webUrl"`
Fields any `json:"fields,omitempty"`
ExternalProjectID *int `json:"externalProjectId,omitempty"`
ExternalOrganizationID *int `json:"externalOrganizationId,omitempty"`
PublicURL string `json:"publicUrl,omitempty"`
SavingsReportSettingsTemplateID int `json:"savingsReportSettingsTemplateId,omitempty"`
// Deprecated: use GlossaryAccessOption instead.
GlossaryAccess bool `json:"glossaryAccess,omitempty"`
ClientOrganizationID int `json:"clientOrganizationId,omitempty"`
TranslateDuplicates int `json:"translateDuplicates,omitempty"`
TagsDetection int `json:"tagsDetection,omitempty"`
GlossaryAccessOption string `json:"glossaryAccessOption,omitempty"`
IsMTAllowed bool `json:"isMtAllowed,omitempty"`
TaskBasedAccessControl bool `json:"taskBasedAccessControl,omitempty"`
TaskReviewerIDs []int `json:"taskReviewerIds,omitempty"`
HiddenStringsProofreadersAccess bool `json:"hiddenStringsProofreadersAccess,omitempty"`
AutoSubstitution bool `json:"autoSubstitution,omitempty"`
ExportTranslatedOnly bool `json:"exportTranslatedOnly,omitempty"`
SkipUntranslatedStrings bool `json:"skipUntranslatedStrings,omitempty"`
ExportApprovedOnly bool `json:"exportApprovedOnly,omitempty"`
ExportWithMinApprovalsCount int `json:"exportWithMinApprovalsCount,omitempty"`
ExportStringsThatPassedWorkflow bool `json:"exportStringsThatPassedWorkflow,omitempty"`
AutoTranslateDialects bool `json:"autoTranslateDialects,omitempty"`
UseGlobalTM bool `json:"useGlobalTm,omitempty"`
TMContextType string `json:"tmContextType,omitempty"`
ShowTMSuggestionsDialects bool `json:"showTmSuggestionsDialects,omitempty"`
TmApprovedSuggestionsOnly bool `json:"tmApprovedSuggestionsOnly,omitempty"`
IsSuspended bool `json:"isSuspended,omitempty"`
QACheckIsActive bool `json:"qaCheckIsActive,omitempty"`
QAApprovalsCount int `json:"qaApprovalsCount,omitempty"`
QACheckCategories map[string]bool `json:"qaCheckCategories,omitempty"`
QAChecksIgnorableCategories map[string]bool `json:"qaChecksIgnorableCategories,omitempty"`
CustomQACheckIDs []int `json:"customQaCheckIds,omitempty"`
ExternalQACheckIDs []int `json:"externalQaCheckIds,omitempty"`
LanguageMapping map[string]LanguageMapping `json:"languageMapping,omitempty"`
DelayedWorkflowStart bool `json:"delayedWorkflowStart,omitempty"`
NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
DefaultTMID int `json:"defaultTmId,omitempty"`
DefaultGlossaryID int `json:"defaultGlossaryId,omitempty"`
AssignedTMs map[int]map[string]int `json:"assignedTms,omitempty"`
AssignedGlossaries []int `json:"assignedGlossaries,omitempty"`
AssignedStyleGuides []int `json:"assignedStyleGuides,omitempty"`
TMPenalties any `json:"tmPenalties,omitempty"`
NormalizePlaceholder bool `json:"normalizePlaceholder,omitempty"`
TMPreTranslate *ProjectTMPreTranslate `json:"tmPreTranslate,omitempty"`
MTPreTranslate *ProjectMTPreTranslate `json:"mtPreTranslate,omitempty"`
AiPreTranslate *ProjectAiPreTranslate `json:"aiPreTranslate,omitempty"`
EditorSuggestionAiPromptID *int `json:"editorSuggestionAiPromptId,omitempty"`
AlignmentActionAiPromptID *int `json:"alignmentActionAiPromptId,omitempty"`
QACheckActionAiPromptID *int `json:"qaCheckActionAiPromptId,omitempty"`
ContextReviewAiPromptID *int `json:"contextReviewAiPromptId,omitempty"`
SaveMetaInfoInSource bool `json:"saveMetaInfoInSource,omitempty"`
SkipUntranslatedFiles bool `json:"skipUntranslatedFiles,omitempty"`
InContext bool `json:"inContext,omitempty"`
InContextProcessHiddenStrings bool `json:"inContextProcessHiddenStrings,omitempty"`
InContextPseudoLanguageID string `json:"inContextPseudoLanguageId,omitempty"`
InContextPseudoLanguage *Language `json:"inContextPseudoLanguage,omitempty"`
}
Project represents a Crowdin project.
type ProjectAISettings ¶ added in v0.19.0
type ProjectAISettings struct {
EditorSuggestionAIPromptID int `json:"editorSuggestionAiPromptId"`
QACheckActionAIPromptID *int `json:"qaCheckActionAiPromptId,omitempty"`
ContextReviewAIPromptID *int `json:"contextReviewAiPromptId,omitempty"`
// Alignment action AI prompt identifier (Enterprise only).
AlignmentActionAIPromptID *int `json:"alignmentActionAiPromptId,omitempty"`
}
ProjectAISettings represents the AI settings of a project.
type ProjectAISettingsResponse ¶ added in v0.19.0
type ProjectAISettingsResponse struct {
Data *ProjectAISettings `json:"data"`
}
ProjectAISettingsResponse defines the structure of a response when getting the AI settings of a project.
type ProjectAiPreTranslate ¶ added in v0.8.0
type ProjectAiPreTranslate struct {
Enabled *bool `json:"enabled,omitempty"`
AiPrompts []ProjectAiPrompt `json:"aiPrompts,omitempty"`
}
type ProjectAiPrompt ¶ added in v0.8.0
type ProjectAiPrompt struct {
AiPromptID int `json:"aiPromptId,omitempty"`
// Specify an array of languageIds to use specific languages, or use the string all
// to include all supported languages.
// Retrieve languageIds via the List Supported Languages endpoint
LanguageIDs []string `json:"languageIds,omitempty"`
}
type ProjectMTPreTranslate ¶
type ProjectMTPreTranslate struct {
Enabled *bool `json:"enabled,omitempty"`
MTs []ProjectMTs `json:"mts,omitempty"`
}
type ProjectMTs ¶
type ProjectMTs struct {
MTID int `json:"mtId,omitempty"`
// Specify an array of languageIds to use specific languages, or use the string all
// to include all supported languages.
// Retrieve languageIds via the `List Supported Languages` endpoint
LanguageIDs []string `json:"languageIds,omitempty"`
}
type ProjectMember ¶ added in v0.3.0
type ProjectMember struct {
ID int `json:"id"`
Username string `json:"username"`
FirstName *string `json:"firstName,omitempty"`
LastName *string `json:"lastName,omitempty"`
FullName *string `json:"fullName,omitempty"`
Role *string `json:"role,omitempty"`
Permissions map[string]any `json:"permissions,omitempty"`
Roles []*TranslatorRole `json:"roles"`
IsManager *bool `json:"isManager,omitempty"`
IsDeveloper *bool `json:"isDeveloper,omitempty"`
IsAdmin *bool `json:"isAdmin,omitempty"`
ManagerOfGroup *struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"managerOfGroup,omitempty"`
AccessToAllWorkflowSteps *bool `json:"accessToAllWorkflowSteps,omitempty"`
GivenAccessAt *string `json:"givenAccessAt,omitempty"`
AvatarURL *string `json:"avatarUrl,omitempty"`
JoinedAt *string `json:"joinedAt,omitempty"`
Timezone *string `json:"timezone,omitempty"`
}
ProjectMember represents a member of a project.
type ProjectMemberAddRequest ¶ added in v0.3.0
type ProjectMemberAddRequest struct {
// User Identifier.
// Note: One of fields `userIds`, `usernames` or `emails` is required.
UserIDs []int `json:"userIds,omitempty"`
// User Names.
// Note: One of fields `userIds`, `usernames` or `emails` is required.
Usernames []string `json:"usernames,omitempty"`
// User Emails.
// Note: One of fields `userIds`, `usernames` or `emails` is required.
Emails []string `json:"emails,omitempty"`
// Grand manager access to a project. Default: false.
ManagerAccess *bool `json:"managerAccess,omitempty"`
// Grand developer access to a project. Default: false.
DeveloperAccess *bool `json:"developerAccess,omitempty"`
// Note: `managerAccess`, `developerAccess` and `roles` parameters
// are mutually exclusive.
Roles []*TranslatorRole `json:"roles,omitempty"`
// Custom message added to the invitation email (Crowdin only).
Message string `json:"message,omitempty"`
}
ProjectMemberAddRequest defines the structure of the request when adding a new member to a project.
func (*ProjectMemberAddRequest) Validate ¶ added in v0.3.0
func (r *ProjectMemberAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type ProjectMemberAddResponse ¶ added in v0.3.0
type ProjectMemberAddResponse struct {
Skipped []*ProjectMemberResponse `json:"skipped"`
Updated []*ProjectMemberResponse `json:"updated,omitempty"`
Added []*ProjectMemberResponse `json:"added"`
}
ProjectMemberAddResponse defines the structure of the response when adding a new member to a project.
type ProjectMemberReplaceRequest ¶ added in v0.3.0
type ProjectMemberReplaceRequest struct {
// Grand manager access to a project. Default: false.
ManagerAccess *bool `json:"managerAccess,omitempty"`
// Grand developer access to a project. Default: false.
DeveloperAccess *bool `json:"developerAccess,omitempty"`
// Translator roles.
// Note: `managerAccess`, `developerAccess` and `roles` parameters
// are mutually exclusive.
Roles []*TranslatorRole `json:"roles,omitempty"`
}
ProjectMemberReplaceRequest defines the structure of the request when replacing permissions of a project member.
func (*ProjectMemberReplaceRequest) Validate ¶ added in v0.3.0
func (r *ProjectMemberReplaceRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type ProjectMemberResponse ¶ added in v0.3.0
type ProjectMemberResponse struct {
Data *ProjectMember `json:"data"`
}
ProjectMemberResponse defines the structure of the response when getting a single project member.
type ProjectMembersListOptions ¶ added in v0.3.0
type ProjectMembersListOptions struct {
// Sort project members by a specific field.
// Enum: id, username, firstName, lastName, fullName. Default: id.
// Example: orderBy=lastName desc,username
OrderBy string `json:"orderBy,omitempty"`
// Search users by `firstName`, `lastName` or `username`.
Search string `json:"search,omitempty"`
// Defines role type. Enum: all, manager, developer, language_coordinator,
// proofreader, translator, blocked, pending.
Role string `json:"role,omitempty"`
// Language Identifier.
LanguageID string `json:"languageId,omitempty"`
// Workflow Step Identifier.
WorkflowStepID int `json:"workflowStepId,omitempty"`
ListOptions
}
ProjectMembersListOptions specifies the optional parameters to the ProjectMembersService.List method.
type ProjectMembersListResponse ¶ added in v0.3.0
type ProjectMembersListResponse struct {
Data []*ProjectMemberResponse `json:"data"`
}
ProjectMembersListResponse defines the structure of the response when getting a list of project members.
type ProjectMembersSchema ¶ added in v0.18.0
type ProjectMembersSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
ProjectMembersSchema defines the schema for the project members report.
func (*ProjectMembersSchema) ValidateSchema ¶ added in v0.18.0
func (r *ProjectMembersSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the ProjectMembers schema is valid.
type ProjectPermission ¶ added in v0.5.0
type ProjectPermission struct {
// Value enum: own, restricted.
Project Permission `json:"project,omitempty"`
}
ProjectPermission represents a permission for a project where users will be able to use the app.
type ProjectPlaceholder ¶ added in v0.19.0
type ProjectPlaceholder struct {
// Identifier of the placeholder in the project.
ID int `json:"id"`
// Custom placeholder of the organization this row assigns.
CustomPlaceholderID int `json:"customPlaceholderId"`
// Priority the placeholder is matched with. Enum: high, low.
Type *string `json:"type,omitempty"`
// Position of the placeholder among the ones assigned to the project.
Index *int `json:"index,omitempty"`
// If true, a mismatch of the placeholder blocks the translation from being saved.
IsBlocking *bool `json:"isBlocking,omitempty"`
// File formats the placeholder is applied to; an empty array means every format.
Formats []string `json:"formats"`
}
ProjectPlaceholder represents a custom placeholder of the organization, with the settings it has in the project.
type ProjectPlaceholderAddRequest ¶ added in v0.19.0
type ProjectPlaceholderAddRequest struct {
// ID of the custom placeholder the organization defined.
CustomPlaceholderID int `json:"customPlaceholderId"`
// Priority the placeholder is matched with. Enum: high, low. Default: low.
Type ProjectPlaceholderType `json:"type,omitempty"`
// Position of the placeholder among the ones assigned to the project. Default: 0.
Index int `json:"index,omitempty"`
// If true, a mismatch of the placeholder blocks the translation from being saved.
// Default: false.
IsBlocking *bool `json:"isBlocking,omitempty"`
// File formats the placeholder is applied to; an empty array means every format.
Formats []string `json:"formats,omitempty"`
}
ProjectPlaceholderAddRequest defines the structure of a request when assigning a custom placeholder to the project.
func (*ProjectPlaceholderAddRequest) Validate ¶ added in v0.19.0
func (r *ProjectPlaceholderAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ProjectPlaceholderResponse ¶ added in v0.19.0
type ProjectPlaceholderResponse struct {
Data *ProjectPlaceholder `json:"data"`
}
ProjectPlaceholderResponse defines the structure of a response when getting a project placeholder.
type ProjectPlaceholderType ¶ added in v0.19.0
type ProjectPlaceholderType string
ProjectPlaceholderType defines the priority a project placeholder is matched with.
const ( ProjectPlaceholderTypeHigh ProjectPlaceholderType = "high" ProjectPlaceholderTypeLow ProjectPlaceholderType = "low" )
type ProjectPlaceholdersListResponse ¶ added in v0.19.0
type ProjectPlaceholdersListResponse struct {
Data []*ProjectPlaceholderResponse `json:"data"`
}
ProjectPlaceholdersListResponse defines the structure of a response when getting a list of project placeholders.
type ProjectProgressListOptions ¶
type ProjectProgressListOptions struct {
// Filter progress by Language Identifier.
LanguageIDs []string `json:"languageIds,omitempty"`
ListOptions
}
ProjectProgressListOptions specifies the optional parameters to the TranslationStatusService.GetProjectProgress method.
type ProjectSystemPlaceholder ¶ added in v0.19.0
type ProjectSystemPlaceholder struct {
// Key of the system placeholder (e.g. "printfSpecifier"). Name it in the
// `path` of a batch operation to turn the placeholder on or off.
ID string `json:"id"`
// If false, the project stops recognizing the placeholder in the QA checks
// and in the Editor.
IsEnabled bool `json:"isEnabled"`
// Name of the placeholder, in the language of the request.
Label string `json:"label"`
// One line saying where the construct comes from, in the language of the request.
Description string `json:"description"`
// Constructs the placeholder matches, written out.
Examples []string `json:"examples"`
}
ProjectSystemPlaceholder represents a placeholder Crowdin ships, turned on or off per project.
type ProjectSystemPlaceholderResponse ¶ added in v0.19.0
type ProjectSystemPlaceholderResponse struct {
Data *ProjectSystemPlaceholder `json:"data"`
}
ProjectSystemPlaceholderResponse defines the structure of a response when getting a project system placeholder.
type ProjectSystemPlaceholdersListResponse ¶ added in v0.19.0
type ProjectSystemPlaceholdersListResponse struct {
Data []*ProjectSystemPlaceholderResponse `json:"data"`
}
ProjectSystemPlaceholdersListResponse defines the structure of a response when getting a list of project system placeholders.
type ProjectTMPenalties ¶
type ProjectTMPenalties struct {
AutoSubstitution int `json:"autoSubstitution,omitempty"`
TMPriority struct {
Priority int `json:"priority,omitempty"`
Penalty int `json:"penalty,omitempty"`
} `json:"tmPriority,omitempty"`
MultipleTranslations int `json:"multipleTranslations,omitempty"`
TimeSinceLastUsage struct {
Months int `json:"months,omitempty"`
Penalty int `json:"penalty,omitempty"`
} `json:"timeSinceLastUsage,omitempty"`
TimeSinceLastModified struct {
Months int `json:"months,omitempty"`
Penalty int `json:"penalty,omitempty"`
} `json:"timeSinceLastModified,omitempty"`
}
type ProjectTMPreTranslate ¶
type ProjectTMPreTranslate struct {
Enabled *bool `json:"enabled,omitempty"`
// Enum: "all", "perfectMatchOnly", "exceptAutoSubstituted", "perfectMatchApprovedOnly", "none".
AutoApproveOption string `json:"autoApproveOption,omitempty"`
// Enum: "perfect", "100".
MinimumMatchRatio string `json:"minimumMatchRatio,omitempty"`
}
type ProjectTeam ¶ added in v0.4.0
type ProjectTeam struct {
ID int `json:"id"`
HasManagerAccess bool `json:"hasManagerAccess"`
HasDeveloperAccess bool `json:"hasDeveloperAccess"`
HasAccessToAllWorkflowSteps bool `json:"hasAccessToAllWorkflowSteps"`
Permissions map[string]any `json:"permissions"`
Roles []*TranslatorRole `json:"roles"`
}
ProjectTeam represents a team in the project.
type ProjectTeamAddRequest ¶ added in v0.4.0
type ProjectTeamAddRequest struct {
// Team identifier.
TeamID int `json:"teamId"`
// Grand manager access to a project. Default: false.
ManagerAccess *bool `json:"managerAccess,omitempty"`
// Developer access to a project. Default: false.
DeveloperAccess *bool `json:"developerAccess,omitempty"`
// Team roles.
// Note: `managerAccess`, `developerAccess` and `roles` parameters
// are mutually exclusive.
Roles []*TranslatorRole `json:"roles,omitempty"`
}
ProjectTeamAddRequest defines the structure of the request when adding a team to the project.
func (*ProjectTeamAddRequest) Validate ¶ added in v0.4.0
func (r *ProjectTeamAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ProjectTeamAddResponse ¶ added in v0.4.0
type ProjectTeamAddResponse struct {
Skipped *ProjectTeam `json:"skipped,omitempty"`
Updated *ProjectTeam `json:"updated,omitempty"`
Added *ProjectTeam `json:"added,omitempty"`
}
ProjectTeamAddResponse defines the structure of the response when adding a team to the project.
type ProjectsAddFileFormatSettingsRequest ¶
type ProjectsAddFileFormatSettingsRequest struct {
// Defines file format.
Format string `json:"format"`
// Defines file format settings.
Settings FileFormatSettings `json:"settings"`
}
ProjectsFileFormatSettingsRequest defines the structure of a request to add a project file format settings.
func (*ProjectsAddFileFormatSettingsRequest) Validate ¶ added in v0.2.0
func (r *ProjectsAddFileFormatSettingsRequest) Validate() error
Validate checks if the add project file format settings request is valid. It implements the crowdin.RequestValidator interface.
type ProjectsAddRequest ¶
type ProjectsAddRequest struct {
// Project Name.
Name string `json:"name"`
// Project Identifier.
Identifier string `json:"identifier,omitempty"`
// Source Language Identifier.
SourceLanguageID string `json:"sourceLanguageId"`
// Target Languages Identifiers.
TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"`
// Defines how users can join the project. Enum: open, private. Default: private.
// open – anyone can join the project
// private – only invited users can join the project
Visibility string `json:"visibility,omitempty"`
// Defines access to project languages. Enum: open, moderate. Default: open.
// open – each project user can access all project languages
// moderate – users should join each project language separately
LangAccessPolicy string `json:"languageAccessPolicy,omitempty"`
// Custom domain name.
Cname string `json:"cname,omitempty"`
// Project description.
Description string `json:"description,omitempty"`
// Values available: 0 - Auto, 1 - Count tags, 1 - Skip tags. Default: 0.
TagsDetection *int `json:"tagsDetection,omitempty"`
// Allows machine translations (Microsoft Translator, Google Translate) be visible
// for translators in the Editor. Default: true.
IsMTAllowed *bool `json:"isMtAllowed,omitempty"`
// Allow project members work with tasks they assigned to, even if they do not have
// full access to the language. Default: false.
TaskBasedAccessControl *bool `json:"taskBasedAccessControl,omitempty"`
// Allows auto-substitution. Default: true.
AutoSubstitution *bool `json:"autoSubstitution,omitempty"`
// Automatically fill in regional dialects. Default: false.
// If true, all untranslated strings in regional dialects (e.g. Argentine Spanish)
// will automatically include translations completed in the primary language (e.g. Spanish).
AutoTranslateDialects *bool `json:"autoTranslateDialects,omitempty"`
// Allows translators to download source files to their machines and upload translations back into the project.
// Project owner and managers can always download sources and upload translations. Default: true.
PublicDownloads *bool `json:"publicDownloads,omitempty"`
// Allows proofreaders to work with hidden strings.
// Project owner and managers can always access hidden strings. Default: true.
HiddenStringsProofreadersAccess *bool `json:"hiddenStringsProofreadersAccess,omitempty"`
// If true - machine translations from connected MT engines (e.g. Microsoft Translator, Google Translate)
// will appear as suggestions in the Editor. Default: false.
// Note: If your organization plan is free or opensource - default value of this one will be true
UseGlobalTM *bool `json:"useGlobalTm,omitempty"`
// If true - show primary language TM suggestions for dialects if there are no dialect-specific ones. Default: true.
ShowTMSuggestionsDialects *bool `json:"showTmSuggestionsDialects,omitempty"`
// If true - only approved suggestions will be saved to the project default TM.
TmApprovedSuggestionsOnly *bool `json:"tmApprovedSuggestionsOnly,omitempty"`
// Defines whether to skip untranslated strings.
SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"`
// Defines whether to export only approved strings.
ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"`
// If true - QA checks are active. Default: true.
QACheckIsActive *bool `json:"qaCheckIsActive,omitempty"`
// Acceptable categories are: empty, size, tags, spaces, variables, punctuation, symbolRegister,
// specialSymbols, wrongTranslation, spellcheck, icu, terms, duplicate, ftl, android, numbers,
// ai, outdated, mdx, unifiedPlaceholders.
QACheckCategories map[string]bool `json:"qaCheckCategories,omitempty"`
// Acceptable categories are: empty, size, tags, spaces, variables, punctuation, symbolRegister,
// specialSymbols, wrongTranslation, spellcheck, icu, terms, duplicate, ftl, android, numbers,
// ai, outdated, mdx, unifiedPlaceholders.
QAChecksIgnorableCategories map[string]bool `json:"qaChecksIgnorableCategories,omitempty"`
// Language Mapping.
LanguageMapping map[string]LanguageMapping `json:"languageMapping,omitempty"`
// Allow project members to manage glossary terms.
// The project owner and managers always can add and edit terms. Default: false.
//
// Deprecated: use GlossaryAccessOption instead.
GlossaryAccess *bool `json:"glossaryAccess,omitempty"`
// Defines the glossary access level for project members.
// Enum: readOnly, fullAccess, manageDrafts. Default: readOnly.
GlossaryAccessOption string `json:"glossaryAccessOption,omitempty"`
// Enable the transformation of the placeholders to the unified format to improve the work with TM suggestions.
NormalizePlaceholder *bool `json:"normalizePlaceholder,omitempty"`
// Notification Settings.
NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
// TM perfect match searching mode. Enum: "segmentContext" "auto" "prevAndNextSegment". Default: "segmentContext".
// segmentContext - searching by context.
// auto - context search for key-value formats and segment search for others.
// prevAndNextSegment - search by previous and next segment.
TMContextType string `json:"tmContextType,omitempty"`
TMPreTranslate *ProjectTMPreTranslate `json:"tmPreTranslate,omitempty"`
MTPreTranslate *ProjectMTPreTranslate `json:"mtPreTranslate,omitempty"`
AiPreTranslate *ProjectAiPreTranslate `json:"aiPreTranslate,omitempty"`
// AI Prompt ID to be used as prompt for Assist action.
//
// Deprecated: the Assist AI prompt action was removed from the API.
AssistActionAiPromptID int `json:"assistActionAiPromptId,omitempty"`
// AI Prompt ID to be used as prompt for Editor Suggestion action.
EditorSuggestionAiPromptID int `json:"editorSuggestionAiPromptId,omitempty"`
// AI Prompt ID to be used as prompt for Alignment action (Enterprise only).
AlignmentActionAiPromptID int `json:"alignmentActionAiPromptId,omitempty"`
// AI Prompt ID to be used as prompt for QA Check action.
QACheckActionAiPromptID int `json:"qaCheckActionAiPromptId,omitempty"`
// AI Prompt ID to be used as prompt for Context Review action.
ContextReviewAiPromptID int `json:"contextReviewAiPromptId,omitempty"`
// Savings Report Settings Template Identifier.
SavingsReportSettingsTemplateID int `json:"savingsReportSettingsTemplateId,omitempty"`
// Style Guide identifiers to assign to the project.
AssignedStyleGuides []int `json:"assignedStyleGuides,omitempty"`
// Translation Memory ID.
// Default: null
DefaultTMID int `json:"defaultTmId,omitempty"`
// Glossary ID.
// Default: null
DefaultGlossaryID int `json:"defaultGlossaryId,omitempty"`
// Context and max.length added in Crowdin will be visible in the downloaded files.
SaveMetaInfoInSource *bool `json:"saveMetaInfoInSource,omitempty"`
// Defines the project type. Use 0 for a file-based project and 1 for a string-based project.
// Enum: 0, 1. Default: 0.
Type *int `json:"type,omitempty"`
// Defines whether to export only translated file.
SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"`
// Enable In-Context translations. Default: false.
// Note: Must be used together with `inContextPseudoLanguageId`
InContext *bool `json:"inContext,omitempty"`
// Export hidden strings via pseudo-language. Default: true.
// Note: If true - hidden strings included in the pseudo-language archive will be translatable via In-Context.
InContextProcessHiddenStrings *bool `json:"inContextProcessHiddenStrings,omitempty"`
// In-Context pseudo-language id.
// Note: Must be different from project source and target languages
InContextPseudoLanguageID string `json:"inContextPseudoLanguageId,omitempty"`
// Workflow Template Step Identifier.
ID int `json:"id,omitempty"`
// Workflow Template Identifier.
TemplateID int `json:"templateId,omitempty"`
// Workflow Template Steps Configuration.
// Note. Must be used together with `templateId`. Can't be used with
// `vendorId`, `mtEngineId` in same request.
Steps []*WorkflowTemplateStep `json:"steps,omitempty"`
// Group Identifier.
GroupID int `json:"groupId,omitempty"`
// Specify Vendor Identifier, if no Vendor is assigned to Workflow step yet.
VendorID int `json:"vendorId,omitempty"`
// Specify Machine Translation engine Identifier, if no MT engine is
// assigned to Workflow step yet.
MTEngineID int `json:"mtEngineId,omitempty"`
// Enum 0, 1, 2, 3, 4, 5. Default: 0.
// 0 - Show – translators will translate each instance separately,
// 1 - Hide (regular detection) – all duplicates will share the same translation
// 2 - Show, but auto-translate them,
// 3 - Show within a version branch (regular detection) - duplicates will be hidden only
// between versions branches
// 4 - Hide (strict detection) – all duplicates will share the same translation
// 5 - Show within a version branch (strict detection) - duplicates will be hidden only
// between versions branches
TranslateDuplicates *int `json:"translateDuplicates,omitempty"`
// Delay workflow start after project creation. Default: false.
DelayedWorkflowStart *bool `json:"delayedWorkflowStart,omitempty"`
// Defines whether to export only approved strings.
// Note: value greater than 0 can't be used with `exportStringsThatPassedWorkflow=true`
// in same request.
ExportWithMinApprovalsCount *int `json:"exportWithMinApprovalsCount,omitempty"`
// Defines whether to export only strings that passed workflow.
// Note: `true` value can't be used with `exportWithMinApprovalsCount>0` in same request
// or in projects without an assigned workflow.
ExportStringsThatPassedWorkflow *bool `json:"exportStringsThatPassedWorkflow,omitempty"`
// Clear QA checks for translations with specific number of approvals. Default: 1.
QAApprovalsCount *int `json:"qaApprovalsCount,omitempty"`
// Custom QA checks identifiers.
CustomQACheckIDs []int `json:"customQaCheckIds,omitempty"`
// External QA checks identifiers (Enterprise only).
ExternalQACheckIDs []int `json:"externalQaCheckIds,omitempty"`
// Task reviewer identifiers (Enterprise only).
TaskReviewerIDs []int `json:"taskReviewerIds,omitempty"`
// MT Engine Identifier.
MTID int `json:"mtId,omitempty"`
// Fields.
Fields map[string]any `json:"fields,omitempty"`
// Target Languages Identifiers.
Languages []string `json:"languages,omitempty"`
}
ProjectsAddRequest defines the structure of a request to add a project.
func (*ProjectsAddRequest) Validate ¶
func (r *ProjectsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type ProjectsFileFormatSettings ¶
type ProjectsFileFormatSettings struct {
ID int `json:"id"`
Name string `json:"name"`
Format string `json:"format"`
Extensions []string `json:"extensions"`
Settings map[string]any `json:"settings"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
ProjectsFileFormatSettings represents a Crowdin project file format settings.
type ProjectsFileFormatSettingsListResponse ¶
type ProjectsFileFormatSettingsListResponse struct {
Data []*ProjectsFileFormatSettingsResponse `json:"data"`
}
ProjectsFileFormatSettingsListResponse defines the structure of a response when getting a list of project file format settings.
type ProjectsFileFormatSettingsResponse ¶
type ProjectsFileFormatSettingsResponse struct {
Data *ProjectsFileFormatSettings `json:"data"`
}
ProjectsFileFormatSettingsResponse defines the structure of a response when retrieving a project file format settings.
type ProjectsGetResponse ¶
type ProjectsGetResponse struct {
Data *Project `json:"data"`
}
ProjectGetResponse defines the structure of a response when retrieving a project.
type ProjectsListOptions ¶
type ProjectsListOptions struct {
ListOptions
// Order projects by.
// Enum: id, name, identifier, description, createdAt, updatedAt, lastActivity. Default: id.
// Example: orderBy=createdAt desc,name,id.
OrderBy string `json:"orderBy,omitempty"`
// User Identifier.
UserID int `json:"userId,omitempty"`
// Projects with Manager Access. Enum: 0, 1. Default: 0.
HasManagerAccess *int `json:"hasManagerAccess,omitempty"`
// Set type to 0 to get all file based projects. Enum: 0, 1.
Type *int `json:"type,omitempty"`
// Filter projects by name.
Filter string `json:"filter,omitempty"`
// Group Identifier (Enterprise only).
// Note: Set 0 to see items of root group.
GroupID *int `json:"groupId,omitempty"`
}
ProjectsListOptions specifies the optional parameters to the ProjectsService.List method.
type ProjectsListResponse ¶
type ProjectsListResponse struct {
Data []*ProjectsGetResponse `json:"data"`
Pagination *Pagination `json:"pagination"`
}
GroupListResponse defines the structure of a response when getting a list of groups.
type ProjectsStringsExporterSettings ¶
type ProjectsStringsExporterSettings struct {
ID int `json:"id"`
Format string `json:"format"`
Settings StringsExporterSettings `json:"settings"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
ProjectsStringsExporterSettings represents a Crowdin project strings exporter settings.
type ProjectsStringsExporterSettingsListResponse ¶
type ProjectsStringsExporterSettingsListResponse struct {
Data []*ProjectsStringsExporterSettingsResponse `json:"data"`
}
ProjectsStringsExporterSettingsListResponse defines the structure of a response when getting a list of project strings exporter settings.
type ProjectsStringsExporterSettingsRequest ¶
type ProjectsStringsExporterSettingsRequest struct {
// Defines strings exporter format. Enum: "android", "macosx", "xliff".
Format string `json:"format"`
// Defines strings exporter settings.
Settings StringsExporterSettings `json:"settings"`
}
ProjectsStringsExporterSettingsRequest defines the structure of a request to update a project strings exporter settings.
func (*ProjectsStringsExporterSettingsRequest) Validate ¶
func (r *ProjectsStringsExporterSettingsRequest) Validate() error
Validate checks if the update request is valid. It implements the crowdin.RequestValidator interface.
type ProjectsStringsExporterSettingsResponse ¶
type ProjectsStringsExporterSettingsResponse struct {
Data *ProjectsStringsExporterSettings `json:"data"`
}
ProjectsStringsExporterSettingsResponse defines the structure of a response when retrieving a project strings exporter settings.
type Prompt ¶ added in v0.5.0
type Prompt struct {
ID int `json:"id"`
Name string `json:"name"`
Action string `json:"action"`
AIProviderID int `json:"aiProviderId"`
AIModelID string `json:"aiModelId"`
IsEnabled bool `json:"isEnabled"`
EnabledProjectIDs []int `json:"enabledProjectIds"`
Config PromptConfig `json:"config"`
// Preview of the compiled prompt.
PromptPreview *string `json:"promptPreview,omitempty"`
// Whether fine-tuning is available for the prompt.
IsFineTuningAvailable bool `json:"isFineTuningAvailable"`
// Identifier of the user who created the prompt.
CreatedBy *int `json:"createdBy,omitempty"`
// Identifier of the user who last updated the prompt.
UpdatedBy *int `json:"updatedBy,omitempty"`
// Identifier of the user who last used the prompt.
LastUsedBy *int `json:"lastUsedBy,omitempty"`
// Date and time when the prompt was last used.
LastUsedAt *string `json:"lastUsedAt,omitempty"`
// Total number of times the prompt has been used.
UsageCount int `json:"usageCount"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Prompt represents an AI prompt.
type PromptAction ¶ added in v0.5.0
type PromptAction string
PromptAction represents the action of an AI prompt.
const ( // ActionPreTranslate is the pre-translation action. ActionPreTranslate PromptAction = "pre_translate" // ActionAssist is the assist action. // // Deprecated: the assist action has been removed from the API. ActionAssist PromptAction = "assist" // ActionQACheck is the QA check action. ActionQACheck PromptAction = "qa_check" // ActionAlignment is the alignment action (Enterprise only). ActionAlignment PromptAction = "alignment" )
type PromptAddRequest ¶ added in v0.5.0
type PromptAddRequest struct {
// AI prompt name.
Name string `json:"name"`
// AI prompt action. Enum: pre_translate, qa_check, alignment (Enterprise only).
Action PromptAction `json:"action"`
// AI Provider identifier.
AIProviderID int `json:"aiProviderId"`
// AI Model identifier.
AIModelID string `json:"aiModelId"`
// Is AI prompt enabled. Default: true.
//
// Deprecated: this field is deprecated in the API.
IsEnabled *bool `json:"isEnabled,omitempty"`
// List of enabled project IDs.
EnabledProjectIDs []int `json:"enabledProjectIds,omitempty"`
// AI prompt configuration.
Config PromptConfig `json:"config"`
}
PromptAddRequest defines the structure of a request to add an AI prompt.
func (*PromptAddRequest) Validate ¶ added in v0.5.0
func (r *PromptAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type PromptCloneRequest ¶ added in v0.19.0
type PromptCloneRequest struct {
// Name of the cloned AI prompt.
Name string `json:"name,omitempty"`
}
PromptCloneRequest defines the structure of a request to clone an AI prompt.
func (*PromptCloneRequest) Validate ¶ added in v0.19.0
func (r *PromptCloneRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type PromptCompletion ¶ added in v0.19.0
type PromptCompletion struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *PromptCompletionAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
PromptCompletion represents an AI prompt completion job.
type PromptCompletionAttributes ¶ added in v0.19.0
type PromptCompletionAttributes struct {
AIPromptID int `json:"aiPromptId"`
}
PromptCompletionAttributes represents the attributes of an AI prompt completion job.
type PromptCompletionOverridePromptValues ¶ added in v0.19.0
type PromptCompletionOverridePromptValues struct {
SourceLanguage string `json:"sourceLanguage,omitempty"`
TargetLanguage string `json:"targetLanguage,omitempty"`
Strings string `json:"strings,omitempty"`
TranslationUnits string `json:"translationUnits,omitempty"`
// Alignment pairs (Enterprise only, alignment action).
AlignmentPairs string `json:"alignmentPairs,omitempty"`
TM string `json:"tm,omitempty"`
Terms string `json:"terms,omitempty"`
FileName string `json:"fileName,omitempty"`
FileContext string `json:"fileContext,omitempty"`
FileContent string `json:"fileContent,omitempty"`
FilteredStrings string `json:"filteredStrings,omitempty"`
SiblingsStrings string `json:"siblingsStrings,omitempty"`
PluralForms string `json:"pluralForms,omitempty"`
ProjectName string `json:"projectName,omitempty"`
ProjectDescription string `json:"projectDescription,omitempty"`
// Organization name (Enterprise only).
OrganizationName string `json:"organizationName,omitempty"`
// Organization description (Enterprise only).
OrganizationDescription string `json:"organizationDescription,omitempty"`
}
PromptCompletionOverridePromptValues represents the values used to override the prompt placeholders. Available keys depend on the prompt action.
type PromptCompletionRequest ¶ added in v0.19.0
type PromptCompletionRequest struct {
// AI prompt context resources.
Resources *PromptCompletionResources `json:"resources"`
// List of AI tools.
Tools []*PromptCompletionTool `json:"tools,omitempty"`
// Controls which (if any) tool is called by the model.
// Can be a string (e.g. "auto", "none") or an object.
ToolChoice any `json:"tool_choice,omitempty"`
}
PromptCompletionRequest defines the structure of a request to generate an AI prompt completion.
func (*PromptCompletionRequest) Validate ¶ added in v0.19.0
func (r *PromptCompletionRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type PromptCompletionResources ¶ added in v0.19.0
type PromptCompletionResources struct {
// Project identifier.
ProjectID int `json:"projectId"`
// Source language identifier. If not specified, the source language
// of the project will be used.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Target language identifier.
TargetLanguageID string `json:"targetLanguageId,omitempty"`
// String identifiers (up to 500).
// Note: Must be used together with `targetLanguageId`.
StringIDs []int `json:"stringIds,omitempty"`
// Values to override the prompt placeholders with.
OverridePromptValues *PromptCompletionOverridePromptValues `json:"overridePromptValues,omitempty"`
// Custom instruction (prompts with a custom action).
CustomInstruction string `json:"customInstruction,omitempty"`
}
PromptCompletionResources represents the context resources of an AI prompt completion.
type PromptCompletionResponse ¶ added in v0.19.0
type PromptCompletionResponse struct {
Data *PromptCompletion `json:"data"`
}
PromptCompletionResponse defines the structure of a response when getting an AI prompt completion job.
type PromptCompletionTool ¶ added in v0.19.0
type PromptCompletionTool struct {
Tool *AITool `json:"tool"`
}
PromptCompletionTool represents an AI tool of a prompt completion request.
type PromptConfig ¶ added in v0.5.0
type PromptConfig struct {
// Prompt mode. Enum: basic, advanced, external.
Mode PromptMode `json:"mode"`
// Deprecated: use Snippets instead.
CompanyDescription *string `json:"companyDescription,omitempty"`
// Deprecated: use Snippets instead.
ProjectDescription *string `json:"projectDescription,omitempty"`
// Deprecated: use Snippets instead.
AudienceDescription *string `json:"audienceDescription,omitempty"`
// Array of snippet placeholders. Get via AIService.ListSnippets.
Snippets []string `json:"snippets,omitempty"`
OtherLanguageTranslations *OtherLanguageTranslations `json:"otherLanguageTranslations,omitempty"`
GlossaryTerms *bool `json:"glossaryTerms,omitempty"`
TMSuggestions *bool `json:"tmSuggestions,omitempty"`
// Deprecated: this field is deprecated in the API.
FileContent *bool `json:"fileContent,omitempty"`
FileContext *bool `json:"fileContext,omitempty"`
// Generate a file summary to use as context.
GenerateFileSummary *bool `json:"generateFileSummary,omitempty"`
// Include screenshots in the prompt context.
Screenshots *bool `json:"screenshots,omitempty"`
// Include the project name and description in the prompt context.
ProjectContext *bool `json:"projectContext,omitempty"`
// Include the organization name and internal description in the
// prompt context. Enterprise only (basic mode).
OrganizationContext *bool `json:"organizationContext,omitempty"`
// Deprecated: use ProjectContext instead.
PublicProjectDescription *bool `json:"publicProjectDescription,omitempty"`
SiblingsStrings *bool `json:"siblingsStrings,omitempty"`
FilteredStrings *bool `json:"filteredStrings,omitempty"`
// Retry the translation when QA issues are found (pre-translate action).
RetryOnQAIssues *bool `json:"retryOnQaIssues,omitempty"`
// Evaluation steps (basic mode, QA check action).
EvaluationSteps []string `json:"evaluationSteps,omitempty"`
// Prompt text (advanced mode).
Prompt *string `json:"prompt,omitempty"`
// Application identifier (external mode).
Identifier string `json:"identifier,omitempty"`
// Module key (external mode).
Key string `json:"key,omitempty"`
// Options to compile the prompt (external mode).
Options map[string]any `json:"options,omitempty"`
}
PromptConfig represents the configuration of an AI prompt.
type PromptMode ¶ added in v0.5.0
type PromptMode string
PromptMode represents the mode of an AI prompt configuration.
const ( // ModeBasic is the basic prompt mode. ModeBasic PromptMode = "basic" // ModeAdvanced is the advanced prompt mode. ModeAdvanced PromptMode = "advanced" // ModeExternal is the external prompt mode (prompt provided by an application). ModeExternal PromptMode = "external" )
type PromptResponse ¶ added in v0.5.0
type PromptResponse struct {
Data *Prompt `json:"data"`
}
PromptResponse defines the structure of a response when getting a single AI prompt.
type PromptsListResponse ¶ added in v0.5.0
type PromptsListResponse struct {
Data []*PromptResponse `json:"data"`
}
PromptsListResponse defines the structure of a response when getting a list of AI prompts.
type PropertyFileExportOptions ¶
type PropertyFileExportOptions struct {
// File export pattern. Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols.
ExportPattern string `json:"exportPattern,omitempty"`
// Values available:
// 0 - Do not escape single quote.
// 1 - Escape single quote by another single quote.
// 2 - Escape single quote by a backslash.
// 3 - Escape single quote by another single quote only in strings containing variables ({0}).
EscapeQuotes *int `json:"escapeQuotes,omitempty"`
// Defines whether any special characters (=, :, ! and #) should be escaped by
// backslash in exported translations. You can add escape_special_characters per-file option.
// Acceptable values are: 0, 1. Default is 0.
// 0 - Do not escape special characters.
// 1 - Escape special characters by a backslash.
EscapeSpecialCharacters *int `json:"escapeSpecialCharacters,omitempty"`
}
PropertiesFileExportOptions implements the FileExportOptions interface.
func (*PropertyFileExportOptions) ValidateFileExportOptions ¶
func (o *PropertyFileExportOptions) ValidateFileExportOptions() error
type PropertyFileFormatSettings ¶
type PropertyFileFormatSettings struct {
// File export pattern. Default: null.
// Defines file name and path in resulting translations bundle.
// Note: Can't contain : * ? " < > | symbols
ExportPattern *string `json:"exportPattern,omitempty"`
// Enum: 0, 1, 2, 3. Default: 1.
// 0 - Do not escape single quote.
// 1 - Escape single quote by another single quote.
// 2 - Escape single quote by a backslash.
// 3 - Escape single quote by another single quote only in strings containing variables ({0}).
EscapeQuotes *int `json:"escapeQuotes,omitempty"`
// Enum: 0, 1. Default: 1.
// Defines whether any special characters (=, :, ! and #) should be escaped by backslash in exported translations.
// You can add escape_special_characters per-file option. *
// Acceptable values are: 0, 1. Default is 0.
// 0 - Do not escape special characters.
// 1 - Escape special characters by a backslash.
EscapeSpecialCharacters *int `json:"escapeSpecialCharacters,omitempty"`
}
func (*PropertyFileFormatSettings) ValidateSettings ¶
func (p *PropertyFileFormatSettings) ValidateSettings() error
type Provider ¶ added in v0.5.0
type Provider struct {
ID int `json:"id"`
Name string `json:"name"`
Type ProviderType `json:"type"`
// Provider credentials with string values only (e.g. apiKey, baseUrl).
// See RawCredentials for the full credentials object.
Credentials map[string]string `json:"credentials"`
// RawCredentials is the full credentials object. Depending on the provider
// type, values can be strings, booleans (sendCustomHeadersOnly),
// objects (headers, serviceAccountKey) or arrays (deployments).
RawCredentials map[string]any `json:"-"`
Config ProviderConfig `json:"config"`
IsEnabled bool `json:"isEnabled"`
UseSystemCredentials bool `json:"useSystemCredentials"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// Number of prompts that use the provider.
PromptsCount int `json:"promptsCount"`
}
Provider represents an AI provider.
func (*Provider) UnmarshalJSON ¶ added in v0.19.0
UnmarshalJSON decodes an AI provider. The full `credentials` object is stored in RawCredentials, and its string values are also copied to Credentials.
type ProviderAddRequest ¶ added in v0.5.0
type ProviderAddRequest struct {
// AI provider name.
Name string `json:"name"`
// AI provider type.
// Enum: open_ai, azure_open_ai, google_gemini, google_gemini_ai_studio,
// mistral_ai, anthropic, x_ai, watsonx, deepseek, microsoft_foundry, custom_ai.
Type ProviderType `json:"type"`
// User’s own AI provider credentials.
// Note: Use only if useSystemCredentials is set to `false`.
Credentials map[string]string `json:"credentials,omitempty"`
// AI provider configuration.
//
// Deprecated: this field is deprecated in the API.
Config ProviderConfig `json:"config,omitempty"`
// Defines whether to AI provider is enabled. Default: true.
IsEnabled *bool `json:"isEnabled,omitempty"`
// Enables the paid service AI provider via Crowdin.
// Note: Set to true if `credentials` is not provided. Not supported
// for `custom_ai` type.
UseSystemCredentials *bool `json:"useSystemCredentials,omitempty"`
}
ProviderAddRequest defines the structure of a request to add an AI provider.
func (*ProviderAddRequest) Validate ¶ added in v0.5.0
func (r *ProviderAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ProviderConfig ¶ added in v0.5.0
type ProviderConfig struct {
// Action rules.
ActionRules []ActionRule `json:"actionRules"`
}
ProviderConfig represents the configuration of an AI provider.
type ProviderModel ¶ added in v0.5.0
type ProviderModel struct {
ID string `json:"id"`
Provider *string `json:"provider,omitempty"`
ProviderName *string `json:"providerName,omitempty"`
ProviderID *int `json:"providerId,omitempty"`
// Context window size in tokens.
ContextWindow *int `json:"contextWindow,omitempty"`
// Maximum output tokens.
MaxOutputTokens *int `json:"maxOutputTokens,omitempty"`
// Whether the model supports streaming responses.
SupportsStreaming *bool `json:"supportsStreaming,omitempty"`
// Whether the model supports function/tool calling.
SupportsFunctionCalling *bool `json:"supportsFunctionCalling,omitempty"`
// Whether the model supports JSON mode.
SupportsJSONMode *bool `json:"supportsJsonMode,omitempty"`
// Whether the model supports structured output via JSON Schema.
SupportsJSONSchema *bool `json:"supportsJsonSchema,omitempty"`
// Whether the model accepts image input (vision).
SupportsVision *bool `json:"supportsVision,omitempty"`
// Whether the model can be used while AI cost limits are in effect.
IsCompatibleWithAILimit bool `json:"isCompatibleWithAiLimit"`
}
ProviderModel represents an AI provider model.
type ProviderModelResponse ¶ added in v0.5.0
type ProviderModelResponse struct {
Data *ProviderModel `json:"data"`
}
ProviderModelResponse defines the structure of a response when getting an AI provider model.
type ProviderModelsListResponse ¶ added in v0.5.0
type ProviderModelsListResponse struct {
Data []*ProviderModelResponse `json:"data"`
}
ProviderModelsListResponse defines the structure of a response when getting a list of AI provider models.
type ProviderResponse ¶ added in v0.5.0
type ProviderResponse struct {
Data *Provider `json:"data"`
}
ProviderResponse defines the structure of a response when getting a single AI provider.
type ProviderType ¶ added in v0.5.0
type ProviderType string
ProviderType represents the type of an AI provider.
const ( OpenAI ProviderType = "open_ai" AzureOpenAI ProviderType = "azure_open_ai" GoogleGemini ProviderType = "google_gemini" GoogleGeminiAIStudio ProviderType = "google_gemini_ai_studio" MistralAI ProviderType = "mistral_ai" Anthropic ProviderType = "anthropic" XAI ProviderType = "x_ai" Watsonx ProviderType = "watsonx" DeepSeek ProviderType = "deepseek" MicrosoftFoundry ProviderType = "microsoft_foundry" CustomAI ProviderType = "custom_ai" )
type ProvidersListResponse ¶ added in v0.5.0
type ProvidersListResponse struct {
Data []*ProviderResponse `json:"data"`
}
ProvidersListResponse defines the structure of a response when getting a list of AI providers.
type ProxyChatCompletion ¶ added in v0.5.0
type ProxyChatCompletion struct{}
ProxyChatCompletion represents an AI proxy chat completion.
type ProxyChatCompletionResponse ¶ added in v0.5.0
type ProxyChatCompletionResponse struct {
Data *ProxyChatCompletion `json:"data"`
}
ProxyChatCompletionResponse defines the structure of a response when getting an AI proxy chat completion.
type PseudoBuildProjectRequest ¶
type PseudoBuildProjectRequest struct {
// Flag for detecting pseudo translation. Default: false.
Pseudo *bool `json:"pseudo"`
// Branch Identifier.
BranchID int `json:"branchId,omitempty"`
// Add special characters at the beginning of each string to show
// where messages have been concatenated together.
Prefix string `json:"prefix,omitempty"`
// Add special characters at the end of each string to show where
// messages have been concatenated together.
Suffix string `json:"suffix,omitempty"`
// Make string larger or shorter.
// Acceptable values must be from -50 to 100. Default is 0.
LengthTransformation *int `json:"lengthTransformation,omitempty"`
// Transforms characters to other languages.
// Enum: "asian", "cyrillic", "european", "arabic".
CharTransformation string `json:"charTransformation,omitempty"`
}
PsuedoBuildProjectRequest defines the structure of a request to build a project with pseudo translations.
func (*PseudoBuildProjectRequest) Validate ¶
func (r *PseudoBuildProjectRequest) Validate() error
Validate checks if the build project request is valid. It implements the crowdin.RequestValidator interface.
func (*PseudoBuildProjectRequest) ValidateBuildRequest ¶
func (r *PseudoBuildProjectRequest) ValidateBuildRequest() error
PseudoBuildProjectRequest implements the BuildProjectTranslationRequest interface.
type QACheck ¶
type QACheck struct {
StringID int `json:"stringId"`
LanguageID string `json:"languageId"`
Category string `json:"category"`
CategoryDescription string `json:"categoryDescription"`
Validation string `json:"validation"`
ValidationDescription string `json:"validationDescription"`
PluralID int `json:"pluralId"`
Text string `json:"text"`
}
QACheck represents a QA check issue.
type QACheckIssuesSchema ¶ added in v0.18.0
type QACheckIssuesSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
QACheckIssuesSchema defines the schema for the QA check issues report.
func (*QACheckIssuesSchema) ValidateSchema ¶ added in v0.18.0
func (r *QACheckIssuesSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the QACheckIssues schema is valid.
type QACheckListOptions ¶
type QACheckListOptions struct {
// Defines category of QA check issue. It can be one category or a list of comma-separated ones.
// Example: category=variables,tags
// Enum: empty, variables, tags, punctuation, symbol_register, spaces, size, special_symbols,
// wrong_translation, spellcheck, icu
Category []string `json:"category,omitempty"`
// Defines the QA check issue validation type. It can be one validation type or a list
// of comma-separated ones. Example: validation=capitalize_check,punctuation_check
// Enum: empty_string_check, empty_suggestion_check, max_length_check, tags_check,
// mismatch_ids_check, cdata_check, specials_symbols_check, leading_newlines_check,
// trailing_newlines_check, leading_spaces_check, trailing_spaces_check, multiple_spaces_check,
// custom_blocked_variables_check, highest_priority_custom_variables_check,
// highest_priority_variables_check, c_variables_check, python_variables_check,
// rails_variables_check, java_variables_check, dot_net_variables_check, twig_variables_check,
// php_variables_check, freemarker_variables_check, lowest_priority_variable_check,
// lowest_priority_custom_variables_check, punctuation_check, spaces_before_punctuation_check,
// spaces_after_punctuation_check, non_breaking_spaces_check, capitalize_check,
// multiple_uppercase_check, parentheses_check, entities_check, escaped_quotes_check,
// wrong_translation_issue_check, spellcheck, icu_check
Validation []string `json:"validation,omitempty"`
// Filter progress by Language Identifier.
LanguageIDs []string `json:"languageIds,omitempty"`
// Filter the collection by the specified task identifier.
TaskID int `json:"taskId,omitempty"`
// Filter the collection by the specified file identifier.
FileID int `json:"fileId,omitempty"`
ListOptions
}
QACheckListOptions specifies the optional parameters to the TranslationStatusService.ListQAChecks method.
type QACheckRevalidation ¶ added in v0.19.0
type QACheckRevalidation struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *QACheckRevalidationAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt *string `json:"startedAt"`
FinishedAt *string `json:"finishedAt"`
}
QACheckRevalidation represents a QA checks revalidation job.
type QACheckRevalidationAttributes ¶ added in v0.19.0
type QACheckRevalidationAttributes struct {
LanguageIDs []string `json:"languageIds"`
QACheckCategories []string `json:"qaCheckCategories"`
FailedOnly bool `json:"failedOnly"`
ExternalQACheckIDs []int `json:"externalQaCheckIds,omitempty"`
}
QACheckRevalidationAttributes represents the attributes of a QA checks revalidation job.
type QACheckRevalidationRequest ¶ added in v0.19.0
type QACheckRevalidationRequest struct {
// QA check categories to revalidate. If not specified,
// all active categories will be checked. Enum: terms, ai.
QACheckCategories []string `json:"qaCheckCategories,omitempty"`
// Language IDs to revalidate. If not specified, all languages will be checked.
LanguageIDs []string `json:"languageIds,omitempty"`
// If true, only languages with failed QA checks will be revalidated.
// Default: false.
FailedOnly *bool `json:"failedOnly,omitempty"`
// External QA check IDs to revalidate.
// Note: Available only for Crowdin Enterprise.
ExternalQACheckIDs []int `json:"externalQaCheckIds,omitempty"`
}
QACheckRevalidationRequest defines the structure of a request to revalidate QA checks.
func (*QACheckRevalidationRequest) Validate ¶ added in v0.19.0
func (r *QACheckRevalidationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type QACheckRevalidationResponse ¶ added in v0.19.0
type QACheckRevalidationResponse struct {
Data *QACheckRevalidation `json:"data"`
}
QACheckRevalidationResponse defines the structure of a response when revalidating QA checks or getting a revalidation status.
type QACheckValidateRequest ¶ added in v0.19.0
type QACheckValidateRequest struct {
// String Identifier.
StringID int `json:"stringId"`
// Language Identifier.
LanguageID string `json:"languageId"`
// Translation text.
Text string `json:"text"`
// Plural form. Enum: zero, one, two, few, many, other.
PluralCategoryName string `json:"pluralCategoryName,omitempty"`
}
QACheckValidateRequest defines the structure of a single item of the request to validate text by QA checks.
func (*QACheckValidateRequest) Validate ¶ added in v0.19.0
func (r *QACheckValidateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type QACheckValidation ¶ added in v0.19.0
type QACheckValidation struct {
StringID int `json:"stringId"`
LanguageID string `json:"languageId"`
Category string `json:"category"`
CategoryDescription string `json:"categoryDescription"`
Validation string `json:"validation"`
ValidationDescription string `json:"validationDescription"`
PluralID int `json:"pluralId"`
PluralCategoryName string `json:"pluralCategoryName"`
Text string `json:"text"`
Translation string `json:"translation"`
}
QACheckValidation represents a QA check issue found when validating text.
type QACheckValidationsResponse ¶ added in v0.19.0
type QACheckValidationsResponse struct {
Data []struct {
Data *QACheckValidation `json:"data"`
} `json:"data"`
}
QACheckValidationsResponse defines the structure of a response when validating text by QA checks.
type QAChecksResponse ¶
type QAChecksResponse struct {
Data []struct {
Data *QACheck `json:"data"`
} `json:"data"`
}
QAChecksResponse defines the structure of a response when getting a list of QA check issues.
type QAChecksStatus ¶ added in v0.19.0
type QAChecksStatus struct {
Total int `json:"total"`
InProgress int `json:"inProgress"`
Passed int `json:"passed"`
Failed int `json:"failed"`
}
QAChecksStatus represents the QA checks status statistics of a translation progress.
type ReactIntlFileFormatSettings ¶
type ReactIntlFileFormatSettings struct{ CommonFileFormatSettings }
type ReplaceTagsRequest ¶ added in v0.2.0
type ReplaceTagsRequest struct {
// String Identifier.
StringID int `json:"stringId"`
// Tag position.
Position *TagPosition `json:"position,omitempty"`
}
ReplaceTagsRequest defines the structure of a request to replace tags.
func (*ReplaceTagsRequest) Validate ¶ added in v0.2.0
func (r *ReplaceTagsRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ReplaceTranslationsOption ¶ added in v0.19.0
type ReplaceTranslationsOption string
ReplaceTranslationsOption defines whether pre-translation replaces existing translations.
const ( // ReplaceTranslationsOptionNone adds the new translation alongside // existing ones (default). ReplaceTranslationsOptionNone ReplaceTranslationsOption = "none" // ReplaceTranslationsOptionAutoTranslated replaces auto-generated translations // (TM, MT, AI). Human translations are kept. ReplaceTranslationsOptionAutoTranslated ReplaceTranslationsOption = "autoTranslated" // ReplaceTranslationsOptionAll replaces all existing translations. ReplaceTranslationsOptionAll ReplaceTranslationsOption = "all" )
type ReportArchive ¶ added in v0.4.0
type ReportArchive struct {
ID int `json:"id"`
ScopeType string `json:"scopeType"`
ScopeID int `json:"scopeId"`
UserID int `json:"userId"`
Name string `json:"name"`
WebURL string `json:"webUrl"`
Scheme any `json:"scheme"`
Status string `json:"status,omitempty"`
Progress int `json:"progress,omitempty"`
CreatedAt string `json:"createdAt"`
}
ReportArchive represents a report archive.
type ReportArchiveListResponse ¶ added in v0.4.0
type ReportArchiveListResponse struct {
Data []*ReportArchiveResponse `json:"data"`
}
ReportArchiveListResponse defines the structure of a response when getting a list of report archives.
type ReportArchiveResponse ¶ added in v0.4.0
type ReportArchiveResponse struct {
Data *ReportArchive `json:"data"`
}
ReportArchiveResponse defines the structure of a response when getting a report archive.
type ReportArchivesListOptions ¶ added in v0.4.0
type ReportArchivesListOptions struct {
// Filter only project report archives.
// Enum: project, organization, group.
ScopeType ReportScopeType `json:"scopeType,omitempty"`
// Filter archives by specific scope id.
// [Enterprise client] Use only if scopeType set to group or project.
ScopeID int `json:"scopeId,omitempty"`
// Filter archives by user identifier.
UserID int `json:"userId,omitempty"`
// Filter archives by task identifier.
TaskID int `json:"taskId,omitempty"`
// Filter archives by name.
Name string `json:"name,omitempty"`
// Archive date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Archive date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
ListOptions
}
ReportArchivesListOptions specifies the optional parameters to the ReportsService.ListArchives method.
type ReportBaseRates ¶ added in v0.4.0
type ReportBaseRates struct {
// Applies to all languages by default.
FullTranslation float64 `json:"fullTranslation,omitempty"`
Proofread float64 `json:"proofread,omitempty"`
// Hourly rate. Used by the time spent reports and
// hourly report settings templates.
Hourly float64 `json:"hourly,omitempty"`
}
ReportBaseRates defines the base rates for a report.
type ReportFormat ¶ added in v0.4.0
type ReportFormat string
ReportFormat represents the format of a report file to export.
const ( ReportFormatXLSX ReportFormat = "xlsx" ReportFormatCSV ReportFormat = "csv" ReportFormatJSON ReportFormat = "json" )
type ReportGenerateRequest ¶ added in v0.4.0
type ReportGenerateRequest struct {
// Report name.
Name ReportName `json:"name"`
// Schema for the report generation request.
// Can be one of the following types:
// - CostsEstimationPostEditingSchema
// - TransactionCostsPostEditingSchema
// - TopMembersSchema
// - ContributionRawDataSchema
// - TranslatorAccuracySchema
// - PreTranslateAccuracySchema
// - PreTranslateEfficiencySchema (Deprecated)
// - SourceContentUpdatesSchema
// - ProjectMembersSchema
// - EditorIssuesSchema
// - QACheckIssuesSchema
// - SavingActivitySchema
// - TranslationActivitySchema
// - TimeSpentSchema
// - TaskUsageSchema (Enterprise only)
Schema ReportSchema `json:"schema"`
}
ReportGenerateRequest defines the structure of a request to generate a report.
func (*ReportGenerateRequest) Validate ¶ added in v0.4.0
func (r *ReportGenerateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ReportGroupSchema ¶ added in v0.4.0
type ReportGroupSchema interface {
ValidateGroupSchema() error
}
ReportGroupSchema is an interface that defines the schema for a group report generation request.
Schema can be one of the following types:
- GroupTransactionCostsPostEditingSchema
- GroupTopMembersSchema
- GroupTaskUsageSchema
- GroupQACheckIssuesSchema
- GroupTranslationActivitySchema
- GroupSourceContentUpdatesSchema
- GroupTimeSpentSchema
- GroupPreTranslateAccuracySchema
- GroupTranslatorAccuracySchema
- GroupSavingActivitySchema
type ReportIndividualRates ¶ added in v0.4.0
type ReportIndividualRates struct {
LanguageIDs []string `json:"languageIds,omitempty"`
UserIDs []int `json:"userIds,omitempty"`
FullTranslation float64 `json:"fullTranslation,omitempty"`
Proofread float64 `json:"proofread,omitempty"`
// Hourly rate. Used by the time spent reports and
// hourly report settings templates.
Hourly float64 `json:"hourly,omitempty"`
}
ReportIndividualRates defines the individual rates for a report. Custom rates for certain languages or users.
type ReportMode ¶ added in v0.4.0
type ReportMode string
ReportMode represents the mode of a report.
const ( ReportModeTranslations ReportMode = "translations" ReportModeApprovals ReportMode = "approvals" ReportModeVotes ReportMode = "votes" )
type ReportName ¶ added in v0.4.0
type ReportName string
ReportName represents the name of a report.
const ( ReportCostsEstimationPostEditing ReportName = "costs-estimation-pe" ReportTransactionCostsPostEditing ReportName = "translation-costs-pe" ReportContributionRawData ReportName = "contribution-raw-data" ReportTopMembers ReportName = "top-members" ReportTranslatorAccuracy ReportName = "translator-accuracy" ReportPreTranslateAccuracy ReportName = "pre-translate-accuracy" ReportSourceContentUpdates ReportName = "source-content-updates" ReportProjectMembers ReportName = "project-members" ReportEditorIssues ReportName = "editor-issues" ReportQACheckIssues ReportName = "qa-check-issues" ReportSavingActivity ReportName = "saving-activity" ReportTranslationActivity ReportName = "translation-activity" ReportTimeSpent ReportName = "time-spent" // ReportTaskUsage is available for the Enterprise client only. ReportTaskUsage ReportName = "task-usage" // Deprecated: Use ReportPreTranslateAccuracy instead. ReportPreTranslateEfficiency ReportName = "pre-translate-efficiency" // Organization reports. ReportGroupTranslationCostsPostEditing ReportName = "group-translation-costs-pe" ReportGroupTopMembers ReportName = "group-top-members" ReportGroupTaskUsage ReportName = "group-task-usage" ReportGroupQACheckIssues ReportName = "group-qa-check-issues" ReportGroupTranslationActivity ReportName = "group-translation-activity" ReportGroupSourceContentUpdates ReportName = "group-source-content-updates" ReportGroupTimeSpent ReportName = "group-time-spent" ReportGroupPreTranslateAccuracy ReportName = "group-pre-translate-accuracy" ReportGroupTranslatorAccuracy ReportName = "group-translator-accuracy" ReportGroupSavingActivity ReportName = "group-saving-activity" )
type ReportNetRateSchemeMatch ¶ added in v0.4.0
type ReportNetRateSchemeMatch struct {
// Match type, %. Enum: perfect, 100, 99-82, 81-60.
MatchType string `json:"matchType,omitempty"`
// Price, %.
Price float64 `json:"price,omitempty"`
}
ReportNetRateSchemeMatch defines the match type and price for a net rate scheme.
type ReportNetRateSchemes ¶ added in v0.4.0
type ReportNetRateSchemes struct {
// Match type enum: "perfect", "100", "99-82", "81-60".
TMMatch []ReportNetRateSchemeMatch `json:"tmMatch,omitempty"`
// Match type enum: "100", "99-82", "81-60".
MTMatch []ReportNetRateSchemeMatch `json:"mtMatch,omitempty"`
// AI match. Match type: "100" or a percentage range (e.g., "99-82").
// Note: If this field is not filled in, the schema will use the MT match values.
AIMatch []ReportNetRateSchemeMatch `json:"aiMatch,omitempty"`
// Match type enum: "100", "99-82".
SuggestionMatch []ReportNetRateSchemeMatch `json:"suggestionMatch,omitempty"`
}
ReportNetRateSchemes defines the net rate schemes for a report. Percentage paid of full translation rate.
type ReportSchema ¶ added in v0.4.0
type ReportSchema interface {
ValidateSchema() error
}
ReportSchema is an interface that defines the schema for a report generation request.
type ReportScopeType ¶ added in v0.4.0
type ReportScopeType string
ReportScopeType represents the scope type of a report.
const ( ReportScopeTypeProject ReportScopeType = "project" ReportScopeTypeOrganization ReportScopeType = "organization" ReportScopeTypeGroup ReportScopeType = "group" )
type ReportSettingsTemplate ¶ added in v0.4.0
type ReportSettingsTemplate struct {
ID int `json:"id"`
Name string `json:"name"`
Currency string `json:"currency"`
Unit string `json:"unit"`
Config ReportSettingsTemplateConfig `json:"config"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
IsPublic bool `json:"isPublic"`
IsGlobal *bool `json:"isGlobal,omitempty"`
ProjectID int `json:"projectId,omitempty"`
GroupID int `json:"groupId,omitempty"`
}
ReportSettingsTemplate represents a report settings template.
type ReportSettingsTemplateAddRequest ¶ added in v0.4.0
type ReportSettingsTemplateAddRequest struct {
// Template name.
Name string `json:"name"`
// Report currency.
// Enum: USD, EUR, JPY, GBP, AUD, CAD, CHF, CNY, SEK, NZD, MXN,
// SGD, HKD, NOK, KRW, TRY, RUB, INR, BRL, ZAR, GEL, UAH, DDK
Currency string `json:"currency"`
// Report unit.
// Enum: strings, words, chars, chars_with_spaces
Unit ReportUnit `json:"unit"`
// Report config.
Config *ReportSettingsTemplateConfig `json:"config"`
// Report visibility.
IsPublic *bool `json:"isPublic,omitempty"`
// Report global visibility.
IsGlobal *bool `json:"isGlobal,omitempty"`
// [Enterprise client] Project Identifier.
ProjectID int `json:"projectId,omitempty"`
// [Enterprise client] Group Identifier.
GroupID int `json:"groupId,omitempty"`
}
ReportSettingsTemplateAddRequest defines the structure of a request to add a report settings template.
func (*ReportSettingsTemplateAddRequest) Validate ¶ added in v0.4.0
func (r *ReportSettingsTemplateAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ReportSettingsTemplateConfig ¶ added in v0.4.0
type ReportSettingsTemplateConfig struct {
// Base rates.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates (Custom rates for certain languages or users).
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Net Rate Schemes (Percentage paid of full translation rate).
// Note: A new translation will be included in the report at the lowest rate
// if multiple scheme categories can be applied to the translation.
NetRateSchemes *ReportNetRateSchemes `json:"netRateSchemes,omitempty"`
// Calculate internal matches.
CalculateInternalMatches *bool `json:"calculateInternalMatches,omitempty"`
// Include pre-translated strings.
IncludePreTranslatedStrings *bool `json:"includePreTranslatedStrings,omitempty"`
// Approvals are treated as submitting an identical translation at the
// 100% match rate of the corresponding category.
UseCategoryBasedProofreadRates *bool `json:"useCategoryBasedProofreadRates,omitempty"`
// Calculations are based on the edit distance between the TM match
// and final translation.
UseTmEditDistance *bool `json:"useTmEditDistance,omitempty"`
}
ReportSettingsTemplateUpdateRequest defines the structure of a request to create a report settings template.
type ReportSettingsTemplateListResponse ¶ added in v0.4.0
type ReportSettingsTemplateListResponse struct {
Data []*ReportSettingsTemplateResponse `json:"data"`
}
ReportSettingsTemplateListResponse defines the structure of a response when getting a list of report settings templates.
type ReportSettingsTemplateResponse ¶ added in v0.4.0
type ReportSettingsTemplateResponse struct {
Data *ReportSettingsTemplate `json:"data"`
}
ReportSettingsTemplateResponse defines the structure of a response when getting a report settings template.
type ReportSettingsTemplatesListOptions ¶ added in v0.4.0
type ReportSettingsTemplatesListOptions struct {
// [Enterprise client] Project Identifier.
ProjectID int `json:"projectId,omitempty"`
// [Enterprise client] Group Identifier.
GroupID int `json:"groupId,omitempty"`
ListOptions
}
ReportSettingsTemplatesListOptions specifies the optional parameters to the ReportsService.ListTemplates method.
type ReportStatus ¶ added in v0.4.0
type ReportStatus struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes ReportStatusAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
ReportStatus represents the status of a generated or archived report.
type ReportStatusAttributes ¶ added in v0.4.0
type ReportStatusAttributes struct {
Format string `json:"format"`
ReportName string `json:"reportName"`
Schema any `json:"schema"`
}
ReportStatusAttributes represents the attributes of a report status.
type ReportStatusResponse ¶ added in v0.4.0
type ReportStatusResponse struct {
Data *ReportStatus `json:"data"`
}
ReportStatusResponse defines the structure of a response when getting a report status.
type ReportUnit ¶ added in v0.4.0
type ReportUnit string
ReportUnit represents a unit of a report.
const ( ReportUnitStrings ReportUnit = "strings" ReportUnitWords ReportUnit = "words" ReportUnitChars ReportUnit = "chars" ReportUnitCharsWithSpaces ReportUnit = "chars_with_spaces" // ReportUnitHours is used by hourly report settings templates. ReportUnitHours ReportUnit = "hours" )
type ReviewedBuild ¶
type ReviewedBuild struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
BranchID *int `json:"branchId,omitempty"`
TargetLanguageID string `json:"targetLanguageId"`
} `json:"attributes"`
}
ReviewedBuild represents a reviewed source file build.
type ReviewedBuildListOptions ¶
type ReviewedBuildListOptions struct {
// BranchID is the ID of the branch to filter reviewed builds by.
BranchID int `json:"branchId,omitempty"`
ListOptions
}
ReviewedBuildListOptions specifies the optional parameters to the SourceFilesService.ListReviewedBuilds method.
type ReviewedBuildListResponse ¶
type ReviewedBuildListResponse struct {
Data []*ReviewedBuildResponse `json:"data"`
}
ReviewedBuildListResponse describes a response with a list of reviewed builds.
type ReviewedBuildRequest ¶
type ReviewedBuildRequest struct {
// Branch Identifier.
BranchID int `json:"branchId,omitempty"`
}
ReviewedBuildRequest defines the structure of a request to create a new reviewed build.
func (*ReviewedBuildRequest) Validate ¶
func (r *ReviewedBuildRequest) Validate() error
Validate checks if the reviewed build request is valid. It implements the crowdin.RequestValidator interface.
type ReviewedBuildResponse ¶
type ReviewedBuildResponse struct {
Data *ReviewedBuild `json:"data"`
}
ReviewedBuildResponse describes a response with a single reviewed build.
type RevisionInfo ¶
RevisionInfo contains the number of strings and words in a file revision.
type RolePermissions ¶ added in v0.3.0
type RolePermissions struct {
// Access to all languages and workflow steps.
// Default: true - means that user will have access to all
// languages and workflow steps.
AllLanguages *bool `json:"allLanguages,omitempty"`
// Access to specific languages.
// Needed if `allLanguages` is set to false.
LanguagesAccess LanguagesAccess `json:"languagesAccess,omitempty"`
}
RolePermissions represents permissions of a role.
type SavingActivitySchema ¶ added in v0.18.0
type SavingActivitySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report mode. Enum: currency, relative.
Mode string `json:"mode,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
}
SavingActivitySchema defines the schema for the saving activity report.
func (*SavingActivitySchema) ValidateSchema ¶ added in v0.18.0
func (r *SavingActivitySchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the SavingActivity schema is valid.
type Screenshot ¶ added in v0.2.0
type Screenshot struct {
ID int `json:"id"`
UserID int `json:"userId"`
WebURL string `json:"webUrl"`
Name string `json:"name"`
Size struct {
Width int `json:"width"`
Height int `json:"height"`
} `json:"size"`
TagsCount int `json:"tagsCount"`
Tags []*Tag `json:"tags"`
LabelIDs []int `json:"labelIds"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Screenshot represents a screenshot, which provides translators with additional context for the source strings.
type ScreenshotAddRequest ¶ added in v0.2.0
type ScreenshotAddRequest struct {
// Storage Identifier. Storage file must be image in one of the
// following formats: jpeg, jpg, png, gif
StorageID int `json:"storageId"`
// Screenshot name.
Name string `json:"name"`
// Automatically tags screenshot.
AutoTag *bool `json:"autoTag,omitempty"`
// File Identifier.
// Note: Must be used together with `autoTag`. Can't be used
// with `directoryId` or `branchId` in same request.
FileID int `json:"fileId,omitempty"`
// Branch identifier.
// Note: Must be used together with `autoTag`. Can't be used
// with `fileId` or `directoryId` in the same request.
BranchID int `json:"branchId,omitempty"`
// Directory Identifier.
// Note: Must be used together with `autoTag`. Can't be used
// with `fileId` or `branchId` in same request.
DirectoryID int `json:"directoryId,omitempty"`
// Label Identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
}
ScreenshotAddRequest defines the structure of a request to add a screenshot.
func (*ScreenshotAddRequest) Validate ¶ added in v0.2.0
func (r *ScreenshotAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type ScreenshotListOptions ¶ added in v0.2.0
type ScreenshotListOptions struct {
// Search screenshots by name, tagged strings or file names that
// include screenshots.
Search string `json:"search,omitempty"`
// Sort screenshots by specified field.
// Enum: id, name, tagsCount, createdAt, updatedAt. Default: id.
// Example: orderBy=createdAt desc,name,tagsCount
OrderBy string `json:"orderBy,omitempty"`
// String Identifier.
StringID int `json:"stringId,omitempty"` // Deprecated. Use StringIDs instead.
// String Identifiers.
// Example: stringIds=1,2,3,4,5
// Note: Cannot be used with stringId in the same request.
StringIDs []string `json:"stringIds,omitempty"`
// Label Identifiers.
// Example: labelIds=1,2,3
LabelIDs []string `json:"labelIds,omitempty"`
// Label Identifiers to exclude.
// Example: excludeLabelIds=1,2,3
ExcludeLabelIDs []string `json:"excludeLabelIds,omitempty"`
ListOptions
}
ScreenshotListOptions specifies the optional parameters to the ScreenshotsService.ListScreenshots method.
func (*ScreenshotListOptions) Validate ¶ added in v0.8.0
func (o *ScreenshotListOptions) Validate() error
type ScreenshotListResponse ¶ added in v0.2.0
type ScreenshotListResponse struct {
Data []*ScreenshotResponse `json:"data"`
}
ScreenshotListResponse defines the structure of a response to list screenshots.
type ScreenshotResponse ¶ added in v0.2.0
type ScreenshotResponse struct {
Data *Screenshot `json:"data"`
}
ScreenshotResponse defines the structure of a response to get a screenshot.
type ScreenshotUpdateRequest ¶ added in v0.2.0
type ScreenshotUpdateRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// Screenshot name.
Name string `json:"name"`
// Use previous tags. Default: true.
UsePreviousTags *bool `json:"usePreviousTags,omitempty"`
}
ScreenshotUpdateRequest defines the structure of a request to update a screenshot.
func (*ScreenshotUpdateRequest) Validate ¶ added in v0.2.0
func (r *ScreenshotUpdateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type SearchTranslation ¶ added in v0.19.0
type SearchTranslation struct {
Translation
// Project Identifier.
ProjectID int `json:"projectId"`
// Source String Identifier.
StringID int `json:"stringId"`
// Target Language Identifier.
LanguageID string `json:"languageId"`
}
SearchTranslation represents a translation found by the search.
type SearchTranslationResponse ¶ added in v0.19.0
type SearchTranslationResponse struct {
Data *SearchTranslation `json:"data"`
}
SearchTranslationResponse defines the structure of the response when getting a single found translation.
type SearchTranslationsListOptions ¶ added in v0.19.0
type SearchTranslationsListOptions struct {
// Search translations by text. Required.
Filter string `json:"filter"`
// Project identifiers to search across (max 50).
// Omit to search all accessible projects.
ProjectIDs []int `json:"projectIds,omitempty"`
// Owner (user) whose projects to search when `projectIds` is omitted.
// Note: Available only for Crowdin.
UserID int `json:"userId,omitempty"`
// Filter by target language identifiers.
LanguageIDs []string `json:"languageIds,omitempty"`
// Enable denormalize placeholders.
// Enum: 0, 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
ListOptions
}
SearchTranslationsListOptions specifies the parameters to the StringTranslationsService.SearchTranslations method.
func (*SearchTranslationsListOptions) Validate ¶ added in v0.19.0
func (o *SearchTranslationsListOptions) Validate() error
Validate checks if the SearchTranslationsListOptions are valid.
type SearchTranslationsListResponse ¶ added in v0.19.0
type SearchTranslationsListResponse struct {
Data []*SearchTranslationResponse `json:"data"`
}
SearchTranslationsListResponse defines the structure of the response when searching translations.
type SecurityLog ¶ added in v0.4.0
type SecurityLog struct {
ID int `json:"id"`
Event string `json:"event"`
Info string `json:"info"`
UserID int `json:"userId"`
Location string `json:"location"`
IPAddress string `json:"ipAddress"`
DeviceName string `json:"deviceName"`
CreatedAt string `json:"createdAt"`
}
SecurityLog represents a security log.
type SecurityLogResponse ¶ added in v0.4.0
type SecurityLogResponse struct {
Data *SecurityLog `json:"data"`
}
SecurityLogResponse defines the structure of a response when getting a security log.
type SecurityLogsListOptions ¶ added in v0.4.0
type SecurityLogsListOptions struct {
// Event is the type of event to filter by.
Event LogEvent `json:"event,omitempty"`
// Date in UTC, ISO 8601. Example: createdAfter=2024-01-10T10:41:33+00:00.
CreatedAfter string `json:"createdAfter,omitempty"`
// Date in UTC, ISO 8601. Example: createdBefore=2024-01-26T10:33:43+00:00.
CreatedBefore string `json:"createdBefore,omitempty"`
// IPAddress is the IP address to filter by.
IPAddress string `json:"ipAddress,omitempty"`
// Filter by user ID.
// Used for the organization logs.
UserID int `json:"userId,omitempty"`
ListOptions
}
SecurityLogsListOptions specifies the optional parameters to the SecurityLogsService.ListUserLogs and SecurityLogsService.ListOrganizationLogs methods.
type SecurityLogsListResponse ¶ added in v0.4.0
type SecurityLogsListResponse struct {
Data []*SecurityLogResponse `json:"data"`
}
SecurityLogsListResponse defines the structure of a response when getting a list of security logs.
type ShortUser ¶ added in v0.3.0
type ShortUser struct {
ID int `json:"id"`
Username string `json:"username"`
FullName string `json:"fullName"`
AvatarURL string `json:"avatarUrl"`
}
ShortUser is a simplified version of the User model. It is used in the responses where only a few fields are required.
type SourceContentUpdatesSchema ¶ added in v0.18.0
type SourceContentUpdatesSchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
SourceContentUpdatesSchema defines the schema for the source content updates report.
func (*SourceContentUpdatesSchema) ValidateSchema ¶ added in v0.18.0
func (r *SourceContentUpdatesSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the SourceContentUpdates schema is valid.
type SourceString ¶
type SourceString struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
BranchID *int `json:"branchId,omitempty"`
Identifier string `json:"identifier"`
// Text of a regular string. It is empty for plural strings, see PluralText.
Text string `json:"text"`
// PluralText holds the plural forms of a plural string
// (for example, {"one": "...", "other": "..."}). It is nil for regular strings.
PluralText map[string]string `json:"-"`
Type string `json:"type"`
Context string `json:"context"`
MaxLength int `json:"maxLength"`
IsHidden bool `json:"isHidden"`
IsDuplicate bool `json:"isDuplicate"`
MasterStringID *int `json:"masterStringId,omitempty"`
LabelIDs []int `json:"labelIds"`
WebURL string `json:"webUrl"`
CreatedAt *string `json:"createdAt,omitempty"`
UpdatedAt *string `json:"updatedAt,omitempty"`
Fields any `json:"fields,omitempty"`
FileID *int `json:"fileId,omitempty"`
DirectoryID *int `json:"directoryId,omitempty"`
Revision *int `json:"revision,omitempty"`
}
SourceString represents the text units for translation.
func (*SourceString) UnmarshalJSON ¶ added in v0.19.0
func (s *SourceString) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a source string. The `text` field is a string for regular strings and an object of plural forms for plural strings; the former is stored in Text and the latter in PluralText.
type SourceStringsAddRequest ¶
type SourceStringsAddRequest struct {
// Text for translation.
// It can be a string or map of strings.
// Example:
// "text": "Not all videos are shown to users. See more"
// or
// "text": {
// "one": "string",
// "other": "strings"
// }
Text any `json:"text"`
// File identifier.
FileID int `json:"fileId,omitempty"`
// Branch identifier.
BranchID int `json:"branchId,omitempty"`
// Defines unique string identifier.
Identifier string `json:"identifier,omitempty"`
// Use to provide additional information for better source text understanding.
Context string `json:"context,omitempty"`
// Defines whether to make string unavailable for translation. Default: false.
IsHidden *bool `json:"isHidden,omitempty"`
// Max. length of translated text (0 – unlimited).
MaxLength *int `json:"maxLength,omitempty"`
// Label Identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Fields (enterprises only).
Fields map[string]any `json:"fields,omitempty"`
}
SourcseStringsAddRequest defines the structure of a request to add a string.
func (*SourceStringsAddRequest) Validate ¶
func (r *SourceStringsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type SourceStringsEditOptions ¶ added in v0.19.0
type SourceStringsEditOptions struct {
// Defines whether to keep existing translations and approvals for
// updated strings. Applied only when `text` or `identifier` is changed.
// Enum: keep_translations_and_approvals, keep_translations,
// clear_translations_and_approvals. Default: keep_translations_and_approvals.
UpdateOption string `json:"updateOption,omitempty"`
}
SourceStringsEditOptions specifies the optional parameters to the SourceStringsService.EditWithOptions and SourceStringsService.BatchOperationsWithOptions methods.
type SourceStringsGetOptions ¶
type SourceStringsGetOptions struct {
// Enable denormalize placeholders. Enum: 0 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
}
SourceStringsGetOptions specifies the optional parameters to the SourceStringsService.Get method.
type SourceStringsGetResponse ¶
type SourceStringsGetResponse struct {
Data *SourceString `json:"data"`
}
SourceStringsGetResponse describes the response when getting a source string.
type SourceStringsImportOptions ¶
type SourceStringsImportOptions struct {
// Defines whether the file includes a first-row header that should
// not be imported. Default: false.
FirstLineContainsHeader *bool `json:"firstLineContainsHeader,omitempty"`
// Defines whether to import translations from the file. Default: false.
ImportTranslations *bool `json:"importTranslations,omitempty"`
// Defines data columns mapping. The key is the column name and the value
// is the column index. The column numbering starts at 0.
Scheme map[string]int `json:"scheme,omitempty"`
// Determines whether to import the key as source string if it does not exist.
// Default: true.
// Note: String Catalog files only.
ImportKeyAsSource *bool `json:"importKeyAsSource,omitempty"`
// Defines whether to split long texts into smaller text segments.
// Note: Only for android, arb, macosx, json, xliff and xliff_two files.
ContentSegmentation *bool `json:"contentSegmentation,omitempty"`
// Storage identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
}
SourceStringsImportOptions defines the options for importing strings.
type SourceStringsListOptions ¶
type SourceStringsListOptions struct {
// Sort strings by the specified field.
// Example: orderBy=createdAt desc,identifier.
OrderBy string `json:"orderBy,omitempty"`
// Enable denormalize placeholders. Enum: 0 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
// Filter strings by labelIds (Label Identifiers).
// Example: labelIds=1,2,3,4,5.
LabelIDs []int `json:"labelIds,omitempty"`
// File Identifier.
// Note: Can't be used with `directoryId` or `branchId` in same request.
FileID int `json:"fileId,omitempty"`
// Branch Identifier.
// Note: Can't be used with `fileId` or `directoryId` in the same request.
BranchID int `json:"branchId,omitempty"`
// Directory Identifier.
// Note: Can't be used with `fileId` or `branchId` in same request.
DirectoryID int `json:"directoryId,omitempty"`
// Task Identifier.
// Note: Can't be used with `fileId`, `directoryId` or `branchId` in same request.
TaskID int `json:"taskId,omitempty"`
// Filter strings by CroQL.
// Note: Can be used only with `denormalizePlaceholders`, `offset` and
// `limit` in same request.
CroQL string `json:"croql,omitempty"`
// Filter strings by `identifier`, `text` or `context`.
Filter string `json:"filter,omitempty"`
// Specify field to be the target of filtering. It can be one scope or
// a list of comma-separated scopes. Enum: identifier, text, context.
Scope string `json:"scope,omitempty"`
ListOptions
}
SourceStringsListOptions specifies the optional parameters to the SourceStringsService.List method.
type SourceStringsListResponse ¶
type SourceStringsListResponse struct {
Data []*SourceStringsGetResponse `json:"data"`
}
SourceStringsListResponse describes the response when getting a list of source strings.
type SourceStringsSearchOptions ¶ added in v0.19.0
type SourceStringsSearchOptions struct {
// Search strings by the fields selected in `scope` (required).
Filter string `json:"filter"`
// Project identifiers to search across (max 50).
// Omit to search all accessible projects.
// Note: On crowdin.com all projects must belong to the same owner.
ProjectIDs []int `json:"projectIds,omitempty"`
// Owner (user) whose projects to search when `projectIds` is omitted.
// Defaults to your own account.
// Note: Available for crowdin.com only.
UserID int `json:"userId,omitempty"`
// Specify field to be the target of filtering.
// Enum: all, text, context, key. Default: all.
Scope string `json:"scope,omitempty"`
// Enable denormalize placeholders. Enum: 0 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
ListOptions
}
SourceStringsSearchOptions specifies the parameters to the SourceStringsService.Search method.
func (*SourceStringsSearchOptions) Validate ¶ added in v0.19.0
func (o *SourceStringsSearchOptions) Validate() error
Validate checks if the search options are valid.
type SourceStringsUpload ¶
type SourceStringsUpload struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
BranchID int `json:"branchId"`
StorageID int `json:"storageId"`
FileType string `json:"fileType"`
ParserVersion int `json:"parserVersion"`
LabelIDs []int `json:"labelIds"`
ImportOptions struct {
FirstLineContainsHeader bool `json:"firstLineContainsHeader"`
ImportTranslations bool `json:"importTranslations"`
Scheme map[string]int `json:"scheme"`
} `json:"importOptions"`
UpdateStrings bool `json:"updateStrings"`
CleanupMode bool `json:"cleanupMode"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
SourceStringsService represents the upload strings status.
type SourceStringsUploadRequest ¶
type SourceStringsUploadRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// Branch Identifier.
// Defines branch to which file will be added.
BranchID int `json:"branchId"`
// Default: auto
// Enum: auto, android, macosx, arb, csv, json, xlsx, xliff, xliff_two
// - empty value or `auto` — Try to detect file type by extension or MIME type
// - `android` — Android (*.xml)
// - `macosx` — Mac OS X / iOS (*.strings)
// - `arb` — Application Resource Bundle (*.arb)
// - `csv` — Comma Separated Values (*.csv)
// - `json` — Generic JSON (*.json)
// - `xliff` — XLIFF (*.xliff, *.xlf)
// - `xliff_two` — XLIFF 2.0 (*.xliff, *.xlf)
// - `xlsx` — Microsoft Excel (*.xlsx)
Type string `json:"type,omitempty"`
// Using latest parser version by default.
// Note: Must be used together with `type`.
ParserVersion int `json:"parserVersion,omitempty"`
// Attach labels to strings.
LabelIDs []int `json:"labelIds,omitempty"`
// Update strings that have the same keys. Default: false.
UpdateStrings *bool `json:"updateStrings,omitempty"`
// If true, all strings with a system label that do not exist in the file
// will be deleted. Default: false.
CleanupMode *bool `json:"cleanupMode,omitempty"`
// Options for importing strings.
ImportOptions *SourceStringsImportOptions `json:"importOptions,omitempty"`
// Option for updating strings. Default: "clear_translations_and_approvals".
// Enum: "clear_translations_and_approvals" "keep_translations" "keep_translations_and_approvals"
// Must be used together with updateStrings = true
UpdateOption string `json:"updateOption,omitempty"`
}
SourceStringsUploadRequest defines the structure of a request to upload strings.
func (*SourceStringsUploadRequest) Validate ¶
func (o *SourceStringsUploadRequest) Validate() error
Validate checks if the upload request is valid. It implements the crowdin.RequestValidator interface.
type SourceStringsUploadResponse ¶
type SourceStringsUploadResponse struct {
Data *SourceStringsUpload `json:"data"`
}
SourceStringsUploadResponse defines the response when uploading strings.
type SpreadsheetFileImportOptions ¶
type SpreadsheetFileImportOptions struct {
// Defines whether the file includes a first-row header that should not be imported.
// Default: false.
FirstLineContainsHeader *bool `json:"firstLineContainsHeader,omitempty"`
// Defines whether hidden sheets that should be imported. Default: true.
ImportHiddenSheets *bool `json:"importHiddenSheets,omitempty"`
// Defines whether hidden rows that should be imported. Default: true.
ImportHiddenRows *bool `json:"importHiddenRows,omitempty"`
// Defines whether to import translations identical to sources. Default: false.
ImportEqSuggestions *bool `json:"importEqSuggestions,omitempty"`
// Defines whether to auto-approve imported translations. Default: false.
AutoApproveImported *bool `json:"autoApproveImported,omitempty"`
// Defines whether to import translations for hidden strings. Default: false.
TranslateHidden *bool `json:"translateHidden,omitempty"`
// Defines whether to add imported translations to TM. Default: true.
AddToTM *bool `json:"addToTm,omitempty"`
// Defines whether to import translations from the file. Default: false.
ImportTranslations *bool `json:"importTranslations,omitempty"`
// Defines data columns mapping. The column numbering starts at 0.
// Acceptable values are: none, identifier, sourcePhrase, sourceOrTranslation,
// translation, context, maxLength, labels and specified languages (ex. "en", "uk").
Scheme map[string]int `json:"scheme,omitempty"`
// Important: ContentSegmentation option disables the possibility to upload existing translations
// for Spreadsheet files when enabled.
CommonFileImportOptions
}
SpreadsheetsFileImportOptions implements the FileImportOptions interface.
type StorageGetResponse ¶
type StorageGetResponse struct {
Data *Storage `json:"data"`
}
StorageGetResponse defines the structure of a response when retrieving a storage.
type StorageListResponse ¶
type StorageListResponse struct {
Data []*StorageGetResponse `json:"data"`
Pagination *Pagination `json:"pagination"`
}
StorageListResponse defines the structure of a response when getting a list of storages.
type StringCatalogFileFormatSettings ¶ added in v0.2.0
type StringCatalogFileFormatSettings struct {
// Determines whether to import the key as source string if it does not exist.
// Default: true.
ImportKeyAsSource *bool `json:"importKeyAsSource,omitempty"`
// Determines whether to import existing translations from the file. Default: false.
ImportTranslations *bool `json:"importTranslations,omitempty"`
// File format export pattern. Defines file name and path in resulting translations bundle.
// Default: null. Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
}
func (*StringCatalogFileFormatSettings) ValidateSettings ¶ added in v0.2.0
func (p *StringCatalogFileFormatSettings) ValidateSettings() error
type StringCatalogFileImportOptions ¶
type StringCatalogFileImportOptions struct {
// Determines whether to import the key as source string if it does not exist.
// Default: true.
ImportKeyAsSource *bool `json:"importKeyAsSource,omitempty"`
// Defines whether to import translations from the file. Default: false.
ImportTranslations *bool `json:"importTranslations,omitempty"`
}
StringCatalogFileImportOptions implements the FileImportOptions interface.
func (*StringCatalogFileImportOptions) ValidateFileImportOptions ¶
func (o *StringCatalogFileImportOptions) ValidateFileImportOptions() error
type StringComment ¶ added in v0.2.0
type StringComment struct {
ID int `json:"id"`
Text string `json:"text"`
UserID int `json:"userId"`
StringID int `json:"stringId"`
User *ShortUser `json:"user"`
String *String `json:"string"`
ProjectID int `json:"projectId"`
LanguageID string `json:"languageId"`
Type string `json:"type"`
IssueType string `json:"issueType"`
IssueStatus string `json:"issueStatus"`
ResolverID int `json:"resolverId"`
Resolver *ShortUser `json:"resolver"`
ResolvedAt string `json:"resolvedAt"`
CreatedAt string `json:"createdAt"`
SenderOrganization *Organization `json:"senderOrganization,omitempty"`
ResolverOrganization *Organization `json:"resolverOrganization,omitempty"`
// List of attachments added to the comment.
Attachments []*StringCommentAttachment `json:"attachments,omitempty"`
// File identifier. It is set for asset comments only.
FileID *int `json:"fileId,omitempty"`
// File object. It is set for asset comments only.
File *StringCommentFile `json:"file,omitempty"`
}
StringComment represents a Crowdin string comment.
type StringCommentAttachment ¶ added in v0.19.0
type StringCommentAttachment struct {
// Attachment ID.
ID int `json:"id"`
// Original file name.
Name string `json:"name"`
// MIME type.
Mime string `json:"mime"`
// File size in bytes.
Size int `json:"size"`
// Attachment category. Enum: image, video, audio, document, other.
Category string `json:"category"`
// Thumbnail URL.
ThumbnailURL *string `json:"thumbnailUrl,omitempty"`
// Preview URL.
URL string `json:"url"`
// Download URL.
DownloadURL string `json:"downloadUrl"`
}
StringCommentAttachment represents a file attached to a string comment.
type StringCommentAttachmentRequest ¶ added in v0.19.0
type StringCommentAttachmentRequest struct {
// Storage Identifier.
ID int `json:"id"`
}
StringCommentAttachmentRequest defines an attachment to be added to a string comment.
type StringCommentFile ¶ added in v0.19.0
type StringCommentFile struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Context string `json:"context"`
}
StringCommentFile represents the asset file of an asset comment.
type StringCommentsAddRequest ¶ added in v0.2.0
type StringCommentsAddRequest struct {
// Text of the comment.
Text string `json:"text"`
// String Identifier.
// Note: Can't be used with `fileId` in the same request.
StringID int `json:"stringId,omitempty"`
// File Identifier. Use it to add a comment to an asset file.
// Note: Can't be used with `stringId` in the same request.
FileID int `json:"fileId,omitempty"`
// Target Language Identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Defines comment or issue.
// Enum: comment, issue.
Type string `json:"type"`
// Defines issue type.
// Enum: general_question, translation_mistake, context_request, source_mistake.
// Default: general_question.
IssueType string `json:"issueType,omitempty"`
IsShared *bool `json:"isShared,omitempty"`
// List of attachments to be added to the comment.
Attachments []*StringCommentAttachmentRequest `json:"attachments,omitempty"`
}
StringCommentsAddRequest defines the structure of the request to add a new string comment.
func (*StringCommentsAddRequest) Validate ¶ added in v0.2.0
func (r *StringCommentsAddRequest) Validate() error
Validate checks if the StringCommentsAddRequest is valid. It implements the crowdin.RequestValidator interface.
type StringCommentsListOptions ¶ added in v0.2.0
type StringCommentsListOptions struct {
// Sort results by specified field.
// Enum: id, text, type, createdAt, resolvedAt, issueStatus, issueType.
// Example: orderBy=createdAt desc,text
OrderBy string `json:"orderBy,omitempty"`
// String Identifier.
StringID int `json:"stringId,omitempty"`
// Defines string comment type.
// Enum: comment, issue.
// Note: `type=comment` can't be used with `issueType` or `issueStatus`
// in same request.
Type string `json:"type,omitempty"`
// Defines issue type. It can be one issue type or multiple issue types.
// Enum: general_question, translation_mistake, context_request, source_mistake.
// Example: issueType=general_question,translation_mistake
IssueType []string `json:"issueType,omitempty"`
// Defines issue resolution status.
// Enum: resolved, unresolved.
IssueStatus string `json:"issueStatus,omitempty"`
ListOptions
}
StringCommentsListOptions specifies the optional parameters to the StringCommentsService.List method.
type StringCommentsListResponse ¶ added in v0.2.0
type StringCommentsListResponse struct {
Data []*StringCommentsResponse `json:"data"`
}
StringCommentsListResponse defines the structure of the response when getting a list of string comments.
type StringCommentsResponse ¶ added in v0.2.0
type StringCommentsResponse struct {
Data *StringComment `json:"data"`
}
StringCommentsResponse defines the structure of of the response when getting a single string comment.
type StringCorrection ¶ added in v0.19.0
type StringCorrection struct {
ID int `json:"id"`
Text string `json:"text"`
PluralCategoryName string `json:"pluralCategoryName"`
User *ShortUser `json:"user"`
CreatedAt string `json:"createdAt"`
}
StringCorrection represents a correction of a source string.
type StringCorrectionAddRequest ¶ added in v0.19.0
type StringCorrectionAddRequest struct {
// String Identifier.
StringID int `json:"stringId"`
// Correction text.
Text string `json:"text"`
// Plural form. Enum: zero, one, two, few, many, other.
// Note: This field becomes required for strings with plural forms.
PluralCategoryName string `json:"pluralCategoryName,omitempty"`
}
StringCorrectionAddRequest defines the structure of a request to add a string correction.
func (*StringCorrectionAddRequest) Validate ¶ added in v0.19.0
func (r *StringCorrectionAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type StringCorrectionResponse ¶ added in v0.19.0
type StringCorrectionResponse struct {
Data *StringCorrection `json:"data"`
}
StringCorrectionResponse defines the structure of a response when getting a string correction.
type StringCorrectionsListOptions ¶ added in v0.19.0
type StringCorrectionsListOptions struct {
// String Identifier. Required.
StringID int `json:"stringId"`
// Sort corrections by the specified field.
// Example: orderBy=createdAt desc,text.
OrderBy string `json:"orderBy,omitempty"`
// Enable denormalize placeholders.
// Enum: 0, 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
ListOptions
}
StringCorrectionsListOptions specifies the parameters to the StringCorrectionsService.List method.
type StringCorrectionsListResponse ¶ added in v0.19.0
type StringCorrectionsListResponse struct {
Data []*StringCorrectionResponse `json:"data"`
}
StringCorrectionsListResponse defines the structure of a response when getting a list of string corrections.
type StringTranslationsListOptions ¶
type StringTranslationsListOptions struct {
// Sort a list of translations.
// Enum: id, text, rating, createdAt. Default: id.
// Example: orderBy=createdAt desc,name,priority
OrderBy string `json:"orderBy,omitempty"`
// String Identifier.
// Note: Must be used together with `languageId`.
StringID int `json:"stringId,omitempty"`
// Language Identifier.
// Note: Must be used together with `stringId`.
LanguageID string `json:"languageId,omitempty"`
// Denormalize Placeholders.
// Enum: 0, 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
ListOptions
}
StringTranslationsListOptions specifies the optional parameters to the StringTranslationsService.ListTranslations method.
type StringsExporterSettings ¶ added in v0.2.0
type StringsExporterSettings struct {
// Convert placeholders to MacOSX format. Default: false.
// Note: Only for Android and MacOSX formats.
ConvertPlaceholders *bool `json:"convertPlaceholders,omitempty"`
// Convert line breaks. Default: false.
// Note: Only for Android and MacOSX formats.
ConvertLineBreaks *bool `json:"convertLineBreaks,omitempty"`
// Use CDATA for strings with tags. Default: false.
// Note: Only for Android format.
UseCdataForStringsWithTags *bool `json:"useCdataForStringsWithTags,omitempty"`
// Export context. Default: true.
// Note: Only for MacOSX format.
ExportContext *bool `json:"exportContext,omitempty"`
// Defines language pair mapping the target language for the specified source language.
// Note: Only for XLIFF format.
LanguagePairMapping map[string]string `json:"languagePairMapping,omitempty"`
// Copy source to empty target. Default: true.
// Note: Only for XLIFF format.
CopySourceToEmptyTarget *bool `json:"copySourceToEmptyTarget,omitempty"`
// Export translators comment. Default: true.
// Note: Only for XLIFF format.
ExportTranslatorsComment *bool `json:"exportTranslatorsComment,omitempty"`
}
StringsExporterSettings defines the structure of a strings exporter settings.
type StyleGuide ¶ added in v0.19.0
type StyleGuide struct {
ID int `json:"id"`
Name string `json:"name"`
AIInstructions *string `json:"aiInstructions"`
UserID int `json:"userId"`
GroupID int `json:"groupId,omitempty"` // Enterprise only.
LanguageIDs []string `json:"languageIds"`
ProjectIDs []int `json:"projectIds"`
WebURL string `json:"webUrl"`
DownloadLink string `json:"downloadLink"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
StyleGuide represents a Crowdin style guide.
type StyleGuideCreateRequest ¶ added in v0.19.0
type StyleGuideCreateRequest struct {
// Style guide name.
Name string `json:"name"`
// Storage identifier of the style guide file.
// The field is always sent: a nil value is transmitted as `null`.
StorageID *int `json:"storageId"`
// Group Identifier - defines group to which the style guide is added.
// If omitted, root group is used.
// Note: Enterprise only.
GroupID *int `json:"groupId,omitempty"`
// Rules to be used by AI models.
// Note: maxLength (10240) counts bytes, not characters.
AIInstructions string `json:"aiInstructions,omitempty"`
// Style guide language identifiers.
LanguageIDs []string `json:"languageIds,omitempty"`
// Project identifiers to assign the style guide to.
ProjectIDs []int `json:"projectIds,omitempty"`
// within the account (Crowdin) or the group (Enterprise).
IsShared *bool `json:"isShared,omitempty"`
}
StyleGuideCreateRequest defines the structure of a request to create a style guide.
func (*StyleGuideCreateRequest) Validate ¶ added in v0.19.0
func (r *StyleGuideCreateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type StyleGuideResponse ¶ added in v0.19.0
type StyleGuideResponse struct {
Data *StyleGuide `json:"data"`
}
StyleGuideResponse defines the structure of a response when getting a style guide.
type StyleGuidesListOptions ¶ added in v0.19.0
type StyleGuidesListOptions struct {
// Sort style guides by the specified field.
// Example: orderBy=createdAt desc,name.
OrderBy string `json:"orderBy,omitempty"`
// List style guides of a specific user.
UserID int `json:"userId,omitempty"`
ListOptions
}
StyleGuidesListOptions specifies the optional parameters to the StyleGuidesService.List method.
type StyleGuidesListResponse ¶ added in v0.19.0
type StyleGuidesListResponse struct {
Data []*StyleGuideResponse `json:"data"`
}
StyleGuidesListResponse defines the structure of a response when getting a list of style guides.
type SupportedModel ¶ added in v0.19.0
type SupportedModel struct {
// ID of the configured AI provider.
ProviderID *int `json:"providerId,omitempty"`
// Type of the AI provider (e.g., open_ai).
ProviderType string `json:"providerType"`
// Human-readable name of the AI provider.
ProviderName string `json:"providerName"`
// Model identifier.
ID string `json:"id"`
// Human-readable model name.
DisplayName string `json:"displayName"`
// Indicates if the model supports reasoning (thinking).
SupportReasoning bool `json:"supportReasoning"`
// Intelligence level.
Intelligence int `json:"intelligence"`
// Speed level.
Speed int `json:"speed"`
// Pricing per 1M tokens.
Price *SupportedModelPrice `json:"price,omitempty"`
// Supported input/output modalities.
Modalities *SupportedModelModalities `json:"modalities,omitempty"`
// Context window size.
ContextWindow int `json:"contextWindow"`
// Maximum output tokens.
MaxOutputTokens int `json:"maxOutputTokens"`
// Knowledge cutoff date.
KnowledgeCutoff *string `json:"knowledgeCutoff,omitempty"`
// Release date.
ReleaseDate *string `json:"releaseDate,omitempty"`
// Supported features.
Features *SupportedModelFeatures `json:"features,omitempty"`
}
SupportedModel represents a supported AI provider model.
type SupportedModelFeatures ¶ added in v0.19.0
type SupportedModelFeatures struct {
Streaming bool `json:"streaming"`
StructuredOutput bool `json:"structuredOutput"`
FunctionCalling bool `json:"functionCalling"`
}
SupportedModelFeatures represents the features of a supported model.
type SupportedModelModalities ¶ added in v0.19.0
type SupportedModelModalities struct {
Input *SupportedModelModality `json:"input,omitempty"`
Output *SupportedModelModality `json:"output,omitempty"`
}
SupportedModelModalities represents the input/output modalities of a supported model.
type SupportedModelModality ¶ added in v0.19.0
type SupportedModelModality struct {
Text bool `json:"text"`
Image bool `json:"image"`
Audio bool `json:"audio"`
}
SupportedModelModality represents a set of supported modalities.
type SupportedModelPrice ¶ added in v0.19.0
SupportedModelPrice represents the pricing of a supported model per 1M tokens.
type SupportedModelResponse ¶ added in v0.19.0
type SupportedModelResponse struct {
Data *SupportedModel `json:"data"`
}
SupportedModelResponse defines the structure of a response when getting a supported AI provider model.
type SupportedModelsListOptions ¶ added in v0.19.0
type SupportedModelsListOptions struct {
// Filter by provider type.
ProviderType ProviderType `json:"providerType,omitempty"`
// Filter by enabled providers.
Enabled *bool `json:"enabled,omitempty"`
// Sort the collection by the specified field. Example: orderBy=id desc.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
SupportedModelsListOptions specifies the optional parameters to the AIService.ListSupportedProviderModels method.
type SupportedModelsListResponse ¶ added in v0.19.0
type SupportedModelsListResponse struct {
Data []*SupportedModelResponse `json:"data"`
}
SupportedModelsListResponse defines the structure of a response when getting a list of supported AI provider models.
type TMConcordanceSearch ¶ added in v0.3.0
type TMConcordanceSearch struct {
TM struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"tm"`
RecordID int `json:"recordId"`
Source string `json:"source"`
Target string `json:"target"`
Relevant int `json:"relevant"`
Substituted string `json:"substituted"`
UpdatedAt string `json:"updatedAt"`
}
TMConcordanceSearch represents a Translation Memory concordance search result.
type TMConcordanceSearchAllRequest ¶ added in v0.19.0
type TMConcordanceSearchAllRequest struct {
TMConcordanceSearchRequest
// Owner (user) whose translation memories to search. Only translation memories
// you own or manage are searched. Defaults to your own account.
// Note: Crowdin only.
UserID int `json:"userId,omitempty"`
}
TMConcordanceSearchAllRequest defines the structure of the request when searching for concordance in all Translation Memories available to the user.
func (*TMConcordanceSearchAllRequest) Validate ¶ added in v0.19.0
func (r *TMConcordanceSearchAllRequest) Validate() error
Validate checks if the TMConcordanceSearchAllRequest is valid. It implements the crowdin.Validator interface.
type TMConcordanceSearchRequest ¶ added in v0.3.0
type TMConcordanceSearchRequest struct {
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageID string `json:"targetLanguageId"`
AutoSubstitution *bool `json:"autoSubstitution"`
MinRelevant int `json:"minRelevant"`
Expressions []string `json:"expressions"`
}
TMConcordanceSearchRequest defines the structure of the request when searching for concordance in a Translation Memory.
func (*TMConcordanceSearchRequest) Validate ¶ added in v0.3.0
func (r *TMConcordanceSearchRequest) Validate() error
Validate checks if the TMConcordanceSearchRequest is valid. It implements the crowdin.Validator interface.
type TMConcordanceSearchResponse ¶ added in v0.3.0
type TMConcordanceSearchResponse struct {
Data []struct {
Data *TMConcordanceSearch `json:"data"`
} `json:"data"`
}
TMConcordanceSearchResponse defines the structure of the response when searching for concordance in a Translation Memory.
type TMExportFormat ¶ added in v0.3.0
type TMExportFormat string
TMExportFormat defines the format of the Translation Memory export.
const ( TMExportFormatTMX TMExportFormat = "tmx" TMExportFormatCSV TMExportFormat = "csv" TMExportFormatXLSX TMExportFormat = "xlsx" )
Supported Translation Memory export formats.
type TMSegment ¶ added in v0.3.0
type TMSegment struct {
// Segment Identifier.
ID int `json:"id"`
// Segment records.
Records []*TMSegmentRecord `json:"records"`
}
TMSegment represents a Crowdin Translation Memory segment.
type TMSegmentCreateRecord ¶ added in v0.3.0
type TMSegmentCreateRecord struct {
// Language Identifier.
LanguageID string `json:"languageId"`
// Record text.
Text string `json:"text"`
}
TMSegmentCreateRecord represents a TM segment record in the TMSegmentCreateRequest.
type TMSegmentCreateRequest ¶ added in v0.3.0
type TMSegmentCreateRequest struct {
Records []*TMSegmentCreateRecord `json:"records"`
}
TMSegmentCreateRequest defines the structure of the request when creating a new Translation Memory segment.
func (*TMSegmentCreateRequest) Validate ¶ added in v0.3.0
func (r *TMSegmentCreateRequest) Validate() error
Validate checks if the TMSegmentCreateRequest is valid. It implements the crowdin.Validator interface.
type TMSegmentRecord ¶ added in v0.3.0
type TMSegmentRecord struct {
// Record Identifier.
ID int `json:"id"`
// Language Identifier.
LanguageID string `json:"languageId"`
// Record text.
Text string `json:"text"`
// Count usage of segment record.
UsageCount int `json:"usageCount"`
// Creator User Identifier.
CreatedBy int `json:"createdBy"`
// Redactor User Identifier.
UpdatedBy int `json:"updatedBy"`
// Created at time.
CreatedAt string `json:"createdAt"`
// Updated at time.
UpdatedAt string `json:"updatedAt"`
}
TMSegmentRecord represents a TM segment record in the TMSegment.
type TMSegmentResponse ¶ added in v0.3.0
type TMSegmentResponse struct {
Data *TMSegment `json:"data"`
}
TMSegmentResponse defines the structure of the response when getting a single Translation Memory segment.
type TMSegmentsListOptions ¶ added in v0.3.0
type TMSegmentsListOptions struct {
// Sort list of segments by a specific field.
// Enum: id. Default: id.
// Example: orderBy=id desc
OrderBy string `json:"orderBy,omitempty"`
// Filter segments by CroQL query.
CroQL string `json:"croql,omitempty"`
ListOptions
}
TMSegmentsListOptions specifies the optional parameters to the TranslationMemoryService.ListTMSegments method.
type TMSegmentsListResponse ¶ added in v0.3.0
type TMSegmentsListResponse struct {
Data []*TMSegmentResponse `json:"data"`
}
TMSegmentsListResponse defines the structure of the response when getting a list of Translation Memory segments.
type TXTFileFormatSettings ¶
type TXTFileFormatSettings struct {
// Storage identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
// File format export pattern. Defines file name and path in resulting
// translations bundle.
// Default: null. Note: Can't contain : * ? " < > | symbols
ExportPattern *string `json:"exportPattern,omitempty"`
}
func (*TXTFileFormatSettings) ValidateSettings ¶
func (p *TXTFileFormatSettings) ValidateSettings() error
type Tag ¶ added in v0.2.0
type Tag struct {
ID int `json:"id"`
ScreenshotID int `json:"screenshotId"`
StringID int `json:"stringId"`
Position *TagPosition `json:"position"`
CreatedAt string `json:"createdAt"`
}
Tag represents a tag on a screenshot.
type TagAddRequest ¶ added in v0.2.0
type TagAddRequest struct {
// String Identifier.
StringID int `json:"stringId"`
// Tag position.
Position *TagPosition `json:"position,omitempty"`
}
TagAddRequest defines the structure of a request to add a tag.
func (*TagAddRequest) Validate ¶ added in v0.2.0
func (r *TagAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type TagListResponse ¶ added in v0.2.0
type TagListResponse struct {
Data []*TagResponse `json:"data"`
}
TagListResponse defines the structure of a response to list tags.
type TagPosition ¶ added in v0.2.0
type TagPosition struct {
X *int `json:"x,omitempty"`
Y *int `json:"y,omitempty"`
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
}
TagPosition represents the position of a tag on a screenshot.
type TagResponse ¶ added in v0.2.0
type TagResponse struct {
Data *Tag `json:"data"`
}
TagResponse defines the structure of a response to get a tag.
type Task ¶ added in v0.3.0
type Task struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
CreatorID int `json:"creatorId"`
Type int `json:"type"`
Status TaskStatus `json:"status"`
Title string `json:"title"`
BatchID *int `json:"batchId,omitempty"`
Assignees []*TaskAssignee `json:"assignees"`
AssignedTeams []*TaskAssignedTeam `json:"assignedTeams"`
Progress TaskProgress `json:"progress"`
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageID string `json:"targetLanguageId"`
Description string `json:"description"`
TranslationURL string `json:"translationUrl"`
WebURL string `json:"webUrl"`
// Number of words currently in the task.
WordsCount int `json:"wordsCount"`
// Number of words when the task was created.
// Preserved when source strings are later removed.
OriginalWordsCount int `json:"originalWordsCount"`
CommentsCount int `json:"commentsCount"`
Deadline string `json:"deadline"`
StartedAt string `json:"startedAt"`
ResolvedAt string `json:"resolvedAt"`
TimeRange string `json:"timeRange"`
TranslationsUpdatedTimeRange string `json:"translationsUpdatedTimeRange,omitempty"`
WorkflowStepID int `json:"workflowStepId"`
BuyURL string `json:"buyUrl"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
SourceLanguage *Language `json:"sourceLanguage"`
TargetLanguages []*Language `json:"targetLanguages"`
LabelIDs []int `json:"labelIds"`
// Match rule for labels. Enum: all, any.
LabelMatchRule *string `json:"labelMatchRule,omitempty"`
ExcludeLabelIDs []int `json:"excludeLabelIds"`
// Match rule for excluded labels. Enum: all, any.
ExcludeLabelMatchRule *string `json:"excludeLabelMatchRule,omitempty"`
PrecedingTaskID int `json:"precedingTaskId"`
EstimatedCost *TaskCost `json:"estimatedCost,omitempty"`
ActualCost *TaskCost `json:"actualCost,omitempty"`
GenerateCostEstimate *bool `json:"generateCostEstimate,omitempty"`
GenerateTranslationCost *bool `json:"generateTranslationCost,omitempty"`
ReportSettingsTemplateID *int `json:"reportSettingsTemplateId,omitempty"`
FilesCount int `json:"filesCount"`
FileIDs []int `json:"fileIds,omitempty"`
Vendor string `json:"vendor,omitempty"`
BranchIDs []int `json:"branchIds,omitempty"`
IsArchived *bool `json:"isArchived,omitempty"`
Fields any `json:"fields,omitempty"`
// How a shared task's words split while it syncs to the vendor.
// It is nil when the task is fully synced, not shared, or the
// counterpart is unavailable. Crowdin Enterprise only.
SyncScope *TaskSyncScope `json:"syncScope,omitempty"`
}
Task represents a task in Crowdin.
type TaskAddRequester ¶ added in v0.6.0
type TaskAddRequester interface {
ValidateRequest() error
}
TaskAddRequester is an interface encapsulating a request for task addition. The request body must conform to one of the following struct types:
TaskCreateForm VendorTaskCreateForm PendingTaskCreateForm
The following forms are deprecated and kept for backward compatibility (use VendorTaskCreateForm or PendingTaskCreateForm instead):
LanguageServiceTaskCreateForm VendorOhtTaskCreateForm VendorGengoTaskCreateForm VendorManualTaskCreateForm LanguageServicePendingTaskCreateForm VendorManualPendingTaskCreateForm
For the Enterprise API, the request body should be one of the following structs:
EnterpriseTaskCreateForm EnterpriseVendorTaskCreateForm EnterprisePendingTaskCreateForm
type TaskAssignedTeam ¶ added in v0.3.0
type TaskAssignedTeam struct {
ID int `json:"id"`
WordsCount int `json:"wordsCount"`
TimeSpent int `json:"timeSpent,omitempty"`
}
TaskAssignedTeam represents a team assigned to a task.
type TaskAssignee ¶ added in v0.3.0
type TaskAssignee struct {
ID int `json:"id"`
Username string `json:"username"`
FullName string `json:"fullName"`
AvatarURL string `json:"avatarUrl"`
WordsCount int `json:"wordsCount"`
WordsLeft int `json:"wordsLeft"`
TimeSpent int `json:"timeSpent,omitempty"`
}
TaskAssignee represents an assignee of a task.
type TaskComment ¶ added in v0.17.0
type TaskComment struct {
ID int `json:"id"`
UserID int `json:"userId"`
TaskID int `json:"taskId"`
Text string `json:"text"`
TimeSpent int `json:"timeSpent"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
TaskComment represents a comment on a task.
type TaskCommentAddRequest ¶ added in v0.17.0
type TaskCommentAddRequest struct {
// Comment text
Text string `json:"text,omitempty"`
// Specifies the time spent on the task in seconds
TimeSpent int `json:"timeSpent,omitempty"`
}
TaskCommentAddRequest defines the structure of the request when adding a new comment to a task.
func (*TaskCommentAddRequest) Validate ¶ added in v0.17.0
func (r *TaskCommentAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type TaskCommentResponse ¶ added in v0.17.0
type TaskCommentResponse struct {
Data *TaskComment `json:"data"`
}
TaskCommentResponse defines the structure of the response when getting a task comment.
type TaskCommentsListResponse ¶ added in v0.17.0
type TaskCommentsListResponse struct {
Data []*TaskCommentResponse `json:"data"`
}
TaskCommentsListResponse defines the structure of the response when getting a list of task comments.
type TaskCost ¶ added in v0.19.0
type TaskCost struct {
Cost float64 `json:"cost"`
Date string `json:"date"`
Currency string `json:"currency"`
}
TaskCost represents the estimated or actual cost of a task.
type TaskCreateForm ¶ added in v0.3.0
type TaskCreateForm struct {
// Task title
Title string `json:"title"`
// Task language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 0 - translate, 1 - proofread.
Type *TaskType `json:"type"`
// Branch identifiers.
// One of branchIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// Task string identifiers.
// One of branchIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// Task file identifiers.
// One of branchIds, directoryIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Directory identifiers (file-based projects only).
// One of branchIds, directoryIds, stringIds or fileIds is required.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Match rule for labels. Enum: all, any.
// Note: Can only be used when `labelIds` parameter is provided.
LabelMatchRule string `json:"labelMatchRule,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Match rule for excluded labels. Enum: all, any.
// Note: Can only be used when `excludeLabelIds` parameter is provided.
ExcludeLabelMatchRule string `json:"excludeLabelMatchRule,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Split content for task.
SplitContent *bool `json:"splitContent,omitempty"`
// Skip strings already included in other tasks. Default: false.
SkipAssignedStrings *bool `json:"skipAssignedStrings,omitempty"`
// Defines whether to export only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false`,
// `type=0` or `type=2` in same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
// Task started date. Format: UTC, ISO 8601.
StartedAt string `json:"startedAt,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Start date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateFrom string `json:"translationsUpdatedDateFrom,omitempty"`
// End date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateTo string `json:"translationsUpdatedDateTo,omitempty"`
// Generate cost estimate report for the task. Requires `reportSettingsTemplateId`.
GenerateCostEstimate *bool `json:"generateCostEstimate,omitempty"`
// Generate translation cost report for the task. Requires `reportSettingsTemplateId`.
GenerateTranslationCost *bool `json:"generateTranslationCost,omitempty"`
// Report settings template identifier. Required when `generateCostEstimate`
// or `generateTranslationCost` is `true`.
ReportSettingsTemplateID int `json:"reportSettingsTemplateId,omitempty"`
// Task batch identifier. Allows grouping tasks into a batch.
BatchID int `json:"batchId,omitempty"`
}
func (*TaskCreateForm) Validate ¶ added in v0.3.0
func (r *TaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*TaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *TaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type TaskProgress ¶ added in v0.3.0
type TaskProgress struct {
Total int `json:"total"`
Done int `json:"done"`
Percent int `json:"percent"`
}
TaskProgress represents the progress of a task.
type TaskResponse ¶ added in v0.3.0
type TaskResponse struct {
Data *Task `json:"data"`
}
TaskResponse defines the structure of the response when getting a task.
type TaskSettingsTemplate ¶ added in v0.3.0
type TaskSettingsTemplate struct {
ID int `json:"id"`
Name string `json:"name"`
Config TaskSettingsTemplateConfig `json:"config"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
TaskSettingsTemplate represents a task settings template.
type TaskSettingsTemplateAddRequest ¶ added in v0.3.0
type TaskSettingsTemplateAddRequest struct {
// Template name
Name string `json:"name"`
// Defines task config
Config TaskSettingsTemplateConfig `json:"config"`
}
TaskSettingsTemplateAddRequest defines the structure of the request when adding a new task settings template.
func (*TaskSettingsTemplateAddRequest) Validate ¶ added in v0.3.0
func (r *TaskSettingsTemplateAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.Validator interface.
type TaskSettingsTemplateConfig ¶ added in v0.3.0
type TaskSettingsTemplateConfig struct {
Languages []TaskSettingsTemplateLanguage `json:"languages"`
}
TaskSettingsTemplateConfig represents the configuration of a task settings template.
type TaskSettingsTemplateLanguage ¶ added in v0.3.0
type TaskSettingsTemplateLanguage struct {
LanguageID string `json:"languageId"`
UserIDs []UserID `json:"userIds"`
TeamIDs []int `json:"teamIds,omitempty"`
}
TaskSettingsTemplateLanguage represents the language settings of a task settings template.
type TaskSettingsTemplateResponse ¶ added in v0.3.0
type TaskSettingsTemplateResponse struct {
Data *TaskSettingsTemplate `json:"data"`
}
TaskSettingsTemplateResponse defines the structure of the response when getting a task settings template.
type TaskSettingsTemplatesListResponse ¶ added in v0.3.0
type TaskSettingsTemplatesListResponse struct {
Data []*TaskSettingsTemplateResponse `json:"data"`
}
TaskSettingsTemplatesListResponse defines the structure of the response when getting a list of task settings templates.
type TaskStatus ¶ added in v0.3.0
type TaskStatus string
TaskStatus represents the status of a task.
const ( TaskStatusTodo TaskStatus = "todo" TaskStatusInProgress TaskStatus = "in_progress" TaskStatusDone TaskStatus = "done" TaskStatusClosed TaskStatus = "closed" )
type TaskSyncScope ¶ added in v0.19.0
type TaskSyncScope struct {
// Words already synced into the vendor task.
SyncedWords int `json:"syncedWords"`
// Words routed to the vendor and awaiting sync.
PendingWords int `json:"pendingWords"`
// Words the client's workflow does not share with the vendor.
SkippedWords int `json:"skippedWords"`
}
TaskSyncScope represents how a shared task's words split while it syncs to the vendor.
type TaskUsageSchema ¶ added in v0.19.0
type TaskUsageSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format"`
// Report type. Enum: workload, created-vs-resolved, performance, time, cost.
Type string `json:"type"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Grouping parameter. Enum: user, language, type.
GroupBy string `json:"groupBy,omitempty"`
// Task type. Enum: 0 - translate, 1 - proofread,
// 2 - translate by vendor, 3 - proofread by vendor.
TypeTasks *int `json:"typeTasks,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Task creator identifier.
CreatorID int `json:"creatorId,omitempty"`
// Task assignee identifier.
AssigneeID int `json:"assigneeId,omitempty"`
// Words count from (used with type `time`).
WordsCountFrom int `json:"wordsCountFrom,omitempty"`
// Words count to (used with type `time`).
WordsCountTo int `json:"wordsCountTo,omitempty"`
// Task statuses to filter by (used with type `cost`).
// Enum: todo, in_progress, done, closed, review.
Statuses []string `json:"statuses,omitempty"`
}
TaskUsageSchema defines the schema for the project task usage report (Enterprise only).
func (*TaskUsageSchema) ValidateSchema ¶ added in v0.19.0
func (r *TaskUsageSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TaskUsage schema is valid.
type TaskVendor ¶ added in v0.3.0
type TaskVendor string
TaskVendor represents the vendor of a task.
const ( TaskVendorCrowdinLanguageService TaskVendor = "crowdin_language_service" TaskVendorOht TaskVendor = "oht" TaskVendorGengo TaskVendor = "gengo" TaskVendorUndertow TaskVendor = "undertow" TaskVendorManual TaskVendor = "manual" TaskVendorAlconost TaskVendor = "alconost" TaskVendorBabbleon TaskVendor = "babbleon" TaskVendorTomedes TaskVendor = "tomedes" TaskVendorE2f TaskVendor = "e2f" TaskVendorWritePathAdmin TaskVendor = "write_path_admin" TaskVendorInlingo TaskVendor = "inlingo" TaskVendorAcclaro TaskVendor = "acclaro" TaskVendorTranslateByHumans TaskVendor = "translate_by_humans" TaskVendorLingo24 TaskVendor = "lingo24" TaskVendorAssertioLanguageServices TaskVendor = "assertio_language_services" TaskVendorGteLocalize TaskVendor = "gte_localize" TaskVendorKettuSolutions TaskVendor = "kettu_solutions" TaskVendorLanguageLineSolutions TaskVendor = "languageline_solutions" )
type TasksListOptions ¶ added in v0.3.0
type TasksListOptions struct {
// Sort a list of tasks by a specified field.
// Enum: id, type, title, status, description, createdAt,
// updatedAt, deadline, startedAt, resolvedAt. Default: id.
// Example: orderBy=createdAt desc,title
OrderBy string `json:"orderBy,omitempty"`
// List tasks with specified statuses. It can be one status
// or a list of status values.
// Enum: todo, in_progress, done, closed.
Status []TaskStatus `json:"status,omitempty"`
// List tasks for specified assignee.
AssigneeID int `json:"assigneeId,omitempty"`
// Filter by task batch.
BatchID int `json:"batchId,omitempty"`
ListOptions
}
TasksListOptions specifies the optional parameters to the TasksService.List method.
type TasksListResponse ¶ added in v0.3.0
type TasksListResponse struct {
Data []*TaskResponse `json:"data"`
}
TasksListResponse defines the structure of the response when getting a list of tasks.
type Team ¶ added in v0.4.0
type Team struct {
ID int `json:"id"`
Name string `json:"name"`
TotalMembers int `json:"totalMembers"`
WebURL string `json:"webUrl"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Team represents a team in the organization.
type TeamAddRequest ¶ added in v0.4.0
type TeamAddRequest struct {
Name string `json:"name"`
}
TeamAddRequest defines the structure of the request when adding a new team.
func (*TeamAddRequest) Validate ¶ added in v0.4.0
func (r *TeamAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type TeamMember ¶ added in v0.4.0
type TeamMember struct {
ID int `json:"id"`
Username string `json:"username"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
AvatarURL string `json:"avatarUrl"`
AddedAt string `json:"addedAt"`
}
TeamMember represents a team member in the organization.
type TeamMemberAddRequest ¶ added in v0.4.0
type TeamMemberAddRequest struct {
// Team user identifiers.
// Note: You can invite up to 50 team members at a time.
UserIDs []int `json:"userIds"`
}
TeamMemberAddRequest defines the structure of the request when adding a new team member.
func (*TeamMemberAddRequest) Validate ¶ added in v0.4.0
func (r *TeamMemberAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type TeamMemberAddResponse ¶ added in v0.4.0
type TeamMemberAddResponse struct {
Skipped []*TeamMemberResponse `json:"skipped"`
Added []*TeamMemberResponse `json:"added"`
}
TeamMemberAddResponse defines the structure of the response when adding a new team member.
type TeamMemberResponse ¶ added in v0.4.0
type TeamMemberResponse struct {
Data *TeamMember `json:"data"`
}
TeamMemberResponse defines the structure of the response when getting a team member.
type TeamMembersListResponse ¶ added in v0.4.0
type TeamMembersListResponse struct {
Data []*TeamMemberResponse `json:"data"`
}
TeamMembersListResponse defines the structure of the response when getting a list of team members.
type TeamProjectPermissions ¶ added in v0.19.0
type TeamProjectPermissions struct {
ID int `json:"id"`
Roles []*TranslatorRole `json:"roles"`
Project *Project `json:"project"`
}
TeamProjectPermissions represents a team's permissions in a project.
type TeamProjectPermissionsListResponse ¶ added in v0.19.0
type TeamProjectPermissionsListResponse struct {
Data []*TeamProjectPermissionsResponse `json:"data"`
}
TeamProjectPermissionsListResponse defines the structure of the response when getting a list of team's project permissions.
type TeamProjectPermissionsResponse ¶ added in v0.19.0
type TeamProjectPermissionsResponse struct {
Data *TeamProjectPermissions `json:"data"`
}
TeamProjectPermissionsResponse defines the structure of the response when getting a team's project permissions.
type TeamResponse ¶ added in v0.4.0
type TeamResponse struct {
Data *Team `json:"data"`
}
TeamResponse defines the structure of the response when getting a team.
type TeamsGetResponse ¶ added in v0.15.0
type TeamsGetResponse struct {
Data *GroupsTeam `json:"data"`
}
TeamsGetResponse defines the structure of the response when list a group of teams.
type TeamsListOptions ¶ added in v0.4.0
type TeamsListOptions struct {
// Search by name
Search string `json:"search,omitempty"`
// Filter by project identifier
// It can be one project or a list of comma-separated ones
ProjectIDs string `json:"projectIds,omitempty"`
// Filter by role in project.
// Enum: manager, developer, translator, proofreader, language_coordinator, member
// Example: projectRoles=manager,developer,language_coordinator
ProjectRoles string `json:"projectRoles,omitempty"`
// Filter project languages
// It can be one language or a list of comma-separated ones
LanguageIDs string `json:"languageIds,omitempty"`
// Filter by group identifier
// It can be one group or a list of comma-separated ones
GroupIDs string `json:"groupIds,omitempty"`
// Sort teams by specified field.
// Enum: id, name, createdAt, updatedAt. Default: id.
OrderBy string `json:"orderBy,omitempty"`
ListOptions
}
TeamsListOptions specifies the optional parameters to the TeamsService.List method.
type TeamsListResponse ¶ added in v0.4.0
type TeamsListResponse struct {
Data []*TeamResponse `json:"data"`
}
TeamsListResponse defines the structure of the response when getting a list of teams.
type Term ¶ added in v0.3.0
type Term struct {
ID int `json:"id"`
UserID int `json:"userId"`
GlossaryID int `json:"glossaryId"`
LanguageID string `json:"languageId"`
Text string `json:"text"`
Description string `json:"description"`
PartOfSpeech string `json:"partOfSpeech"`
Status string `json:"status"`
Type string `json:"type"`
Gender string `json:"gender"`
Note string `json:"note"`
URL string `json:"url"`
ConceptID int `json:"conceptId"`
Lemma string `json:"lemma"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
// Custom fields (Enterprise only).
Fields any `json:"fields,omitempty"`
}
Term represents a term in a glossary.
type TermAddRequest ¶ added in v0.3.0
type TermAddRequest struct {
// Term Language Identifier.
LanguageID string `json:"languageId"`
// Term.
Text string `json:"text"`
// Term description.
Description string `json:"description,omitempty"`
// Term part of speech.
// Enum: adjective, adposition, adverb, auxiliary, coordinating conjunction,
// determiner, interjection, noun, numeral, particle, pronoun, proper noun,
// subordinating conjunction, verb, other.
PartOfSpeech string `json:"partOfSpeech,omitempty"`
// Term status.
// Enum: preferred, admitted, not recommended, obsolete.
Status string `json:"status,omitempty"`
// Term type.
// Enum: full form, acronym, abbreviation, short form, phrase, variant.
Type string `json:"type,omitempty"`
// Gender.
// Enum: masculine, feminine, neuter, other.
Gender string `json:"gender,omitempty"`
// Any kind of note, such as a usage note, explanation, or instruction.
Note string `json:"note,omitempty"`
// Base URL.
URL string `json:"url,omitempty"`
// Defines whether to add translation to the existing term.
ConceptID int `json:"conceptId,omitempty"`
// Custom fields. Keys can be retrieved via the FieldsService.List method.
// Note: Enterprise only.
Fields map[string]any `json:"fields,omitempty"`
}
TermAddRequest defines the structure of a request to add a term.
func (*TermAddRequest) Validate ¶ added in v0.3.0
func (r *TermAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type TermResponse ¶ added in v0.3.0
type TermResponse struct {
Data *Term `json:"data"`
}
TermResponse defines the structure of a response when getting a term.
type TermsListOptions ¶ added in v0.3.0
type TermsListOptions struct {
// Sort terms by specified field.
// Enum: id, text, description, partOfSpeech, status, type, gender,
// note, lemma, createdAt, updatedAt. Default: id.
// Example: orderBy=createdAt desc,text
OrderBy string `json:"orderBy,omitempty"`
// Project Member Identifier.
UserID int `json:"userId,omitempty"`
// Term Language Identifier.
LanguageID string `json:"languageId,omitempty"`
// Filter terms by `conceptId`.
// Note: Use for terms that have translations.
ConceptID int `json:"conceptId,omitempty"`
// Filter terms by `termId`.
// Note: Use for terms that have translations.
TranslationOfTermID int `json:"translationOfTermId,omitempty"`
// Filter strings by CroQL
// Note: Can be used only with orderBy, offset and limit in same request.
CroQL string `json:"croql,omitempty"`
ListOptions
}
TermsListOptions specifies the optional parameters to the GlossariesService.ListTerms method.
type TermsListResponse ¶ added in v0.3.0
type TermsListResponse struct {
Data []*TermResponse `json:"data"`
}
TermsListResponse defines the structure of a response when getting a list of terms.
type TimeSpentSchema ¶ added in v0.19.0
type TimeSpentSchema struct {
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Grouping parameter. Enum: user, language, task.
GroupBy string `json:"groupBy,omitempty"`
// Base rates. Only the `hourly` rate is used.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates. Only the `hourly` rate is used.
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Task type. Enum: 0 - translate, 1 - proofread,
// 2 - translate by vendor, 3 - proofread by vendor.
TypeTasks *int `json:"typeTasks,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Task identifiers for which the report should be generated.
TaskIDs []int `json:"taskIds,omitempty"`
// Workflow step identifier (Enterprise only).
WorkflowStepID int `json:"workflowStepId,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
TimeSpentSchema defines the schema for the time spent report.
func (*TimeSpentSchema) ValidateSchema ¶ added in v0.19.0
func (r *TimeSpentSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TimeSpent schema is valid.
type TopMembersSchema ¶ added in v0.4.0
type TopMembersSchema struct {
// Defines report unit.
// Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
}
TopMembersSchema defines the schema for the top members report.
func (*TopMembersSchema) ValidateSchema ¶ added in v0.4.0
func (r *TopMembersSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TopMembers schema is valid.
type TransactionCostsPostEditingSchema ¶ added in v0.4.0
type TransactionCostsPostEditingSchema struct {
// Report unit.
// Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Report currency.
// Enum: USD, EUR, JPY, GBP, AUD, CAD, CHF, CNY, SEK, NZD, MXN,
// SGD, HKD, NOK, KRW, TRY, RUB, INR, BRL, ZAR, GEL, UAH, DDK
Currency string `json:"currency,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Base rates.
BaseRates *ReportBaseRates `json:"baseRates,omitempty"`
// Individual rates (Custom rates for certain languages or users).
IndividualRates []*ReportIndividualRates `json:"individualRates,omitempty"`
// Net Rate Schemes (Percentage paid of full translation rate).
// Note: A new translation will be included in the report at the lowest rate
// if multiple scheme categories can be applied to the translation.
NetRateSchemes *ReportNetRateSchemes `json:"netRateSchemes,omitempty"`
// Exclude approvals when the same user has made translations for the string.
//
// Deprecated: the API no longer supports this field.
ExcludeApprovalsForEditedTranslations *bool `json:"excludeApprovalsForEditedTranslations,omitempty"`
// Approvals are treated as submitting an identical translation at the
// 100% match rate of the corresponding category.
UseCategoryBasedProofreadRates *bool `json:"useCategoryBasedProofreadRates,omitempty"`
// Calculations are based on the edit distance between the TM match
// and final translation.
UseTmEditDistance *bool `json:"useTmEditDistance,omitempty"`
// Grouping parameter.
// Enum: user, language. Default: user.
GroupBy string `json:"groupBy,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// User Identifier for which the report should be generated.
UserIDs []int `json:"userIds,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// List of label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Defines which strings include in report.
// Enum: strings_with_label, strings_without_label. Default: strings_with_label.
LabelIncludeType string `json:"labelIncludeType,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Workflow step identifier (Enterprise only).
WorkflowStepID int `json:"workflowStepId,omitempty"`
// Task Identifier.
// Used to generate report by task.
//
// Deprecated: use TaskIDs instead.
TaskID int `json:"taskId,omitempty"`
// Task identifiers.
// Used to generate report by tasks.
TaskIDs []int `json:"taskIds,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
TransactionCostsPostEditingSchema defines the schema for the transaction costs post-editing report.
func (*TransactionCostsPostEditingSchema) ValidateSchema ¶ added in v0.4.0
func (r *TransactionCostsPostEditingSchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TransactionCostsPostEditing schema is valid.
type TranslateRequest ¶ added in v0.3.0
type TranslateRequest struct {
// Source Language Identifier.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Target Language Identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Select a provider for language recognition.
// Enum: crowdin, engine.
// Note: Is required if the source language is not selected.
LanguageRecognitionProvider LanguageRecognitionProvider `json:"languageRecognitionProvider,omitempty"`
// Strings that should be translated.
// Note: You can translate up to 100 strings at a time.
Strings []string `json:"strings"`
}
TranslateRequest defines the structure of a request to translate strings.
func (*TranslateRequest) Validate ¶ added in v0.3.0
func (r *TranslateRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type Translation ¶
type Translation struct {
ID int `json:"id"`
Text string `json:"text"`
PluralCategoryName string `json:"pluralCategoryName"`
User *ShortUser `json:"user"`
Rating int `json:"rating"`
Provider *string `json:"provider,omitempty"`
IsPreTranslated bool `json:"isPreTranslated"`
CreatedAt string `json:"createdAt"`
// Provider specific identifier: a TM for `tm`, an AI Prompt for `ai`,
// an MT engine for machine translation providers.
ProviderID *int `json:"providerId,omitempty"`
// Translation Memory match rate in percent (40-100).
MatchRate *int `json:"matchRate,omitempty"`
// Translation Memory match type. Enum: perfect, exact, fuzzy.
MatchType *string `json:"matchType,omitempty"`
// Asset URL. Present for asset translations.
URL string `json:"url,omitempty"`
// Workflow Step Identifier (Crowdin Enterprise only).
WorkflowStepID int `json:"workflowStepId,omitempty"`
}
Translation represents a Crowdin translation.
type TranslationActivitySchema ¶ added in v0.18.0
type TranslationActivitySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces. Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// Export file format. Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
}
TranslationActivitySchema defines the schema for the translation activity report.
func (*TranslationActivitySchema) ValidateSchema ¶ added in v0.18.0
func (r *TranslationActivitySchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TranslationActivity schema is valid.
type TranslationAddRequest ¶
type TranslationAddRequest struct {
// String Identifier.
// Note: Must be used together with `languageId`.
StringID int `json:"stringId,omitempty"`
// Language Identifier.
// Note: Must be used together with `stringId`.
LanguageID string `json:"languageId"`
// Translation text.
Text string `json:"text,omitempty"`
// Plural form. Enum: zero, one, two, few, many, and other.
// Note: Will be saved only if the source string has plurals and `pluralCategoryName`
// is equal to the one available for the language you add translations to.
PluralCategoryName string `json:"pluralCategoryName,omitempty"`
// Defines whether to add translation to TM. Default: true.
AddToTM *bool `json:"addToTm,omitempty"`
// Translation provider type. Required when `providerId` or `isPreTranslated` is specified.
// Enum: tm, global_tm, google, microsoft, crowdin, deepl, amazon, google_automl,
// modernmt, custom_mt, ai.
// Note: `global_tm` value can't be used with `providerId` in the same request.
Provider string `json:"provider,omitempty"`
// Provider specific identifier (TM, AI Prompt or MT engine identifier).
// Note: Can't be used if `provider` value is `global_tm`.
ProviderID int `json:"providerId,omitempty"`
// Defines whether this is an auto-translated translation. Default: false.
IsPreTranslated *bool `json:"isPreTranslated,omitempty"`
// File Identifier. Used to add an asset translation together with `storageId`.
FileID int `json:"fileId,omitempty"`
// Storage Identifier. Used to add an asset translation together with `fileId`.
StorageID int `json:"storageId,omitempty"`
}
TranslationAddRequest defines the structure of the request to add a translation.
func (*TranslationAddRequest) Validate ¶
func (r *TranslationAddRequest) Validate() error
Validate checks if the TranslationAddRequest is valid. It implements the crowdin.RequestValidator interface.
type TranslationAlignment ¶
type TranslationAlignment struct {
Words []*WordAlignment `json:"words"`
}
TranslationAlignment represents a translation alignment.
type TranslationAlignmentRequest ¶
type TranslationAlignmentRequest struct {
// Source Language Identifier.
SourceLanguageID string `json:"sourceLanguageId"`
// Target Language Identifier.
TargetLanguageID string `json:"targetLanguageId"`
// Text for alignment.
Text string `json:"text"`
}
TranslationAlignmentRequest defines the structure of the request to align translations.
func (*TranslationAlignmentRequest) Validate ¶
func (r *TranslationAlignmentRequest) Validate() error
Validate checks if the TranslationAlignmentRequest is valid. It implements the crowdin.RequestValidator interface.
type TranslationAlignmentResponse ¶
type TranslationAlignmentResponse struct {
Data *TranslationAlignment `json:"data"`
}
TranslationAlignmentResponse defines the structure of the response when aligning translations.
type TranslationGetOptions ¶
type TranslationGetOptions struct {
// Enable denormalize placeholders.
// Enum: 0, 1. Default: 0.
DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"`
}
TranslationGetOptions specifies the optional parameters to the StringTranslationsService.GetTranslation method.
type TranslationGetResponse ¶
type TranslationGetResponse struct {
Data *Translation `json:"data"`
}
TranslationGetResponse defines the structure of the response when getting a single translation.
type TranslationImport ¶ added in v0.19.0
type TranslationImport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes *TranslationImportAttributes `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt *string `json:"startedAt"`
FinishedAt *string `json:"finishedAt"`
}
TranslationImport represents a translation import job.
type TranslationImportAttributes ¶ added in v0.19.0
type TranslationImportAttributes struct {
StorageID int `json:"storageId"`
FileID int `json:"fileId,omitempty"`
BranchID int `json:"branchId,omitempty"`
LanguageIDs []string `json:"languageIds"`
ImportEqSuggestions bool `json:"importEqSuggestions"`
AutoApproveImported bool `json:"autoApproveImported"`
TranslateHidden bool `json:"translateHidden"`
AddToTM bool `json:"addToTm"`
}
TranslationImportAttributes represents the attributes of a translation import job.
type TranslationImportOptions ¶ added in v0.19.0
type TranslationImportOptions struct {
// Defines data columns mapping. The column numbering starts at 0.
// Keys: "none", "identifier", "sourceOrTranslation", "translation", or a
// language identifier (e.g. "en", "de").
Scheme map[string]int `json:"scheme,omitempty"`
}
TranslationImportOptions defines the spreadsheet file import options for string-based projects.
type TranslationImportReport ¶ added in v0.19.0
type TranslationImportReport struct {
Languages []*TranslationImportReportLanguage `json:"languages"`
}
TranslationImportReport represents a translation import report.
type TranslationImportReportItem ¶ added in v0.19.0
type TranslationImportReportItem struct {
ID string `json:"id"`
Statistics *LanguageReportStatistics `json:"statistics"`
}
TranslationImportReportItem represents a file or branch entry of the translation import report.
type TranslationImportReportLanguage ¶ added in v0.19.0
type TranslationImportReportLanguage struct {
ID string `json:"id"`
// Files statistics (file-based projects).
Files []*TranslationImportReportItem `json:"files,omitempty"`
// Branches statistics (string-based projects).
Branches []*TranslationImportReportItem `json:"branches,omitempty"`
Skipped *TranslationImportReportSkipped `json:"skipped,omitempty"`
SkippedQACheckCategories map[string]int `json:"skippedQaCheckCategories,omitempty"`
}
TranslationImportReportLanguage represents a language entry of the translation import report.
type TranslationImportReportResponse ¶ added in v0.19.0
type TranslationImportReportResponse struct {
Data *TranslationImportReport `json:"data"`
}
TranslationImportReportResponse defines the structure of a response when getting a translation import report.
type TranslationImportReportSkipped ¶ added in v0.19.0
type TranslationImportReportSkipped struct {
TranslationEqSource int `json:"translationEqSource"`
HiddenStrings int `json:"hiddenStrings"`
QACheck int `json:"qaCheck"`
}
TranslationImportReportSkipped represents skipped translations statistics of the translation import report.
type TranslationImportRequest ¶ added in v0.19.0
type TranslationImportRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// Language Identifiers.
LanguageIDs []string `json:"languageIds,omitempty"`
// File Identifier for import.
// Note: Required for content in all formats except XLIFF (file-based projects).
FileID int `json:"fileId,omitempty"`
// Branch Identifier for import.
// Note: Available only for string-based projects.
BranchID int `json:"branchId,omitempty"`
// Defines whether to add translation if it's the same as the source string.
// Default: false.
ImportEqSuggestions *bool `json:"importEqSuggestions,omitempty"`
// Mark uploaded translations as approved. Default: false.
AutoApproveImported *bool `json:"autoApproveImported,omitempty"`
// Allow translations upload to hidden source strings. Default: false.
TranslateHidden *bool `json:"translateHidden,omitempty"`
// Defines whether to add translation to TM. Default: true.
AddToTM *bool `json:"addToTm,omitempty"`
// Spreadsheet file import options.
// Note: Available only for string-based projects.
ImportOptions *TranslationImportOptions `json:"importOptions,omitempty"`
}
TranslationImportRequest defines the structure of a request to import translations.
func (*TranslationImportRequest) Validate ¶ added in v0.19.0
func (r *TranslationImportRequest) Validate() error
Validate checks if the import translations request is valid. It implements the crowdin.RequestValidator interface.
type TranslationImportResponse ¶ added in v0.19.0
type TranslationImportResponse struct {
Data *TranslationImport `json:"data"`
}
TranslationImportResponse defines the structure of a response when importing translations or getting an import status.
type TranslationMemoriesListOptions ¶ added in v0.3.0
type TranslationMemoriesListOptions struct {
// Sort the results by a specific field.
// Enum: id, name, userId, createdAt. Default: id.
// Example: orderBy=createdAt desc,name
OrderBy string `json:"orderBy,omitempty"`
// Project Member Identifier.
UserID int `json:"userId,omitempty"`
// Filter TMs by name.
Filter string `json:"filter,omitempty"`
// Group Identifier (Enterprise only).
// Note: Set 0 to see TMs of root group.
GroupID *int `json:"groupId,omitempty"`
ListOptions
}
TranslationMemoriesListOptions specifies the optional parameters to the TranslationMemoryService.ListTMs method.
type TranslationMemoriesListResponse ¶ added in v0.3.0
type TranslationMemoriesListResponse struct {
Data []*TranslationMemoryResponse `json:"data"`
}
TranslationMemoriesListResponse defines the structure of the response when getting a list of Translation Memories.
type TranslationMemory ¶ added in v0.3.0
type TranslationMemory struct {
ID int `json:"id"`
GroupID *int `json:"groupId,omitempty"`
UserID int `json:"userId"`
Name string `json:"name"`
LanguageID string `json:"languageId"`
LanguageIDs []string `json:"languageIds"`
SegmentsCount int `json:"segmentsCount"`
DefaultProjectIDs []int `json:"defaultProjectIds"`
ProjectIDs []int `json:"projectIds"`
WebURL string `json:"webUrl"`
CreatedAt string `json:"createdAt"`
}
TranslationMemory represents a Crowdin Translation Memory (TM).
type TranslationMemoryAddRequest ¶ added in v0.3.0
type TranslationMemoryAddRequest struct {
// Translation Memory name.
Name string `json:"name"`
// Translation Memory Language Identifier.
LanguageID string `json:"languageId"`
// Group Identifier - defines group to which TM is added (Enterprise only).
// If `0` – TM will be available for all projects and groups in your workspace.
// Default: 0.
GroupID *int `json:"groupId,omitempty"`
// the account (Crowdin) or the group (Crowdin Enterprise).
IsShared *bool `json:"isShared,omitempty"`
}
TranslationMemoryAddRequest defines the structure of the request when adding a new Translation Memory.
func (*TranslationMemoryAddRequest) Validate ¶ added in v0.3.0
func (r *TranslationMemoryAddRequest) Validate() error
Validate checks if the TranslationMemoryAddRequest is valid. It implements the crowdin.Validator interface.
type TranslationMemoryExport ¶ added in v0.3.0
type TranslationMemoryExport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
SourceLanguageID string `json:"sourceLanguageId"`
TargetLanguageID string `json:"targetLanguageId"`
Format string `json:"format"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
TranslationMemoryExport represents a Crowdin Translation Memory export status.
type TranslationMemoryExportRequest ¶ added in v0.3.0
type TranslationMemoryExportRequest struct {
// Defines Source Language in language pair.
SourceLanguageID string `json:"sourceLanguageId,omitempty"`
// Defines Target Language in language pair.
TargetLanguageID string `json:"targetLanguageId,omitempty"`
// Defines TMs file format.
// Enum: tmx, csv, xlsx. Default: tmx.
Format TMExportFormat `json:"format,omitempty"`
}
TranslationMemoryExportRequest defines the structure of the request when exporting a Translation Memory.
func (*TranslationMemoryExportRequest) Validate ¶ added in v0.3.0
func (r *TranslationMemoryExportRequest) Validate() error
Validate checks if the TranslationMemoryExportRequest is valid. It implements the crowdin.Validator interface.
type TranslationMemoryExportResponse ¶ added in v0.3.0
type TranslationMemoryExportResponse struct {
Data *TranslationMemoryExport `json:"data"`
}
TranslationMemoryExportResponse defines the structure of the response when exporting a Translation Memory.
type TranslationMemoryImport ¶ added in v0.3.0
type TranslationMemoryImport struct {
Identifier string `json:"identifier"`
Status string `json:"status"`
Progress int `json:"progress"`
Attributes struct {
TMID int `json:"tmId"`
StorageID int `json:"storageId"`
FirstLineContainsHeader bool `json:"firstLineContainsHeader"`
Scheme map[string]int `json:"scheme"`
} `json:"attributes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
StartedAt string `json:"startedAt"`
FinishedAt string `json:"finishedAt"`
}
TranslationMemoryImport represents a Crowdin Translation Memory import status.
type TranslationMemoryImportRequest ¶ added in v0.3.0
type TranslationMemoryImportRequest struct {
// Storage Identifier.
// Supported file formats: TMX, CSV, XLS/XLSX.
StorageID int `json:"storageId"`
// Defines whether file includes first row header that
// should not be imported.
// Note: Used for upload of CSV or XLS/XLSX files only.
// Default: false.
FirstLineContainsHeader *bool `json:"firstLineContainsHeader,omitempty"`
// Defines data columns mapping.
// The passed value should be an associative array containing both
// language id and column number.
// - {languageId} – Crowdin id for the specified language.
// - {columnNumber} – a column number. Please note, that column
// numbering starts at 0.
// Note: Required for CSV or XLS/XLSX files.
// Example: {"uk": 0, "fr": 1}
Scheme map[string]int `json:"scheme,omitempty"`
}
TranslationMemoryImportRequest defines the structure of the request when importing a Translation Memory.
func (*TranslationMemoryImportRequest) Validate ¶ added in v0.3.0
func (r *TranslationMemoryImportRequest) Validate() error
Validate checks if the TranslationMemoryImportRequest is valid. It implements the crowdin.Validator interface.
type TranslationMemoryImportResponse ¶ added in v0.3.0
type TranslationMemoryImportResponse struct {
Data *TranslationMemoryImport `json:"data"`
}
TranslationMemoryImportResponse defines the structure of the response when importing a Translation Memory.
type TranslationMemoryResponse ¶ added in v0.3.0
type TranslationMemoryResponse struct {
Data *TranslationMemory `json:"data"`
}
TranslationMemoryResponse defines the structure of the response when getting a single Translation Memory.
type TranslationProgress ¶
type TranslationProgress struct {
// Words statistics. Keys: total, translated, preTranslateAppliedTo, approved.
Words map[string]int `json:"words"`
// Phrases statistics. Keys: total, translated, preTranslateAppliedTo, approved.
Phrases map[string]int `json:"phrases"`
TranslationProgress int `json:"translationProgress"`
ApprovalProgress int `json:"approvalProgress"`
QAChecksStatus *QAChecksStatus `json:"qaChecksStatus,omitempty"`
LanguageID *string `json:"languageId,omitempty"`
BranchID *int `json:"branchId,omitempty"`
FileID *int `json:"fileId,omitempty"`
Language *Language `json:"language,omitempty"`
Etag *string `json:"etag,omitempty"`
}
TranslationProgress defines the structure of a translations status progress.
type TranslationProgressResponse ¶
type TranslationProgressResponse struct {
Data []struct {
Data *TranslationProgress `json:"data"`
} `json:"data"`
}
TranslationStatusProgressResponse defines the structure of a response when getting a translation status progress (for a branch, directory, file, language or project).
type TranslationsBuildsListOptions ¶
type TranslationsBuildsListOptions struct {
ListOptions
// Branch Identifier. Filter builds by branchId.
BranchID int `json:"branchId,omitempty"`
}
TranslationsBuildsListOptions specifies the optional parameters to the TranslationsService.ListProjectBuilds method.
type TranslationsListResponse ¶
type TranslationsListResponse struct {
Data []*TranslationGetResponse `json:"data"`
}
TranslationsListResponse defines the structure of the response when getting a list of translations.
type TranslationsProjectBuild ¶
type TranslationsProjectBuild struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
Status string `json:"status"`
Progress int `json:"progress"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
FinishedAt string `json:"finishedAt,omitempty"`
Attributes *BuildAttributes `json:"attributes,omitempty"`
// Error is present only when the build status is "failed".
Error *BuildError `json:"error,omitempty"`
}
TranslationsProjectBuild represents a project build.
type TranslationsProjectBuildResponse ¶
type TranslationsProjectBuildResponse struct {
Data *TranslationsProjectBuild `json:"data"`
}
TranslationsProjectBuildResponse defines the structure of a response when getting a project build.
type TranslationsProjectBuildsListResponse ¶
type TranslationsProjectBuildsListResponse struct {
Data []*TranslationsProjectBuildResponse `json:"data"`
}
TranslationsProjectBuildsListResponse defines the structure of a response when getting a list of project builds.
type TranslatorAccuracySchema ¶ added in v0.13.0
type TranslatorAccuracySchema struct {
// Report unit. Enum: strings, words, chars, chars_with_spaces.
// Default: words.
Unit ReportUnit `json:"unit,omitempty"`
// Export file format.
// Enum: xlsx, csv, json. Default: xlsx.
Format ReportFormat `json:"format,omitempty"`
// Split into categories by edit distance.
//
// Deprecated: use MatchScoreCategories instead.
PostEditingCategories []string `json:"postEditingCategories,omitempty"`
// Split into categories by match score. Ranges should be in
// descending order (e.g., 100-90, 89-80).
MatchScoreCategories []string `json:"matchScoreCategories,omitempty"`
// Language Identifier for which the report should be generated.
LanguageID string `json:"languageId,omitempty"`
// List of user identifiers.
UserIDs []int `json:"userIds,omitempty"`
// Report date from in UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// Report date to in UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// List of file identifiers.
FileIDs []int `json:"fileIds,omitempty"`
// List of directory identifiers.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// List of branch identifiers.
BranchIDs []int `json:"branchIds,omitempty"`
// List of label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Defines which strings include in report.
// Enum: strings_with_label, strings_without_label.
LabelIncludeType string `json:"labelIncludeType,omitempty"`
// If true, the report will not be saved to the archive.
SkipArchiving *bool `json:"skipArchiving,omitempty"`
}
TranslatorAccuracySchema defines the schema for the translator accuracy report.
func (*TranslatorAccuracySchema) ValidateSchema ¶ added in v0.13.0
func (r *TranslatorAccuracySchema) ValidateSchema() error
ValidateSchema implements the ReportSchema interface and checks if the TranslatorAccuracySchema schema is valid.
type TranslatorRole ¶ added in v0.3.0
type TranslatorRole struct {
// Roles name.
// Enum: translator, proofreader, language_coordinator.
Name Role `json:"name,omitempty"`
// Role permission configuration.
Permissions *RolePermissions `json:"permissions,omitempty"`
}
TranslatorRole represents a role of a translator.
type UpdateRequest ¶
type UpdateRequest struct {
// Patch operation to perform.
Op PatchOp `json:"op"`
// A JSON Pointer as defined by RFC 6901.
Path string `json:"path"`
// Value must be one of boolean, integer, string, array of strings,
// array of integers or map.
Value any `json:"value,omitempty"`
}
UpdateRequest defines the structure of a request to update a resource.
func (*UpdateRequest) Validate ¶
func (r *UpdateRequest) Validate() error
Validate checks if the update request is valid. It implements the crowdin.RequestValidator interface.
type UploadTranslations ¶
type UploadTranslations struct {
ProjectID int `json:"projectId"`
StorageID int `json:"storageId"`
LanguageID string `json:"languageId"`
FileID int `json:"fileId"`
}
UploadTranslations represents the uploaded translations.
type UploadTranslationsRequest ¶
type UploadTranslationsRequest struct {
// Storage Identifier.
StorageID int `json:"storageId"`
// File Identifier for import.
// Note: Required for content in all formats except XLIFF.
FileID int `json:"fileId,omitempty"`
// Branch Identifier for import.
// Note: Required for string based API.
BranchID int `json:"branchId,omitempty"`
// Defines whether to add translation if it's the same as the source string.
// Default: false.
ImportEqSuggestions *bool `json:"importEqSuggestions,omitempty"`
// Mark uploaded translations as approved. Default: false.
AutoApproveImported *bool `json:"autoApproveImported,omitempty"`
// Allow translations upload to hidden source strings. Default: false.
TranslateHidden *bool `json:"translateHidden,omitempty"`
// Defines whether to add translation to TM. Default: true.
AddToTM *bool `json:"addToTm,omitempty"`
}
UploadTranslationsRequest defines the structure of a request to upload translations.
func (*UploadTranslationsRequest) Validate ¶
func (r *UploadTranslationsRequest) Validate() error
Validate checks if the upload translations request is valid. It implements the crowdin.RequestValidator interface.
type UploadTranslationsResponse ¶
type UploadTranslationsResponse struct {
Data *UploadTranslations `json:"data"`
}
UploadTranslationsResponse defines the structure of a response when uploading translations.
type User ¶
type User struct {
ID int `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
EmailVerified *bool `json:"emailVerified,omitempty"`
FirstName *string `json:"firstName,omitempty"`
LastName *string `json:"lastName,omitempty"`
FullName *string `json:"fullName,omitempty"`
Status *string `json:"status,omitempty"` // Enum: active, pending, blocked
AvatarURL string `json:"avatarUrl"`
CreatedAt string `json:"createdAt"`
LastSeen string `json:"lastSeen,omitempty"`
TwoFactor string `json:"twoFactor"` // Enum: enabled, disabled
IsAdmin *bool `json:"isAdmin,omitempty"`
Timezone string `json:"timezone,omitempty"`
Fields any `json:"fields,omitempty"`
// Details about how the user joined the organization (Enterprise only).
JoinDetails *UserJoinDetails `json:"joinDetails,omitempty"`
// Device verification status. Enum: enabled, disabled (Enterprise only).
DeviceVerification string `json:"deviceVerification,omitempty"`
// Number of trusted devices (Enterprise only).
TrustedDevicesCount int `json:"trustedDevicesCount,omitempty"`
// Number of API tokens (Enterprise only).
APITokensCount int `json:"apiTokensCount,omitempty"`
// Login methods used by the user (Enterprise only).
LoginMethods []string `json:"loginMethods,omitempty"`
// Multi-factor authentication methods (Enterprise only).
MFAMethods []string `json:"mfaMethods,omitempty"`
}
User represents a user in the system.
type UserID ¶ added in v0.9.0
type UserID int
UserID represents a user identifier.
func (*UserID) UnmarshalJSON ¶ added in v0.9.0
UnmarshalJSON handles the unmarshaling of UserID from both int and string numeric formats.
type UserJoinDetails ¶ added in v0.19.0
type UserJoinDetails struct {
// Join type. Example: privateInvitation.
Type string `json:"type"`
// The user who invited this user.
InvitedBy *ShortUser `json:"invitedBy,omitempty"`
}
UserJoinDetails represents details about how the user joined the organization.
type UserPermission ¶ added in v0.5.0
type UserPermission struct {
// Value enum: owner, managers, all, guests, restricted.
// Note: For exporters, the `all` value will be set.
User Permission `json:"user,omitempty"`
}
UserPermission represents a permission for a user that will be able to use the app.
type UserProjectContribution ¶ added in v0.19.0
type UserProjectContribution struct {
ID int `json:"id"`
Translated *ContributionStats `json:"translated"`
Approved *ContributionStats `json:"approved"`
Voted *ContributionStats `json:"voted"`
Commented *ContributionStats `json:"commented"`
Project *Project `json:"project"`
}
UserProjectContribution represents a user's contributions in a project (Enterprise only).
type UserProjectContributionResponse ¶ added in v0.19.0
type UserProjectContributionResponse struct {
Data *UserProjectContribution `json:"data"`
}
UserProjectContributionResponse defines the structure of the response when getting a user's project contribution.
type UserProjectContributionsListResponse ¶ added in v0.19.0
type UserProjectContributionsListResponse struct {
Data []*UserProjectContributionResponse `json:"data"`
}
UserProjectContributionsListResponse defines the structure of the response when getting a list of user's project contributions.
type UserProjectPermissions ¶ added in v0.19.0
type UserProjectPermissions struct {
ID int `json:"id"`
Roles []*TranslatorRole `json:"roles"`
Project *Project `json:"project"`
Teams []*Team `json:"teams"`
}
UserProjectPermissions represents a user's permissions in a project (Enterprise only).
type UserProjectPermissionsListResponse ¶ added in v0.19.0
type UserProjectPermissionsListResponse struct {
Data []*UserProjectPermissionsResponse `json:"data"`
}
UserProjectPermissionsListResponse defines the structure of the response when getting a list of user's project permissions.
type UserProjectPermissionsResponse ¶ added in v0.19.0
type UserProjectPermissionsResponse struct {
Data *UserProjectPermissions `json:"data"`
}
UserProjectPermissionsResponse defines the structure of the response when getting a user's project permissions.
type UserResponse ¶ added in v0.3.0
type UserResponse struct {
Data *User `json:"data"`
}
UserResponse defines the structure of the response when getting a single user.
type UserTasksListOptions ¶ added in v0.3.0
type UserTasksListOptions struct {
// Sort a list of user tasks by a specified field.
// Enum: id, title, description, createdAt, updatedAt,
// deadline, startedAt, resolvedAt. Default: id.
// Example: orderBy=createdAt desc,title
OrderBy string `json:"orderBy,omitempty"`
// List tasks with specified statuses. It can be one status
// or a list of status values.
// Enum: todo, in_progress, done, closed.
Status []TaskStatus `json:"status,omitempty"`
// List archived/not archived tasks for the authorized user.
// Enum: 1 - archived, 0 - not archived. Default: 0.
IsArchived *int `json:"isArchived,omitempty"`
ListOptions
}
UserTasksListOptions specifies the optional parameters to the TasksService.ListUserTasks method.
type UsersListOptions ¶ added in v0.3.0
type UsersListOptions struct {
// Sort users by a specific field.
// Enum: id, username, firstName, lastName, email, status, createdAt, lastSeen.
// Default: id.
// Example: orderBy=createdAt desc,username
OrderBy string `json:"orderBy,omitempty"`
// Filter users by status.
// Enum: active, pending, blocked.
Status string `json:"status,omitempty"`
// Search users by `firstName`, `lastName`, `username`, or `email`.
Search string `json:"search,omitempty"`
// Filter users by two-factor authentication status.
// Enum: enabled, disabled.
TwoFactor string `json:"twoFactor,omitempty"`
// Filter by role in organization.
// Enum: admin, manager, vendor, client
// Example: organizationRoles=manager,vendor,client
OrganizationRoles string `json:"organizationRoles,omitempty"`
// Filter by team identifier
TeamID int `json:"teamId,omitempty"`
// Filter by project identifier
// It can be one project or a list of comma-separated ones
ProjectIDs string `json:"projectIds,omitempty"`
// Filter by role in project
// Enum: manager, developer, translator, proofreader, language_coordinator, member
// Example: projectRoles=manager,developer,language_coordinator
ProjectRoles string `json:"projectRoles,omitempty"`
// Filter project languages
// It can be one language or a list of comma-separated ones
LanguageIDs string `json:"languageIds,omitempty"`
// Filter by group identifier
// It can be one group or a list of comma-separated ones
GroupIDs string `json:"groupIds,omitempty"`
// Date in UTC, ISO 8601
// Example: lastSeenFrom=2024-01-10T10:41:33+00:00
// Note: Must be used together with lastSeenTo
LastSeenFrom string `json:"lastSeenFrom,omitempty"`
// Date in UTC, ISO 8601
// Example: lastSeenTo=2024-01-10T10:41:33+00:00
// Note: Must be used together with lastSeenFrom
LastSeenTo string `json:"lastSeenTo,omitempty"`
ListOptions
}
UsersListOptions specifies the optional parameters to the UsersService.List method.
type UsersListResponse ¶ added in v0.3.0
type UsersListResponse struct {
Data []*UserResponse `json:"data"`
}
UsersListResponse defines the structure of the response when getting a list of users.
type VDFFileFormatSettings ¶ added in v0.19.0
type VDFFileFormatSettings struct {
// Defines whether to convert ICU messages. Default: true.
ConvertICU *bool `json:"convertIcu,omitempty"`
// Defines whether to add the gender argument. Default: false.
AddGenderArgument *bool `json:"addGenderArgument,omitempty"`
// File format export pattern. Defines file name and path in resulting translations bundle.
// Default: null. Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
}
VDFFileFormatSettings defines the VDF file format settings.
func (*VDFFileFormatSettings) ValidateSettings ¶ added in v0.19.0
func (p *VDFFileFormatSettings) ValidateSettings() error
type VDFFileImportOptions ¶ added in v0.19.0
type VDFFileImportOptions struct {
// Defines whether to convert placeholders to the ICU MessageFormat syntax.
// Default: true.
ConvertICU *bool `json:"convertIcu,omitempty"`
// Defines whether to append _gender suffix to variable names when converting
// gender ICU to ICU MessageFormat. Default: false.
// Note: Can be enabled only when `convertIcu` is enabled.
AddGenderArgument *bool `json:"addGenderArgument,omitempty"`
}
VDFFileImportOptions implements the FileImportOptions interface.
func (*VDFFileImportOptions) ValidateFileImportOptions ¶ added in v0.19.0
func (o *VDFFileImportOptions) ValidateFileImportOptions() error
type VSDXFileImportOptions ¶ added in v0.19.0
type VSDXFileImportOptions struct {
// When checked, strips additional formatting tags related to text spacing.
// Default: false.
CleanTagsAggressively *bool `json:"cleanTagsAggressively,omitempty"`
// When checked, exposes hidden hyperlinks for translation. Default: false.
TranslateHyperlinkURLs *bool `json:"translateHyperlinkUrls,omitempty"`
CommonFileImportOptions
}
VSDXFileImportOptions implements the FileImportOptions interface.
type ValidationError ¶
type ValidationError struct {
ErrorDetail struct {
Key string `json:"key"`
Errors []Error `json:"errors"`
} `json:"error"`
}
ValidationError represents the schema for the invalid request error response.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the Error interface.
type ValidationErrorResponse ¶
type ValidationErrorResponse struct {
Response *http.Response `json:"-"`
Errors []ValidationError `json:"errors"`
Status int
}
ValidationErrorResponse is the validation error response structure from the API.
func (*ValidationErrorResponse) Error ¶
func (r *ValidationErrorResponse) Error() string
Error implements the Error interface.
type Vendor ¶ added in v0.4.0
type Vendor struct {
ID int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
WebURL string `json:"webUrl"`
}
Vendor represents a vendor in the system.
type VendorGengoTaskCreateForm
deprecated
added in
v0.3.0
type VendorGengoTaskCreateForm struct {
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 2 - translate by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: "gengo" - Gengo.
Vendor TaskVendor `json:"vendor"`
// Branch identifiers.
// One of branchIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// String identifiers.
// One of branchIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers.
// One of branchIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Task expertise. Default: standard.
// Enum: standard, pro.
Expertise string `json:"expertise,omitempty"`
// Task tone. Default: "".
// Enum: "", "Informal", "Friendly", "Business", "Formal", "other".
Tone *string `json:"tone,omitempty"`
// Task purpose. Default: "standard".
// Enum: "Personal use", "Business", "Online content", "App/Web localization",
// "Media content", "Semi-technical", "other".
Purpose string `json:"purpose,omitempty"`
// Instructions for translators.
CustomerMessage string `json:"customerMessage,omitempty"`
// Use preferred translators. Default: false.
UsePreferred *bool `json:"usePreferred,omitempty"`
// Enables Edit stage for all jobs. Default: false.
EditService *bool `json:"editService,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
VendorGengoTaskCreateForm defines the structure of the request to create a Gengo vendor task.
Deprecated: use VendorTaskCreateForm instead.
func (*VendorGengoTaskCreateForm) Validate ¶ added in v0.3.0
func (r *VendorGengoTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*VendorGengoTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *VendorGengoTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type VendorManualPendingTaskCreateForm
deprecated
added in
v0.3.0
type VendorManualPendingTaskCreateForm struct {
// Translate task identifier.
PrecedingTaskID int `json:"precedingTaskId"`
// Task type. Enum: 3 - proofread by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: alconost, babbleon, tomedes, e2f, write_path_admin,
// inlingo, acclaro, translate_by_humans, lingo24, assertio_language_services,
// gte_localize, kettu_solutions, languageline_solutions.
Vendor TaskVendor `json:"vendor"`
// Task title.
Title string `json:"title"`
// Task description.
Description string `json:"description,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
}
VendorManualPendingTaskCreateForm defines the structure of the request to create a pending manual vendor task.
Deprecated: use PendingTaskCreateForm with the Vendor field instead.
func (*VendorManualPendingTaskCreateForm) Validate ¶ added in v0.3.0
func (r *VendorManualPendingTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*VendorManualPendingTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *VendorManualPendingTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type VendorManualTaskCreateForm
deprecated
added in
v0.3.0
type VendorManualTaskCreateForm struct {
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 2 - translate by vendor, 3 - proofread by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: alconost, babbleon, tomedes, e2f, write_path_admin,
// inlingo, acclaro, translate_by_humans, lingo24, assertio_language_services,
// gte_localize, kettu_solutions, languageline_solutions.
Vendor TaskVendor `json:"vendor"`
// Branch identifiers.
// One of branchIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// String identifiers.
// One of branchIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers.
// One of branchIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Skip strings already included in other tasks. Default: false.
SkipAssignedStrings *bool `json:"skipAssignedStrings,omitempty"`
// Defines whether to export only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false`,
// `type=0` or `type=2` in same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Task assignees.
Assignees []CrowdinTaskAssignee `json:"assignees,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
Deadline string `json:"deadline,omitempty"`
// Task started date. Format: UTC, ISO 8601.
StartedAt string `json:"startedAt,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
VendorManualTaskCreateForm defines the structure of the request to create a manual vendor task.
Deprecated: use VendorTaskCreateForm instead.
func (*VendorManualTaskCreateForm) Validate ¶ added in v0.3.0
func (r *VendorManualTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*VendorManualTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *VendorManualTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type VendorOhtTaskCreateForm
deprecated
added in
v0.3.0
type VendorOhtTaskCreateForm struct {
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 2 - translate by vendor, 3 - proofread by vendor.
Type TaskType `json:"type"`
// Task vendor. Enum: "oht" - OneHourTranslation.
Vendor TaskVendor `json:"vendor"`
// Branch identifiers.
// One of branchIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// String identifiers.
// One of branchIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers.
// One of branchIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Task expertise. Default: standard.
// Enum: standard, mobile-applications, software-it, gaming-video-games,
// technical-engineering, marketing-consumer-media, business-finance,
// legal-certificate, medical, ad-words-banners, automotive-aerospace,
// scientific, scientific-academic, tourism, training-employee-handbooks,
// forex-crypto.
Expertise string `json:"expertise,omitempty"`
// Enables Edit stage for all jobs. Default: false.
EditService *bool `json:"editService,omitempty"`
// Defines whether to include only pretranslated strings. Default: false.
// Note: `true` value can't be used with `skipUntranslatedStrings=false` or
// `includeUntranslatedStringsOnly=true` in the same request.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
}
VendorOhtTaskCreateForm defines the structure of the request to create a OneHourTranslation vendor task.
Deprecated: use VendorTaskCreateForm instead.
func (*VendorOhtTaskCreateForm) Validate ¶ added in v0.3.0
func (r *VendorOhtTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*VendorOhtTaskCreateForm) ValidateRequest ¶ added in v0.3.0
func (r *VendorOhtTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type VendorResponse ¶ added in v0.4.0
type VendorResponse struct {
Data *Vendor `json:"data"`
}
VendorResponse defines the structure of the response when getting a vendor.
type VendorTaskCreateForm ¶ added in v0.19.0
type VendorTaskCreateForm struct {
// Task title.
Title string `json:"title"`
// Language identifier.
LanguageID string `json:"languageId"`
// Task type. Enum: 2 - translate by vendor, 3 - proofread by vendor.
Type TaskType `json:"type"`
// Vendor identifier. Built-in vendors: crowdin_language_service, oht,
// gengo, undertow. For any other vendor, use its identifier from the
// Crowdin Store.
Vendor TaskVendor `json:"vendor"`
// Branch identifiers.
// One of branchIds, directoryIds, stringIds or fileIds is required.
BranchIDs []int `json:"branchIds,omitempty"`
// String identifiers.
// One of branchIds, directoryIds, stringIds or fileIds is required.
StringIDs []int `json:"stringIds,omitempty"`
// File identifiers (file-based projects only).
// One of branchIds, directoryIds, stringIds or fileIds is required.
FileIDs []int `json:"fileIds,omitempty"`
// Directory identifiers (file-based projects only).
// One of branchIds, directoryIds, stringIds or fileIds is required.
DirectoryIDs []int `json:"directoryIds,omitempty"`
// Label identifiers.
LabelIDs []int `json:"labelIds,omitempty"`
// Match rule for labels. Enum: all, any.
LabelMatchRule string `json:"labelMatchRule,omitempty"`
// Exclude label identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
// Match rule for excluded labels. Enum: all, any.
ExcludeLabelMatchRule string `json:"excludeLabelMatchRule,omitempty"`
// Task status. Enum: todo, in_progress.
Status TaskStatus `json:"status,omitempty"`
// Task description.
Description string `json:"description,omitempty"`
// Defines whether to include only pretranslated strings.
IncludePreTranslatedStringsOnly *bool `json:"includePreTranslatedStringsOnly,omitempty"`
// Skip strings already included in other tasks.
// Note: Not supported by all vendors.
SkipAssignedStrings *bool `json:"skipAssignedStrings,omitempty"`
// Task deadline date. Format: UTC, ISO 8601.
// Note: Not supported by all vendors.
Deadline string `json:"deadline,omitempty"`
// Start date for interval when strings were modified. Format: UTC, ISO 8601.
DateFrom string `json:"dateFrom,omitempty"`
// End date for interval when strings were modified. Format: UTC, ISO 8601.
DateTo string `json:"dateTo,omitempty"`
// Start date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateFrom string `json:"translationsUpdatedDateFrom,omitempty"`
// End date for interval when translations were updated (proofread tasks only).
// Format: UTC, ISO 8601.
TranslationsUpdatedDateTo string `json:"translationsUpdatedDateTo,omitempty"`
// Generate cost estimate report for the task. Requires `reportSettingsTemplateId`.
GenerateCostEstimate *bool `json:"generateCostEstimate,omitempty"`
// Generate translation cost report for the task. Requires `reportSettingsTemplateId`.
GenerateTranslationCost *bool `json:"generateTranslationCost,omitempty"`
// Report settings template identifier. Required when `generateCostEstimate`
// or `generateTranslationCost` is `true`.
ReportSettingsTemplateID int `json:"reportSettingsTemplateId,omitempty"`
}
VendorTaskCreateForm defines the structure of the request to create a task assigned to a vendor (Crowdin only).
func (*VendorTaskCreateForm) Validate ¶ added in v0.19.0
func (r *VendorTaskCreateForm) Validate() error
Validate checks if the request is valid.
func (*VendorTaskCreateForm) ValidateRequest ¶ added in v0.19.0
func (r *VendorTaskCreateForm) ValidateRequest() error
ValidateRequest validates the request.
type VendorsListResponse ¶ added in v0.4.0
type VendorsListResponse struct {
Data []*VendorResponse `json:"data"`
}
VendorsListResponse defines the structure of the response when getting a list of vendors.
type Vote ¶
type Vote struct {
ID int `json:"id"`
User *ShortUser `json:"user"`
TranslationID int `json:"translationId"`
VotedAt string `json:"votedAt"`
Mark string `json:"mark"`
}
Vote represents a Crowdin translation vote.
type VoteAddRequest ¶
type VoteAddRequest struct {
// Enum: up, down.
Mark VoteType `json:"mark"`
// Translation Identifier.
TranslationID int `json:"translationId"`
}
VoteAddRequest defines the structure of the request to add a translation vote.
func (*VoteAddRequest) Validate ¶
func (r *VoteAddRequest) Validate() error
Validate checks if the VotesAddRequest is valid. It implements the crowdin.RequestValidator interface.
type VoteGetResponse ¶
type VoteGetResponse struct {
Data *Vote `json:"data"`
}
VoteGetResponse defines the structure of the response when getting a single translation vote.
type VotesListOptions ¶
type VotesListOptions struct {
// String Identifier.
// Note: Must be used together with `languageId`.
StringID int `json:"stringId,omitempty"`
// Language Identifier.
// Note: Must be used together with `stringId`.
LanguageID string `json:"languageId,omitempty"`
// Translation Identifier.
// Note: If specified, `stringId` and `languageId` are ignored.
TranslationID int `json:"translationId,omitempty"`
// File Identifier.
// Note: Must be used together with `languageId`.
FileID int `json:"fileId,omitempty"`
// Label Identifiers.
// Example: labelIds=1,2,3,4,5
LabelIDs []int `json:"labelIds,omitempty"`
// Exclude Label Identifiers.
ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"`
ListOptions
}
VotesListOptions specifies the optional parameters to the StringTranslationsService.ListVotes method.
type VotesListResponse ¶
type VotesListResponse struct {
Data []*VoteGetResponse `json:"data"`
}
VotesListResponse defines the structure of the response when getting a list of translation votes.
type WebXMLFileFormatSettings ¶
type WebXMLFileFormatSettings struct {
CommonFileFormatSettings
// Specify the inline tags.
InlineTags []string `json:"inlineTags,omitempty"`
}
WebXMLFileFormatSettings defines the Web XML file format settings.
type WebXMLFileImportOptions ¶ added in v0.19.0
type WebXMLFileImportOptions struct {
// Specify tags that should be considered inline.
InlineTags []string `json:"inlineTags,omitempty"`
// HTML attributes (e.g., src, href, data) will be imported as hidden strings.
// Default: false.
HideAttributeValues *bool `json:"hideAttributeValues,omitempty"`
CommonFileImportOptions
}
WebXMLFileImportOptions implements the FileImportOptions interface.
type Webhook ¶ added in v0.4.0
type Webhook struct {
ID int `json:"id"`
ProjectID int `json:"projectId"`
Name string `json:"name"`
URL string `json:"url"`
Events []string `json:"events"`
Headers map[string]string `json:"headers"`
Payload map[string]any `json:"payload"`
IsActive bool `json:"isActive"`
BatchingEnabled bool `json:"batchingEnabled"`
RequestType string `json:"requestType"`
ContentType string `json:"contentType"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Webhook represents a webhook in Crowdin projects or account.
func (*Webhook) UnmarshalJSON ¶ added in v0.4.0
UnmarshalJSON unmarshals the JSON data into the Webhook structure. Headers property can be either an object (map) or an empty array.
type WebhookAddRequest ¶ added in v0.4.0
type WebhookAddRequest struct {
// Webhook name.
Name string `json:"name"`
// Webhook URL.
URL string `json:"url"`
// List of events.
Events []Event `json:"events"`
// Webhook request type.
// Enum: GET, POST.
RequestType string `json:"requestType"`
// Indicates whether webhook is active.
// Default: true.
IsActive *bool `json:"isActive,omitempty"`
// Indicates whether webhook batching is enabled.
// Default: false.
BatchingEnabled *bool `json:"batchingEnabled,omitempty"`
// Webhook content type.
// Enum: application/json, application/x-www-form-urlencoded, multipart/form-data.
// Default: application/json.
ContentType WebhookContentType `json:"contentType,omitempty"`
// Webhook headers.
Headers map[string]string `json:"headers,omitempty"`
// Custom webhook payload.
// For more details, see https://developer.crowdin.com/webhooks.
Payload any `json:"payload,omitempty"`
}
WebhookAddRequest defines the structure of the request when adding a new webhook.
func (*WebhookAddRequest) Validate ¶ added in v0.4.0
func (r *WebhookAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type WebhookContentType ¶ added in v0.4.0
type WebhookContentType string
ContentType is a type that represents the content type of a webhook.
const ( ContentTypeJSON WebhookContentType = "application/json" ContentTypeForm WebhookContentType = "application/x-www-form-urlencoded" ContentTypeMultipart WebhookContentType = "multipart/form-data" )
type WebhookResponse ¶ added in v0.4.0
type WebhookResponse struct {
Data *Webhook `json:"data"`
}
WebhookResponse defines the structure of the response when getting a single webhook.
type WebhooksListResponse ¶ added in v0.4.0
type WebhooksListResponse struct {
Data []*WebhookResponse `json:"data"`
}
WebhooksListResponse defines the structure of the response when getting a list of webhooks.
type WordAlignment ¶
WordAlignment represents a word alignments.
type WorkflowStep ¶ added in v0.4.0
type WorkflowStep struct {
ID int `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
Languages []string `json:"languages"`
Config map[string]any `json:"config"`
}
WorkflowStep represents a workflow step in a project.
type WorkflowStepResponse ¶ added in v0.4.0
type WorkflowStepResponse struct {
Data *WorkflowStep `json:"data"`
}
WorkflowStepResponse defines the structure of the response when getting a workflow step.
type WorkflowStepStringsListOptions ¶ added in v0.11.0
type WorkflowStepStringsListOptions struct {
// Filter progress by Language Identifiers.
LanguageIDs []string `json:"languageIds,omitempty"`
// Sort a list of strings.
// Enum: id, text, identifier, context, createdAt, updatedAt. Default: id.
// Example: orderBy=createdAt desc,text,identifier
OrderBy string `json:"orderBy,omitempty"`
// String status on the workflow step.
// Enum: todo, done, pending, incomplete, need_review.
Status string `json:"status,omitempty"`
ListOptions
}
WorkflowStepStringsListOptions specifies the optional parameters to the WorkflowsService.ListStepStrings method.
type WorkflowStepsResponse ¶ added in v0.4.0
type WorkflowStepsResponse struct {
Data []*WorkflowStepResponse `json:"data"`
}
WorkflowStepsResponse defines the structure of the response when getting a list of workflow steps.
type WorkflowTemplate ¶ added in v0.4.0
type WorkflowTemplate struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
GroupID int `json:"groupId"`
IsDefault bool `json:"isDefault"`
Steps []*WorkflowTemplateStep `json:"steps"`
WebURL string `json:"webUrl"`
}
WorkflowTemplate represents a workflow template in the organization.
type WorkflowTemplateResponse ¶ added in v0.4.0
type WorkflowTemplateResponse struct {
Data *WorkflowTemplate `json:"data"`
}
WorkflowTemplateResponse defines the structure of the response when getting a workflow template.
type WorkflowTemplateStep ¶ added in v0.4.0
type WorkflowTemplateStep struct {
// Workflow template step identifier.
ID int `json:"id,omitempty"`
// Target languages identifiers.
Languages []int `json:"languages,omitempty"`
// User identifiers.
Assignees []int `json:"assignees,omitempty"`
// Vendor identifier.
VendorID int `json:"vendorId,omitempty"`
// Workflow template step configuration.
Config WorkflowTemplateStepConfig `json:"config,omitempty"`
// Machine translation identifier.
MTID int `json:"mtId,omitempty"`
// Auto-translation prompt identifier (a prompt with the `pre_translate` action).
// Used when creating a project from a workflow template.
PromptID int `json:"promptId,omitempty"`
}
WorkflowTemplateStep represents a workflow step in a workflow template.
type WorkflowTemplateStepConfig ¶ added in v0.2.0
type WorkflowTemplateStepConfig struct {
// Minimum match for TM suggestions.
MinRelevant *int `json:"minRelevant,omitempty"`
// Improves TM suggestions.
AutoSubstitution *bool `json:"autoSubstitution,omitempty"`
// Approve added translations. Enum: all, perfectMatchOnly,
// exceptAutoSubstituted, perfectMatchApprovedOnly, none.
// Used when creating a project from a workflow template.
AutoApproveOption string `json:"autoApproveOption,omitempty"`
// Step assignees. Keys are language identifiers, values are user identifiers.
// Used when creating a project from a workflow template.
Assignees map[string][]int `json:"assignees,omitempty"`
// Step assigned teams. Keys are language identifiers, values are team identifiers.
// Used when creating a project from a workflow template.
AssignedTeams map[string][]int `json:"assignedTeams,omitempty"`
}
WorkflowTemplateStepConfig represents a workflow template step configuration.
type WorkflowTemplatesListOptions ¶ added in v0.4.0
type WorkflowTemplatesListOptions struct {
// Group identifier.
// Note: Set 0 to see items of root group.
GroupID *int `json:"groupId,omitempty"`
ListOptions
}
WorkflowTemplatesListOptions specifies the optional parameters to the WorkflowsService.ListTemplates method.
type WorkflowTemplatesListResponse ¶ added in v0.4.0
type WorkflowTemplatesListResponse struct {
Data []*WorkflowTemplateResponse `json:"data"`
}
WorkflowTemplatesListResponse defines the structure of the response when getting a list of workflow templates.
type XLIFFFileFormatSettings ¶ added in v0.19.0
type XLIFFFileFormatSettings struct{ CommonFileFormatSettings }
type XLSXFileFormatSettings ¶
type XLSXFileFormatSettings struct{ CommonFileFormatSettings }
type XMLFileFormatSettings ¶
type XMLFileFormatSettings struct {
// Defines whether to translate texts placed inside the tags. Default: true.
TranslateContent *bool `json:"translateContent,omitempty"`
// Defines whether to translate tags attributes. Default: true.
TranslateAttributes *bool `json:"translateAttributes,omitempty"`
// This is an array of strings, where each item is the XPaths to DOM element
// that should be imported. Default: []. Enum: "/path/to/node", "/path/to/attribute[@attr]",
// "//node", "//[@attr]", "nodeone/nodetwo", "/nodeone//nodetwo", "//node[@attr]"
TranslatableElements []string `json:"translatableElements,omitempty"`
// Defines whether to split long texts into smaller text segments. Default: true.
// Important! This option disables the possibility to upload existing translations for XML files when enabled.
ContentSegmentation *bool `json:"contentSegmentation,omitempty"`
// Storage Identifier of the SRX segmentation rules file. Default: null.
SRXStorageID *int `json:"srxStorageId,omitempty"`
// File format export pattern. Defines file name and path in resulting translations bundle.
// Default: null. Note: Can't contain : * ? " < > | symbols.
ExportPattern *string `json:"exportPattern,omitempty"`
// Specify the inline tags.
InlineTags []string `json:"inlineTags,omitempty"`
}
func (*XMLFileFormatSettings) ValidateSettings ¶
func (p *XMLFileFormatSettings) ValidateSettings() error
type XMLFileImportOptions ¶
type XMLFileImportOptions struct {
// Defines whether to translate texts placed inside the tags. Default: true.
TranslateContent *bool `json:"translateContent,omitempty"`
// Defines whether to translate tags attributes. Default: true.
TranslateAttributes *bool `json:"translateAttributes,omitempty"`
// Specify tags that should be considered inline.
InlineTags []string `json:"inlineTags,omitempty"`
// This is an array of strings, where each item is the XPaths to DOM element that should be imported.
TranslatableElements []string `json:"translatableElements,omitempty"`
// Important: ContentSegmentation option disables the possibility to upload existing translations
// for XML files when enabled.
CommonFileImportOptions
}
XMLFileImportOptions implements the FileImportOptions interface.
Source Files
¶
- advisors.go
- ai.go
- applications.go
- branches.go
- bundles.go
- clients.go
- custom_placeholders.go
- custom_spellcheckers.go
- dictionaries.go
- distributions.go
- errors.go
- external_qa_checks.go
- fields.go
- glossaries.go
- groups.go
- labels.go
- languages.go
- machine_translation_engines.go
- managers.go
- notifications.go
- organization.go
- pagination.go
- project_placeholders.go
- projects.go
- reports.go
- screenshot.go
- security_logs.go
- source_files.go
- source_strings.go
- storage.go
- string_comments.go
- string_corrections.go
- string_translations.go
- style_guides.go
- tasks.go
- teams.go
- translation_memory.go
- translation_status.go
- translations.go
- update.go
- users.go
- utils.go
- vendor.go
- webhooks.go
- workflows.go