crowdin

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPtr

func ToPtr[T any](v T) *T

ToPtr is a helper function that returns a pointer to the provided input.

Types

type AIService added in v0.5.0

type AIService struct {
	// contains filtered or unexported fields
}

AIService provides access to the AI related methods of the CrowdIn API.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/AI

func (*AIService) AddProvider added in v0.5.0

func (s *AIService) AddProvider(ctx context.Context, userID int, req *model.ProviderAddRequest) (*model.Provider, *Response, error)

AddProvider adds a new AI provider. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.post

func (*AIService) CreateFineTuningJob added in v0.12.0

func (s *AIService) CreateFineTuningJob(ctx context.Context, aiPromptID, userID int, req *model.FineTuningJobCreateRequest) (
	*model.FineTuningJob, *Response, error,
)

CreateFineTuningJob creates a new AI Prompt Fine-Tuning Job.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post

func (*AIService) CreateProxyChatCompletion added in v0.5.0

func (s *AIService) CreateProxyChatCompletion(ctx context.Context, providerID, userID int, req *model.CreateProxyChatCompletionRequest) (
	*model.ProxyChatCompletion, *Response, error,
)

CreateProxyChatCompletion creates a new chat completion.

This API method serves as an intermediary, forwarding your requests directly to the selected provider. Please refer to the documentation for the specific provider you use to determine the required payload format.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.chat.completions.post

func (*AIService) DeletePrompt added in v0.5.0

func (s *AIService) DeletePrompt(ctx context.Context, promptID, userID int) (*Response, error)

DeletePrompt deletes an existing AI prompt. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.delete

func (*AIService) DeleteProvider added in v0.5.0

func (s *AIService) DeleteProvider(ctx context.Context, providerID, userID int) (*Response, error)

DeleteProvider deletes an existing AI provider. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.delete

func (*AIService) DownloadFineTuningDataset added in v0.12.0

func (s *AIService) DownloadFineTuningDataset(ctx context.Context, aiPromptID int, jobIdentifier string, userID int) (
	*model.DownloadLink, *Response, error,
)

DownloadFineTuningDataset returns a download link for the AI Prompt Fine-Tuning Dataset.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.download.get

func (*AIService) EditPrompt added in v0.5.0

func (s *AIService) EditPrompt(ctx context.Context, promptID, userID int, req []*model.UpdateRequest) (*model.Prompt, *Response, error)

EditPrompt updates an existing AI prompt. For the Enterprise client, set the userID to 0.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string<json-pointer>): path to the field to update. Enum: "/name", "/action", "/aiProviderId", "/aiModelId", "/isEnabled", "/enabledProjectIds", "/config".
  • Value (any): new value to set.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.patch

func (*AIService) EditProvider added in v0.5.0

func (s *AIService) EditProvider(ctx context.Context, providerID, userID int, req []*model.UpdateRequest) (*model.Provider, *Response, error)

EditProvider updates an existing AI provider. For the Enterprise client, set the userID to 0.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string<json-pointer>): path to the field to update. Enum: "/name", "/type", "/credentials", "/config", "/isEnabled", "/useSystemCredentials".
  • Value (any): new value to set.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.patch

func (*AIService) GenerateFineTuningDataset added in v0.12.0

func (s *AIService) GenerateFineTuningDataset(ctx context.Context, aiPromptID, userID int, req *model.FineTuningDatasetAttributes) (
	*model.FineTuningDataset, *Response, error,
)

GenerateFineTuningDataset generates a new AI Prompt Fine-Tuning Dataset.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post

func (*AIService) GetFineTuningDatasetGenerationStatus added in v0.12.0

func (s *AIService) GetFineTuningDatasetGenerationStatus(ctx context.Context, aiPromptID int, jobIdentifier string, userID int) (
	*model.FineTuningDataset, *Response, error,
)

GetFineTuningDatasetGenerationStatus returns the status of the AI Prompt Fine-Tuning Dataset generation.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.get

func (*AIService) GetFineTuningJobStatus added in v0.12.0

func (s *AIService) GetFineTuningJobStatus(ctx context.Context, aiPromptID int, jobIdentifier string, userID int) (
	*model.FineTuningJob, *Response, error,
)

GetFineTuningJobStatus returns the status of the AI Prompt Fine-Tuning Job.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.jobs.get

func (*AIService) GetPrompt added in v0.5.0

func (s *AIService) GetPrompt(ctx context.Context, promptID, userID int) (*model.Prompt, *Response, error)

GetPrompt retrieves a single AI prompt. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.get

func (*AIService) GetProvider added in v0.5.0

func (s *AIService) GetProvider(ctx context.Context, providerID, userID int) (*model.Provider, *Response, error)

GetProvider returns a single AI provider. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.get

func (*AIService) ListFineTuningEvents added in v0.12.0

func (s *AIService) ListFineTuningEvents(ctx context.Context, aiPromptID int, jobIdentifier string, userID int) (
	[]*model.FineTuningEvent, *Response, error,
)

ListFineTuningEvents returns a list of AI Prompt Fine-Tuning Events.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.events.getMany

func (*AIService) ListFineTuningJobs added in v0.12.0

func (s *AIService) ListFineTuningJobs(ctx context.Context, userID int, opts *model.FineTuningJobsListOptions) (
	[]*model.FineTuningJob, *Response, error,
)

ListFineTuningJobs returns a list of AI Prompt Fine-Tuning Jobs.

https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.getMany

func (*AIService) ListPrompts added in v0.5.0

func (s *AIService) ListPrompts(ctx context.Context, userID int, opt *model.AIPromtsListOptions) ([]*model.Prompt, *Response, error)

ListPrompts returns a list of AI prompts. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.ai.prompts.getMany

func (*AIService) ListProviderModels added in v0.5.0

func (s *AIService) ListProviderModels(ctx context.Context, providerID, userID int) ([]*model.ProviderModel, *Response, error)

ListProviderModels returns a list of AI provider models. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.ai.providers.models.getMany

func (*AIService) ListProviders added in v0.5.0

func (s *AIService) ListProviders(ctx context.Context, userID int, opt *model.ListOptions) ([]*model.Provider, *Response, error)

ListProviders returns a list of AI providers. For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.ai.providers.getMany

type ApplicationsService added in v0.5.0

type ApplicationsService struct {
	// contains filtered or unexported fields
}

Crowdin Apps are web applications that can be integrated with Crowdin to extend its functionality.

Use the API to manage the necessary app data.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Applications

func (*ApplicationsService) AddData added in v0.5.0

func (s *ApplicationsService) AddData(ctx context.Context, applicationID, path string, req map[string]any) (
	any, *Response, error,
)

AddData adds application data.

https://developer.crowdin.com/api/v2/#operation/api.applications.api.post

func (*ApplicationsService) DeleteData added in v0.5.0

func (s *ApplicationsService) DeleteData(ctx context.Context, applicationID, path string) (*Response, error)

DeleteData deletes application data.

https://developer.crowdin.com/api/v2/#operation/api.applications.api.delete

func (*ApplicationsService) DeleteInstallation added in v0.5.0

func (s *ApplicationsService) DeleteInstallation(ctx context.Context, applicationID string, force bool) (*Response, error)

DeleteInstallation deletes an application installation.

id: application identifier
force: if true, force to delete application installation

https://developer.crowdin.com/api/v2/#operation/api.applications.installations.delete

func (*ApplicationsService) EditData added in v0.5.0

func (s *ApplicationsService) EditData(ctx context.Context, applicationID, path string, req map[string]any) (
	any, *Response, error,
)

EditData updates application data.

https://developer.crowdin.com/api/v2/#operation/api.applications.api.patch

func (*ApplicationsService) EditInstallation added in v0.5.0

func (s *ApplicationsService) EditInstallation(ctx context.Context, applicationID string, req []*model.UpdateRequest) (
	*model.Installation, *Response, error,
)

EditInstallation updates an application installation.

Request body:

  • op (string): operation to perform. Enum: replace.
  • path (string <json-pointer>): path to the field to update. Enum: "/permissions", "/modules/{moduleKey}/permissions".
  • value (model.InstallationReplaceValue): object with values to update.

https://developer.crowdin.com/api/v2/#operation/api.applications.installations.patch

func (*ApplicationsService) GetData added in v0.5.0

func (s *ApplicationsService) GetData(ctx context.Context, applicationID, path string) (any, *Response, error)

GetData returns application data.

https://developer.crowdin.com/api/v2/#operation/api.applications.api.get

func (*ApplicationsService) GetInstallation added in v0.5.0

func (s *ApplicationsService) GetInstallation(ctx context.Context, applicationID string) (*model.Installation, *Response, error)

GetInstallation returns information about an application installation.

https://developer.crowdin.com/api/v2/#operation/api.applications.installations.get

func (*ApplicationsService) Install added in v0.5.0

Install installs an application.

https://developer.crowdin.com/api/v2/#operation/api.applications.installations.post

func (*ApplicationsService) ListInstallations added in v0.5.0

func (s *ApplicationsService) ListInstallations(ctx context.Context, opt *model.ListOptions) ([]*model.Installation, *Response, error)

ListInstallations returns a list of application installations.

https://developer.crowdin.com/api/v2/#operation/api.applications.installations.getMany

func (*ApplicationsService) UpdateOrRestoreData added in v0.5.0

func (s *ApplicationsService) UpdateOrRestoreData(ctx context.Context, applicationID, path string, req map[string]any) (
	any, *Response, error,
)

UpdateOrRestoreData updates or restores application data.

https://developer.crowdin.com/api/v2/#operation/api.applications.api.put

type BranchesService

type BranchesService struct {
	// contains filtered or unexported fields
}

Source branches are resources for translation. Use API to manage project branches. Note: Make sure your master branch is the first one you integrate with Crowdin.

func (*BranchesService) Add

func (s *BranchesService) Add(ctx context.Context, projectID int, req *model.BranchesAddRequest) (
	*model.Branch, *Response, error,
)

Add creates a new project branch.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.post

func (*BranchesService) CheckCloneStatus

func (s *BranchesService) CheckCloneStatus(ctx context.Context, projectID, branchID int, cloneID string) (
	*model.BranchMerge, *Response, error,
)

CheckCloneStatus checks the status of a branch clone.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.clones.get

func (*BranchesService) CheckMergeStatus

func (s *BranchesService) CheckMergeStatus(ctx context.Context, projectID, branchID int, mergeID string) (
	*model.BranchMerge, *Response, error,
)

CheckMergeStatus checks the status of a branch merge.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.merges.get

func (*BranchesService) Clone

func (s *BranchesService) Clone(ctx context.Context, projectID, branchID int, req *model.BranchesCloneRequest) (
	*model.BranchMerge, *Response, error,
)

Clone clones a project branch. Note: Only the main branch (oldest branch) can be cloned.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.clones.post

func (*BranchesService) Delete

func (s *BranchesService) Delete(ctx context.Context, projectID, branchID int) (*Response, error)

Delete deletes a project branch.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.delete

func (*BranchesService) Edit

func (s *BranchesService) Edit(ctx context.Context, projectID, branchID int, req []*model.UpdateRequest) (
	*model.Branch, *Response, error,
)

Edit updates a project branch.

Request body: - op: The operation to perform. Enum: replace, test. - path: A JSON Pointer as defined in RFC 6901. Enum: "/name", "/title", "/exportPattern", "/priority". - value: The value to be used within the operations. The value must be one of string.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.patch

func (*BranchesService) Get

func (s *BranchesService) Get(ctx context.Context, projectID, branchID int) (*model.Branch, *Response, error)

Get returns a single project branch.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.get

func (*BranchesService) GetClone

func (s *BranchesService) GetClone(ctx context.Context, projectID, branchID int, cloneID string) (*model.Branch, *Response, error)

GetClone returns a cloned project branch.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.clones.branch.get

func (*BranchesService) GetMergeSummary

func (s *BranchesService) GetMergeSummary(ctx context.Context, projectID, branchID int, mergeID string) (
	*model.BranchMergeSummary, *Response, error,
)

GetMergeSummary returns a summary of a branch merge.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.merges.summary.get

func (*BranchesService) List

func (s *BranchesService) List(ctx context.Context, projectID int, opts *model.BranchesListOptions) (
	[]*model.Branch, *Response, error,
)

List returns a list of project branches.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.getMany

func (*BranchesService) Merge

func (s *BranchesService) Merge(ctx context.Context, projectID, branchID int, req *model.BranchesMergeRequest) (
	*model.BranchMerge, *Response, error,
)

Merge merges a project branch.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.branches.merges.post

type BundlesService added in v0.2.0

type BundlesService struct {
	// contains filtered or unexported fields
}

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Bundles

func (*BundlesService) Add added in v0.2.0

func (s *BundlesService) Add(ctx context.Context, projectID int, req *model.BundleAddRequest) (
	*model.Bundle, *Response, error,
)

Add creates a new bundle.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.post

func (*BundlesService) CheckExportStatus added in v0.2.0

func (s *BundlesService) CheckExportStatus(ctx context.Context, projectID, bundleID int, exportID string) (
	*model.BundleExport, *Response, error,
)

CheckExportStatus returns the status of the bundle export.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.get

func (*BundlesService) Delete added in v0.2.0

func (s *BundlesService) Delete(ctx context.Context, projectID, bundleID int) (*Response, error)

Delete removes the bundle.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.delete

func (*BundlesService) Download added in v0.2.0

func (s *BundlesService) Download(ctx context.Context, projectID, bundleID int, exportID string) (
	*model.DownloadLink, *Response, error,
)

Download returns a download link for the bundle.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.download.get

func (*BundlesService) Edit added in v0.2.0

func (s *BundlesService) Edit(ctx context.Context, projectID, bundleID int, req []*model.UpdateRequest) (
	*model.Bundle, *Response, error,
)

Edit updates the bundle.

Request body:

  • op: The operation to perform. Enum: replace, test.
  • path (json-pointer): A JSON Pointer as defined by RFC 6901. Enum: "/name", "/format", "/sourcePatterns", "/ignorePatterns", "/exportPattern", "/isMultilingual", "/labelIds", "/includeProjectSourceLanguage", "/excludeLabelIds".
  • value: The value to be used within the operations. The value must be string or integer.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.patch

func (*BundlesService) Export added in v0.2.0

func (s *BundlesService) Export(ctx context.Context, projectID, bundleID int) (
	*model.BundleExport, *Response, error,
)

Export starts the export process for the bundle.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.post

func (*BundlesService) Get added in v0.2.0

func (s *BundlesService) Get(ctx context.Context, projectID, bundleID int) (*model.Bundle, *Response, error)

Get returns the bundle by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.get

func (*BundlesService) List added in v0.2.0

func (s *BundlesService) List(ctx context.Context, projectID int, opts *model.ListOptions) (
	[]*model.Bundle, *Response, error,
)

List returns a list of bundles.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.getMany

func (*BundlesService) ListBranches added in v0.2.0

func (s *BundlesService) ListBranches(ctx context.Context, projectID, bundleID int, opts *model.ListOptions) (
	[]*model.Branch, *Response, error,
)

ListBranches returns a list of branches included in the bundle.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.bundles.branches.getMany

func (*BundlesService) ListFiles added in v0.2.0

func (s *BundlesService) ListFiles(ctx context.Context, projectID, bundleID int, opts *model.ListOptions) (
	[]*model.File, *Response, error,
)

ListFiles returns a list of files included in the bundle.

https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.files.getMany

type Client

type Client struct {
	GraphQL *GraphQL

	AI                        *AIService
	Applications              *ApplicationsService
	Branches                  *BranchesService
	Bundles                   *BundlesService
	Dictionaries              *DictionariesService
	Distributions             *DistributionsService
	Fields                    *FieldsService
	Groups                    *GroupsService
	Glossaries                *GlossariesService
	Labels                    *LabelsService
	Languages                 *LanguagesService
	MachineTranslationEngines *MachineTranslationEnginesService
	Notifications             *NotificationsService
	OrganizationWebhooks      *OrganizationWebhooksService
	Projects                  *ProjectsService
	Reports                   *ReportsService
	Screenshots               *ScreenshotsService
	SecurityLogs              *SecurityLogsService
	SourceFiles               *SourceFilesService
	SourceStrings             *SourceStringsService
	Storages                  *StorageService
	StringComments            *StringCommentsService
	StringTranslations        *StringTranslationsService
	Tasks                     *TasksService
	Teams                     *TeamsService
	TranslationMemory         *TranslationMemoryService
	TranslationStatus         *TranslationStatusService
	Translations              *TranslationsService
	Users                     *UsersService
	Vendors                   *VendorsService
	Webhooks                  *WebhooksService
	Workflows                 *WorkflowsService
	// contains filtered or unexported fields
}

Client is a Crowdin API client.

func NewClient

func NewClient(token string, opts ...ClientOption) (*Client, error)

NewClient creates a new Crowdin API client with provided options (ex. WithHTTPClient). `token` is a personal access token. To create a client, use the following code:

client, err := crowdin.NewClient("token")

To create an Enterprise client, use the WithOrganization() option as below:

client, err := crowdin.NewClient("token", crowdin.WithOrganization("organization"))

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, path string, v any) (*Response, error)

Delete makes a DELETE request to the specified path. If the provided parameter v is not nil, the result will be unmarshaled into it.

func (*Client) Get

func (c *Client) Get(ctx context.Context, path string, params ListOptionsProvider, v any) (*Response, error)

Get makes a GET request to the specified path.

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, path string, body, v any) (*Response, error)

Patch makes a PATCH request to the specified path.

func (*Client) Post

func (c *Client) Post(ctx context.Context, path string, body, v any, opts ...RequestOption) (*Response, error)

Post makes a POST request to the specified path.

func (*Client) Put

func (c *Client) Put(ctx context.Context, path string, body, v any) (*Response, error)

Put makes a PUT request to the specified path.

func (*Client) Upload added in v0.6.1

func (c *Client) Upload(ctx context.Context, path string, file io.Reader, v any, opts ...RequestOption) (*Response, error)

Upload makes a POST request to the specified path with a file.

type ClientOption

type ClientOption func(*Client) error

ClientOption is a client functional option.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) ClientOption

WithHTTPClient sets the custom HTTP client. If not set http.DefaultClient will be used.

func WithOrganization

func WithOrganization(organization string) ClientOption

WithOrganization sets the organization name.

type DictionariesService added in v0.4.0

type DictionariesService struct {
	// contains filtered or unexported fields
}

Dictionaries allow you to create a storage of words that should be skipped by the spell checker.

Use API to get the list of organization dictionaries and to edit a specific dictionary.

https://developer.crowdin.com/api/v2/#tag/Dictionaries

func (*DictionariesService) Edit added in v0.4.0

func (s *DictionariesService) Edit(ctx context.Context, projectID int, languageID string, req []*model.UpdateRequest) (
	*model.Dictionary, *Response, error,
)

Edit updates a specific dictionary.

Request body:

  • Op (string) - operation to perform. Enum: remove, add.
  • Path (string <json-pointer>) - a JSON Pointer as defined by RFC 6901. Value: "/words/{index}". To delete multiple words with one request, please specify the word indexes in reverse order.
  • Value (array) - value to set. Required for add operation.

https://developer.crowdin.com/api/v2/#operation/api.projects.dictionaries.patch

func (*DictionariesService) List added in v0.4.0

List returns a list of organization dictionaries.

https://developer.crowdin.com/api/v2/#tag/Dictionaries

type DistributionsService added in v0.4.0

type DistributionsService struct {
	// contains filtered or unexported fields
}

DistributionsService provides access to the Distributions API methods.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Distributions

func (*DistributionsService) Add added in v0.4.0

Add creates a new distribution.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.post

func (*DistributionsService) Delete added in v0.4.0

func (s *DistributionsService) Delete(ctx context.Context, projectID int, hash string) (*Response, error)

Delete removes a distribution from the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.delete

func (*DistributionsService) Edit added in v0.4.0

func (s *DistributionsService) Edit(ctx context.Context, projectID int, hash string, req []*model.UpdateRequest) (
	*model.Distribution, *Response, error,
)

Edit updates a distribution in the project.

Request body:

  • Op (string) - Operation to perform. Enum: replace.
  • Path (string) - JSON path to the field to update. Enum: "/exportMode", "/name", "/fileIds", "/bundleIds".
  • Value (string) - New alue to set.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.patch

func (*DistributionsService) Get added in v0.4.0

func (s *DistributionsService) Get(ctx context.Context, projectID int, hash string) (*model.Distribution, *Response, error)

Get returns information about a distribution.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.get

func (*DistributionsService) GetRelease added in v0.4.0

func (s *DistributionsService) GetRelease(ctx context.Context, projectID int, hash string) (
	*model.DistributionRelease, *Response, error,
)

GetRelease returns information about the distribution release.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.release.get

func (*DistributionsService) List added in v0.4.0

func (s *DistributionsService) List(ctx context.Context, projectID int, opts *model.ListOptions) (
	[]*model.Distribution, *Response, error,
)

List returns a list of distributions in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.getMany

func (*DistributionsService) Release added in v0.4.0

func (s *DistributionsService) Release(ctx context.Context, projectID int, hash string) (
	*model.DistributionRelease, *Response, error,
)

Release releases the distribution.

https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.release.post

type FieldsService added in v0.4.0

type FieldsService struct {
	// contains filtered or unexported fields
}

FieldsService provides access to the Fields API.

Crowdin API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Fields

func (*FieldsService) Add added in v0.4.0

Add creates a new field.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.fields.post

func (*FieldsService) Delete added in v0.4.0

func (s *FieldsService) Delete(ctx context.Context, fieldID int) (*Response, error)

Delete deletes a field.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.fields.delete

func (*FieldsService) Edit added in v0.4.0

func (s *FieldsService) Edit(ctx context.Context, fieldID int, req []*model.UpdateRequest) (*model.Field, *Response, error)

Edit updates a field.

Request body:

  • Op (string): operation to perform. Enum: replace.
  • Path (string <json-pointer>): path to the field to update. Enum: "/name", "/description", "/config", "/entities".
  • Value (string): new value to set.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.fields.patch

func (*FieldsService) Get added in v0.4.0

func (s *FieldsService) Get(ctx context.Context, fieldID int) (*model.Field, *Response, error)

Get returns a field by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.fields.get

func (*FieldsService) List added in v0.4.0

List returns a list of fields.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.fields.getMany

type GlossariesService added in v0.3.0

type GlossariesService struct {
	// contains filtered or unexported fields
}

Glossaries help to explain some specific terms or the ones often used in the project so that they can be properly and consistently translated.

Use API to manage glossaries or specific terms. Glossary export and import are asynchronous operations and shall be completed with sequence of API methods.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Glossaries

func (*GlossariesService) AddGlossary added in v0.3.0

AddGlossary creates a new glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.post

func (*GlossariesService) AddTerm added in v0.3.0

func (s *GlossariesService) AddTerm(ctx context.Context, glossaryID int, req *model.TermAddRequest) (
	*model.Term, *Response, error,
)

AddTerm adds a new term to a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.post

func (*GlossariesService) CheckGlossaryExportStatus added in v0.3.0

func (s *GlossariesService) CheckGlossaryExportStatus(ctx context.Context, glossaryID int, exportID string) (
	*model.GlossaryExport, *Response, error,
)

CheckGlossaryExportStatus returns the status of a glossary export.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.get

func (*GlossariesService) CheckGlossaryImportStatus added in v0.3.0

func (s *GlossariesService) CheckGlossaryImportStatus(ctx context.Context, glossaryID, importID int) (
	*model.GlossaryImport, *Response, error,
)

CheckGlossaryImportStatus returns the status of a glossary import.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.imports.get

func (*GlossariesService) ClearGlossary added in v0.3.0

func (s *GlossariesService) ClearGlossary(ctx context.Context, glossaryID int, opts *model.ClearGlossaryOptions) (
	*Response, error,
)

ClearGlossary deletes all terms from a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.deleteMany

func (*GlossariesService) ConcordanceSearch added in v0.3.0

func (s *GlossariesService) ConcordanceSearch(ctx context.Context, projectID int, req *model.GlossaryConcordanceSearchRequest) (
	[]*model.ConcordanceSearch, *Response, error,
)

ConcordanceSearch searches for concordance in the glossary.

https://developer.crowdin.com/api/v2/#operation/api.projects.glossaries.concordance.post

func (*GlossariesService) DeleteConcept added in v0.3.0

func (s *GlossariesService) DeleteConcept(ctx context.Context, glossaryID, conceptID int) (*Response, error)

DeleteConcept deletes a specific concept from a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.delete

func (*GlossariesService) DeleteGlossary added in v0.3.0

func (s *GlossariesService) DeleteGlossary(ctx context.Context, glossaryID int) (*Response, error)

DeleteGlossary deletes a specific glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.delete

func (*GlossariesService) DeleteTerm added in v0.3.0

func (s *GlossariesService) DeleteTerm(ctx context.Context, glossaryID, termID int) (*Response, error)

DeleteTerm deletes a specific term from a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.delete

func (*GlossariesService) DownloadGlossary added in v0.3.0

func (s *GlossariesService) DownloadGlossary(ctx context.Context, glossaryID int, exportID string) (
	*model.DownloadLink, *Response, error,
)

DownloadGlossary returns a download link for a glossary export.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.download.download

func (*GlossariesService) EditGlossary added in v0.3.0

func (s *GlossariesService) EditGlossary(ctx context.Context, glossaryID int, req []*model.UpdateRequest) (
	*model.Glossary, *Response, error,
)

EditGlossary updates a specific glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.patch

func (*GlossariesService) EditTerm added in v0.3.0

func (s *GlossariesService) EditTerm(ctx context.Context, glossaryID, termID int, req []*model.UpdateRequest) (
	*model.Term, *Response, error,
)

EditTerm updates a specific term.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.patch

func (*GlossariesService) ExportGlossary added in v0.3.0

func (s *GlossariesService) ExportGlossary(ctx context.Context, glossaryID int, req *model.GlossaryExportRequest) (
	*model.GlossaryExport, *Response, error,
)

ExportGlossary performs an export of a glossary. The export operation is asynchronous and returns the status of the export process.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.exports.post

func (*GlossariesService) GetConcept added in v0.3.0

func (s *GlossariesService) GetConcept(ctx context.Context, glossaryID, conceptID int) (
	*model.Concept, *Response, error,
)

GetConcept returns a specific concept from a glossary by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.get

func (*GlossariesService) GetGlossary added in v0.3.0

func (s *GlossariesService) GetGlossary(ctx context.Context, glossaryID int) (*model.Glossary, *Response, error)

GetGlossary returns a specific glossary by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.get

func (*GlossariesService) GetTerm added in v0.3.0

func (s *GlossariesService) GetTerm(ctx context.Context, glossaryID, termID int) (
	*model.Term, *Response, error,
)

GetTerm returns a specific term from a glossary by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.get

func (*GlossariesService) ImportGlossary added in v0.3.0

func (s *GlossariesService) ImportGlossary(ctx context.Context, glossaryID int, req *model.GlossaryImportRequest) (
	*model.GlossaryImport, *Response, error,
)

ImportGlossary performs an import of a glossary. The import operation is asynchronous and returns the status of the import process.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.imports.post

func (*GlossariesService) ListConcepts added in v0.3.0

func (s *GlossariesService) ListConcepts(ctx context.Context, glossaryID int, opts *model.ConceptsListOptions) (
	[]*model.Concept, *Response, error,
)

ListConcepts returns a list of concepts from a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.getMany

func (*GlossariesService) ListGlossaries added in v0.3.0

func (s *GlossariesService) ListGlossaries(ctx context.Context, opts *model.GlossariesListOptions) (
	[]*model.Glossary, *Response, error,
)

ListGlossaries returns a list of glossaries.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.getMany

func (*GlossariesService) ListTerms added in v0.3.0

func (s *GlossariesService) ListTerms(ctx context.Context, glossaryID int, opts *model.TermsListOptions) (
	[]*model.Term, *Response, error,
)

ListTerms returns a list of terms from a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.terms.getMany

func (*GlossariesService) UpdateConcept added in v0.3.0

func (s *GlossariesService) UpdateConcept(ctx context.Context, glossaryID, conceptID int, req *model.ConceptUpdateRequest) (
	*model.Concept, *Response, error,
)

UpdateConcept updates a specific concept in a glossary.

https://developer.crowdin.com/api/v2/#operation/api.glossaries.concepts.put

type GraphQL added in v0.10.0

type GraphQL struct {
	// contains filtered or unexported fields
}

func (*GraphQL) NewRequest added in v0.10.0

func (g *GraphQL) NewRequest(query string) *Request

NewRequest creates a new GraphQL request with the given query.

func (*GraphQL) Query added in v0.10.0

func (g *GraphQL) Query(ctx context.Context, req *Request, v any) error

Query sends a request to the GraphQL server with the given query and then unmarshals the response into the given v which should be a pointer.

type GroupsService

type GroupsService struct {
	// contains filtered or unexported fields
}

Groups allow you to organize your projects based on specific characteristics. Use API to manage projects and groups, change their settings, or remove them from organization if required.

Crowdin API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Projects-and-Groups

func (*GroupsService) Delete

func (s *GroupsService) Delete(ctx context.Context, id int) (*Response, error)

Delete removes a group from the organization.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.delete

func (*GroupsService) Edit

func (s *GroupsService) Edit(ctx context.Context, id int, req []*model.UpdateRequest) (*model.Group, *Response, error)

Edit updates a group.

Request body:

  • op: The operation to perform. Enum: replace, test.
  • path: A JSON Pointer as defined in RFC 6901. Enum: "/name", "/description", "/parentId".
  • value: The value to be used within the operations. The value must be one of string or integer.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.patch

func (*GroupsService) Get

func (s *GroupsService) Get(ctx context.Context, id int) (*model.Group, *Response, error)

Get returns a group by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.get

type LabelsService added in v0.2.0

type LabelsService struct {
	// contains filtered or unexported fields
}

LabelsService provides access to the Labels API.

Crowdin API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Labels

func (*LabelsService) Add added in v0.2.0

func (s *LabelsService) Add(ctx context.Context, projectID int, req *model.LabelAddRequest) (
	*model.Label, *Response, error,
)

Add creates a new label in the project.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.post

func (*LabelsService) AssignToScreenshots added in v0.2.0

func (s *LabelsService) AssignToScreenshots(ctx context.Context, projectID, labelID int, screenshotIDs []int) (
	[]*model.Screenshot, *Response, error,
)

AssignToScreenshots assigns label to screenshots and returns a list of screenshots which the label was assigned to. Note: You can assign up to 500 screenshots at a time.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.screenshots.post

func (*LabelsService) AssignToStrings added in v0.2.0

func (s *LabelsService) AssignToStrings(ctx context.Context, projectID, labelID int, stringIDs []int) (
	[]*model.SourceString, *Response, error,
)

AssignToStrings assigns label to strings and returns a list of strings which the label was assigned to. Note: You can assign up to 500 strings at a time.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.strings.post

func (*LabelsService) Delete added in v0.2.0

func (s *LabelsService) Delete(ctx context.Context, projectID, labelID int) (*Response, error)

Delete removes a label by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.delete

func (*LabelsService) Edit added in v0.2.0

func (s *LabelsService) Edit(ctx context.Context, projectID, labelID int, req []*model.UpdateRequest) (
	*model.Label, *Response, error,
)

Edit updates a label by its identifier.

Request body: - op - operation to perform with the label. Enum: replace, test. - path (json-pointer) - path to the field to update. Enum: "/title". - value (string) - new value for the field. Must be a string.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.patch

func (*LabelsService) Get added in v0.2.0

func (s *LabelsService) Get(ctx context.Context, projectID, labelID int) (*model.Label, *Response, error)

Get returns a label by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.get

func (*LabelsService) List added in v0.2.0

func (s *LabelsService) List(ctx context.Context, projectID int, opts *model.LabelsListOptions) (
	[]*model.Label, *Response, error,
)

List returns a list of labels in the project.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.getMany

func (*LabelsService) UnassignFromScreenshots added in v0.2.0

func (s *LabelsService) UnassignFromScreenshots(ctx context.Context, projectID, labelID int, screenshotIDs []int) (
	[]*model.Screenshot, *Response, error,
)

UnassignFromScreenshots unassigns label from screenshots and returns a list of screenshots which the label was unassigned from. Note: You can unassign up to 500 screenshots at a time.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.screenshots.deleteMany

func (*LabelsService) UnassignFromStrings added in v0.2.0

func (s *LabelsService) UnassignFromStrings(ctx context.Context, projectID, labelID int, stringIDs []int) (
	[]*model.SourceString, *Response, error,
)

UnassignFromStrings unassigns label from strings and returns a list of strings which the label was unassigned from. Note: You can unassign up to 500 strings at a time.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.labels.strings.deleteMany

type LanguagesService

type LanguagesService struct {
	// contains filtered or unexported fields
}

Crowdin supports more than 300 world languages and custom languages created in the system. Use API to get the list of all supported languages and retrieve additional details (e.g. text direction, internal code) on specific language.

https://developer.crowdin.com/api/v2/#tag/Languages

func (*LanguagesService) Add

Add adds a new custom language.

https://developer.crowdin.com/api/v2/#operation/api.languages.post

func (*LanguagesService) Delete

func (s *LanguagesService) Delete(ctx context.Context, id string) (*Response, error)

Delete deletes a custom language by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.languages.delete

func (*LanguagesService) Edit

Edit updates a custom language by its identifier.

Request body:

  • op: The operation to perform. Enum: replace, test
  • path: A JSON Pointer as defined in RFC 6901. Enum: "/name" "/textDirection" "/pluralCategoryNames" "/threeLettersCode" "/localeCode" "/dialectOf"
  • value: The value to be used within the operations. The value must be one of string or array of strings.

https://developer.crowdin.com/api/v2/#operation/api.languages.patch

func (*LanguagesService) Get

Get returns a language by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.languages.get

func (*LanguagesService) List

List returns a list of all supported languages.

https://developer.crowdin.com/api/v2/#operation/api.languages.getMany

type ListOptionsProvider

type ListOptionsProvider interface {
	Values() (url.Values, bool)
}

ListOptionsProvider interface provides query parameters for list methods. The Values method returns the url.Values representation of the optional query parameters and a boolean indicating whether they are set.

type MachineTranslationEnginesService added in v0.3.0

type MachineTranslationEnginesService struct {
	// contains filtered or unexported fields
}

Machine Translation Engines (MTE) are the sources for pre-translations. You can currently connect Google Translate, Microsoft Translator, Translate, DeepL Pro and Amazon Translate engines.

Use API to add, update, and delete specific MTE.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Machine-Translation-Engines

func (*MachineTranslationEnginesService) AddMT added in v0.3.0

AddMT creates a new machine translation.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.mts.post

func (*MachineTranslationEnginesService) DeleteMT added in v0.3.0

DeleteMT removes an existing machine translation.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.mts.delete

func (*MachineTranslationEnginesService) EditMT added in v0.3.0

EditMT updates an existing machine translation.

Request body:

  • op (string): Operation to perform. Possible values: replace, test.
  • path (string): Path to the field to update (a JSON Pointer as defined by RFC 6901). Enum: /name, /type, /credentials, /enabledLanguageIds, /enabledProjectIds, /isEnabled.
  • value (any): New value for the field. Value must be one of string or object.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.mts.patch

func (*MachineTranslationEnginesService) GetMT added in v0.3.0

GetMT returns a specific machine translation by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.mts.get

func (*MachineTranslationEnginesService) ListMT added in v0.3.0

ListMT returns a list of all machine translations.

https://developer.crowdin.com/api/v2/#operation/api.mts.getMany

func (*MachineTranslationEnginesService) Translate added in v0.3.0

Translate translates strings using a specific MTE.

https://developer.crowdin.com/api/v2/#operation/api.mts.translations.post

type NotificationsService added in v0.5.0

type NotificationsService struct {
	// contains filtered or unexported fields
}

NotificationsService provides access to the Notifications API methods.

func (*NotificationsService) Notify added in v0.5.0

Notify sends a notification to authenticated user or organization members.

To send a notification to an authenticated user, pass the request body with the `Message`. To send a notification to organization members, pass the request body with the `Message` and `UserIDs` or `Role`.

Send a notification to an authenticated user.

&model.Notification{
	Message: "notification message",
}

Send a notification to organization members by user IDs (for enterprise client).

&model.Notification{
	UserIDs: []int{1, 2, 3},
	Message: "notification message",
}

Send a notification to organization members by role (for enterprise client).

&model.Notification{
	Role:    "owner",
	Message: "notification message",
}

https://developer.crowdin.com/enterprise/api/v2/#operation/api.notify.post

func (*NotificationsService) NotifyProjectMembers added in v0.5.0

func (s *NotificationsService) NotifyProjectMembers(ctx context.Context, projectID int, req *model.Notification) (
	*Response, error,
)

NotifyProjectMembers sends a notification to project members.

The request body can be either by user IDs or by role. To send by user IDs, pass the request body with the `UserIDs` and `Message`. To send by role, pass the request body with the `Role` and `Message`.

https://developer.crowdin.com/api/v2/#operation/api.projects.notify.post

type OrganizationWebhooksService added in v0.4.0

type OrganizationWebhooksService struct {
	// contains filtered or unexported fields
}

Webhooks allow to collect information about events that happen in your Crowdin account. It is possible to select request type, content type, and add custom payload, which allows to create integrations with other systems on your own.

Webhooks can be configured for the following events:

  • Project is created
  • Project is deleted

Use API to create, modify, and delete specific webhooks.

CrowdIn API docs: https://developer.crowdin.com/api/v2/#tag/Organization-Webhooks

func (*OrganizationWebhooksService) Add added in v0.4.0

Add creates a new webhook.

https://developer.crowdin.com/api/v2/#operation/api.webhooks.post

func (*OrganizationWebhooksService) Delete added in v0.4.0

func (s *OrganizationWebhooksService) Delete(ctx context.Context, organizationWebhookID int) (*Response, error)

Delete removes a webhook.

https://developer.crowdin.com/api/v2/#operation/api.webhooks.delete

func (*OrganizationWebhooksService) Edit added in v0.4.0

func (s *OrganizationWebhooksService) Edit(ctx context.Context, organizationWebhookID int, req []*model.UpdateRequest) (
	*model.Webhook, *Response, error,
)

Edit modifies a webhook.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string <json-pointer>): a JSON Pointer to the target location. Enum: "/name", "/url", "/isActive", "/batchingEnabled", "/contentType", "/events", "/headers", "/requestType", "/payload".
  • Value (any): new value to set.

https://developer.crowdin.com/api/v2/#operation/api.webhooks.patch

func (*OrganizationWebhooksService) Get added in v0.4.0

func (s *OrganizationWebhooksService) Get(ctx context.Context, organizationWebhookID int) (*model.Webhook, *Response, error)

Get returns a specific webhook for an organization.

https://developer.crowdin.com/api/v2/#operation/api.webhooks.get

func (*OrganizationWebhooksService) List added in v0.4.0

List returns a list of webhooks for an organization.

https://developer.crowdin.com/api/v2/#operation/api.webhooks.getMany

type ProjectsService

type ProjectsService struct {
	// contains filtered or unexported fields
}

Using projects, you can keep your source files sorted. Use API to manage projects, change their settings, or remove them if required.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Projects

func (*ProjectsService) AddFileFormatSettings

AddFileFormatSettings adds a new project file format settings by its project identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.post

func (*ProjectsService) AddStringsExporterSettings

AddStringsExporterSettings adds a new project strings exporter settings by its project identifier.

Request body:

format: Enum: "android", "macosx", "xliff"
settings: One of convertPlaceholders, languagePairMapping

https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.post

func (*ProjectsService) Delete

func (s *ProjectsService) Delete(ctx context.Context, id int) (*Response, error)

Delete deletes a project by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.delete

func (*ProjectsService) DeleteFileFormatSettings

func (s *ProjectsService) DeleteFileFormatSettings(ctx context.Context, projectID, settingsID int) (*Response, error)

DeleteFileFormatSettings deletes a project file format settings by project and file format settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.delete

func (*ProjectsService) DeleteStringsExporterSettings

func (s *ProjectsService) DeleteStringsExporterSettings(ctx context.Context, projectID, settingsID int) (*Response, error)

DeleteStringsExporterSettings deletes a project strings exporter settings by project and strings exporter settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.delete

func (*ProjectsService) DownloadFileFormatSettingsCustomSegmentation

func (s *ProjectsService) DownloadFileFormatSettingsCustomSegmentation(ctx context.Context, projectID, settingsID int) (
	*model.DownloadLink, *Response, error,
)

DownloadFileFormatSettingsCustomSegmentation returns a download link for custom segmentations by project and file format settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.get

func (*ProjectsService) Edit

Edit updates a project by its identifier.

Request body:

  • op: The operation to perform. Enum: add, replace, remove, test
  • path: A JSON Pointer as defined in RFC 6901.
  • value: The value to be used within the operations. The value must be one of string, integer, boolean and object

https://developer.crowdin.com/api/v2/#operation/api.projects.patch

func (*ProjectsService) EditFileFormatSettings

func (s *ProjectsService) EditFileFormatSettings(ctx context.Context, projectID, settingsID int, req []*model.UpdateRequest) (
	*model.ProjectsFileFormatSettings, *Response, error,
)

EditFileFormatSettings updates a project file format settings by project and file format settings identifiers.

Request body:

  • op: The operation to perform. Possible values: replace, test
  • path: A JSON Pointer as defined in RFC 6901. Possible values: /format, /settings
  • value: The value to be used within the operations. The value must be one of string or array of strings.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.patch

func (*ProjectsService) EditStringsExporterSettings

func (s *ProjectsService) EditStringsExporterSettings(
	ctx context.Context,
	projectID, settingsID int,
	req *model.ProjectsStringsExporterSettingsRequest,
) (*model.ProjectsStringsExporterSettings, *Response, error,
)

EditStringsExporterSettings updates a project strings exporter settings by project and strings exporter settings identifiers.

Request body:

format: Enum: "android", "macosx", "xliff"
settings: One of convertPlaceholders, languagePairMapping

https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.patch

func (*ProjectsService) Get

func (s *ProjectsService) Get(ctx context.Context, id int) (*model.Project, *Response, error)

Get returns a project by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.get

func (*ProjectsService) GetFileFormatSettings

func (s *ProjectsService) GetFileFormatSettings(ctx context.Context, projectID, settingsID int) (
	*model.ProjectsFileFormatSettings, *Response, error,
)

GetFileFormatSettings returns a project file format settings by project and file format settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.get

func (*ProjectsService) GetStringsExporterSettings

func (s *ProjectsService) GetStringsExporterSettings(ctx context.Context, projectID, settingsID int) (
	*model.ProjectsStringsExporterSettings, *Response, error,
)

GetStringsExporterSettings returns a project strings exporter settings by project and strings exporter settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.get

func (*ProjectsService) List

List returns a list of projects.

https://developer.crowdin.com/api/v2/#operation/api.projects.getMany

func (*ProjectsService) ListFileFormatSettings

func (s *ProjectsService) ListFileFormatSettings(ctx context.Context, projectID int) (
	[]*model.ProjectsFileFormatSettings, *Response, error,
)

ListFileFormatSettings returns a list of project file format settings by project identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.getMany

func (*ProjectsService) ListStringsExporterSettings

func (s *ProjectsService) ListStringsExporterSettings(ctx context.Context, projectID int) (
	[]*model.ProjectsStringsExporterSettings, *Response, error,
)

ListStringsExporterSettings returns a list of project strings exporter settings by project identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings-exporter-settings.getMany

func (*ProjectsService) ResetFileFormatSettingsCustomSegmentation

func (s *ProjectsService) ResetFileFormatSettingsCustomSegmentation(ctx context.Context, projectID, settingsID int) (*Response, error)

ResetFileFormatSettingsCustomSegmentation resets custom segmentations by project and file format settings identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.file-format-settings.custom-segmentations.delete

type ReportsService added in v0.4.0

type ReportsService struct {
	// contains filtered or unexported fields
}

Reports help to estimate costs, calculate translation costs, and identify the top members.

Use API to generate Cost Estimate, Translation Cost, and Top Members reports. You can then export reports in .xlsx or .csv file formats. Report generation is an asynchronous operation and shall be completed with a sequence of API methods.

API docs: https://developer.crowdin.com/api/v2/#tag/Reports

func (*ReportsService) AddSettingsTemplate added in v0.4.0

func (s *ReportsService) AddSettingsTemplate(ctx context.Context, projectID int, req *model.ReportSettingsTemplateAddRequest) (
	*model.ReportSettingsTemplate, *Response, error,
)

AddSettingsTemplate creates a new report settings template.

For the Enterprise client, set the projectID to 0.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.settings-templates.post

func (*ReportsService) AddUserSettingsTemplate added in v0.14.0

func (s *ReportsService) AddUserSettingsTemplate(ctx context.Context, userID int, req *model.ReportSettingsTemplateAddRequest) (
	*model.ReportSettingsTemplate, *Response, error,
)

AddUserSettingsTemplate creates a new user report settings template.

https://support.crowdin.com/developer/api/v2/#tag/Reports/operation/api.users.reports.settings-templates.post

func (*ReportsService) CheckArchiveExportStatus added in v0.4.0

func (s *ReportsService) CheckArchiveExportStatus(ctx context.Context, userID, archiveID int, exportID string) (
	*model.ReportStatus, *Response, error,
)

CheckArchiveExportStatus returns the status of the report archive export.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.reports.archives.exports.get

func (*ReportsService) CheckGroupReportStatus added in v0.4.0

func (s *ReportsService) CheckGroupReportStatus(ctx context.Context, groupID int, reportID string) (
	*model.ReportStatus, *Response, error,
)

CheckGroupReportStatus returns the status of the group report generation.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.reports.get

func (*ReportsService) CheckOrganizationReportStatus added in v0.4.0

func (s *ReportsService) CheckOrganizationReportStatus(ctx context.Context, reportID string) (*model.ReportStatus, *Response, error)

CheckOrganizationReportStatus returns the status of the organization report generation.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.reports.get

func (*ReportsService) CheckStatus added in v0.4.0

func (s *ReportsService) CheckStatus(ctx context.Context, projectID int, reportID string) (
	*model.ReportStatus, *Response, error,
)

CheckStatus returns the status of the report generation.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.get

func (*ReportsService) DeleteArchive added in v0.4.0

func (s *ReportsService) DeleteArchive(ctx context.Context, userID, archiveID int) (*Response, error)

DeleteArchive deletes a report archive by its identifier.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.reports.archives.delete

func (*ReportsService) DeleteSettingsTemplate added in v0.4.0

func (s *ReportsService) DeleteSettingsTemplate(ctx context.Context, projectID, settingsTemplateID int) (*Response, error)

DeleteSettingsTemplate removes a report settings template.

For the Enterprise client, set the projectID to 0.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.settings-templates.delete

func (*ReportsService) DeleteUserSettingsTemplate added in v0.14.0

func (s *ReportsService) DeleteUserSettingsTemplate(ctx context.Context, userID, settingsTemplateID int) (*Response, error)

DeleteUserSettingsTemplate removes a user report settings template. https://support.crowdin.com/developer/api/v2/#tag/Reports/operation/api.users.reports.settings-templates.delete

func (*ReportsService) Download added in v0.4.0

func (s *ReportsService) Download(ctx context.Context, projectID int, reportID string) (
	*model.DownloadLink, *Response, error,
)

Download returns a download link for the report.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.download.download

func (*ReportsService) DownloadArchive added in v0.4.0

func (s *ReportsService) DownloadArchive(ctx context.Context, userID, archiveID int, exportID string) (
	*model.DownloadLink, *Response, error,
)

DownloadArchive returns a download link for the report archive.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.reports.archives.exports.download.get

func (*ReportsService) DownloadGroupReport added in v0.4.0

func (s *ReportsService) DownloadGroupReport(ctx context.Context, groupID int, reportID string) (
	*model.DownloadLink, *Response, error,
)

DownloadGroupReport returns a download link for the group report.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.reports.download.download

func (*ReportsService) DownloadOrganizationReport added in v0.4.0

func (s *ReportsService) DownloadOrganizationReport(ctx context.Context, reportID string) (*model.DownloadLink, *Response, error)

DownloadOrganizationReport returns a download link for the organization report.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.reports.download.download

func (*ReportsService) EditSettingsTemplate added in v0.4.0

func (s *ReportsService) EditSettingsTemplate(ctx context.Context, projectID, settingsTemplateID int, req []*model.UpdateRequest) (
	*model.ReportSettingsTemplate, *Response, error,
)

EditSettingsTemplate updates a report settings template.

For the Enterprise client, set the projectID to 0.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string <json-pointer>): path to the field to update. Enum: "/name", "/currency", "/unit", "/mode", "/config", "/isPublic".
  • Value (any): new value to set.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.settings-templates.patch

func (*ReportsService) EditUserSettingsTemplate added in v0.14.0

func (s *ReportsService) EditUserSettingsTemplate(ctx context.Context, userID, settingsTemplateID int, req []*model.UpdateRequest) (
	*model.ReportSettingsTemplate, *Response, error,
)

EditUserSettingsTemplate updates a user report settings template.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string <json-pointer>): path to the field to update. Enum: "/name", "/currency", "/unit", "/config".
  • Value (string|int): new value to set.

https://support.crowdin.com/developer/api/v2/#tag/Reports/operation/api.users.reports.settings-templates.patch

func (*ReportsService) ExportArchive added in v0.4.0

func (s *ReportsService) ExportArchive(ctx context.Context, userID, archiveID int, req *model.ExportReportArchiveRequest) (
	*model.ReportStatus, *Response, error,
)

ExportArchive exports a report archive in the specified file format. If no format is provided, the default format is XLSX.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.reports.archives.exports.post

func (*ReportsService) Generate added in v0.4.0

func (s *ReportsService) Generate(ctx context.Context, projectID int, req *model.ReportGenerateRequest) (
	*model.ReportStatus, *Response, error,
)

Generate generates a new report.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.post

func (*ReportsService) GenerateGroupReport added in v0.4.0

func (s *ReportsService) GenerateGroupReport(ctx context.Context, groupID int, req *model.GroupReportGenerateRequest) (
	*model.ReportStatus, *Response, error,
)

GenerateGroupReport generates a new group report.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.groups.reports.post

func (*ReportsService) GenerateOrganizationReport added in v0.4.0

func (s *ReportsService) GenerateOrganizationReport(ctx context.Context, req *model.GroupReportGenerateRequest) (
	*model.ReportStatus, *Response, error,
)

GenerateOrganizationReport generates a new organization report.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.reports.post

func (*ReportsService) GetArchive added in v0.4.0

func (s *ReportsService) GetArchive(ctx context.Context, userID, archiveID int) (*model.ReportArchive, *Response, error)

GetArchive returns a report archive by its identifier.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.users.reports.archives.get

func (*ReportsService) GetSettingsTemplate added in v0.4.0

func (s *ReportsService) GetSettingsTemplate(ctx context.Context, projectID, settingsTemplateID int) (
	*model.ReportSettingsTemplate, *Response, error,
)

GetSettingsTemplate returns a report settings template by its identifier.

For the Enterprise client, set the projectID to 0.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.settings-templates.get

func (*ReportsService) GetUserSettingsTemplate added in v0.14.0

func (s *ReportsService) GetUserSettingsTemplate(ctx context.Context, userID, settingsTemplateID int) (
	*model.ReportSettingsTemplate, *Response, error,
)

GetUserSettingsTemplate returns a user report settings template by its identifier.

https://support.crowdin.com/developer/api/v2/#tag/Reports/operation/api.users.reports.settings-templates.get

func (*ReportsService) ListArchives added in v0.4.0

func (s *ReportsService) ListArchives(ctx context.Context, userID int, opts *model.ReportArchivesListOptions) (
	[]*model.ReportArchive, *Response, error,
)

ListArchives returns a list of report archives.

For the Enterprise client, set the userID to 0.

https://developer.crowdin.com/api/v2/#operation/api.reports.archives.getMany

func (*ReportsService) ListSettingsTemplates added in v0.4.0

func (s *ReportsService) ListSettingsTemplates(ctx context.Context, projectID int, opts *model.ReportSettingsTemplatesListOptions) (
	[]*model.ReportSettingsTemplate, *Response, error,
)

ListSettingsTemplates returns a list of report settings templates.

For the Enterprise client, set the projectID to 0.

https://developer.crowdin.com/api/v2/#operation/api.projects.reports.settings-templates.getMany

func (*ReportsService) ListUserSettingsTemplates added in v0.14.0

func (s *ReportsService) ListUserSettingsTemplates(ctx context.Context, userID int, opts *model.ListOptions) (
	[]*model.ReportSettingsTemplate, *Response, error,
)

ListUserSettingsTemplates returns a list of user report settings templates.

https://support.crowdin.com/developer/api/v2/#tag/Reports/operation/api.users.reports.settings-templates.getMany

type Request added in v0.10.0

type Request struct {
	// contains filtered or unexported fields
}

Request represents a GraphQL request.

func (*Request) Operation added in v0.10.0

func (r *Request) Operation(name string)

Operation sets the operation name for the request.

func (*Request) Var added in v0.10.0

func (r *Request) Var(name string, value any)

Var adds a variable to the request.

type RequestOption

type RequestOption func(*http.Request) error

RequestOption represents an option that can be used to modify a http.Request.

func Header(key, value string) RequestOption

Header sets a header as an option for the request.

type RequestValidator

type RequestValidator interface {
	Validate() error
}

RequestValidator is an interface for validating requests.

type Response

type Response struct {
	*http.Response

	Pagination model.Pagination
}

Response is a Crowdin response that wraps http.Response.

type ScreenshotsService added in v0.2.0

type ScreenshotsService struct {
	// contains filtered or unexported fields
}

Screenshots provide translators with additional context for the source strings. Screenshot tags allow specifying which source strings are displayed on each screenshot.

Use API to manage screenshots and their tags.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Screenshots

func (*ScreenshotsService) AddScreenshot added in v0.2.0

func (s *ScreenshotsService) AddScreenshot(ctx context.Context, projectID int, req *model.ScreenshotAddRequest) (
	*model.Screenshot, *Response, error,
)

AddScreenshot adds a new screenshot to the project.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.screenshots.post

func (*ScreenshotsService) AddTag added in v0.2.0

func (s *ScreenshotsService) AddTag(ctx context.Context, projectID, screenshotID int, req *model.TagAddRequest) (
	*model.Tag, *Response, error,
)

AddTag adds a new tag to the screenshot.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.post

func (*ScreenshotsService) AutoTag added in v0.2.0

func (s *ScreenshotsService) AutoTag(ctx context.Context, projectID, screenshotID int, req *model.AutoTagRequest) (
	*Response, error,
)

AutoTag automatically tags the screenshot with the source strings that are displayed on it.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.putMany

func (*ScreenshotsService) ClearTags added in v0.2.0

func (s *ScreenshotsService) ClearTags(ctx context.Context, projectID, screenshotID int) (*Response, error)

ClearTags deletes all tags from the screenshot.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.deleteMany

func (*ScreenshotsService) DeleteScreenshot added in v0.2.0

func (s *ScreenshotsService) DeleteScreenshot(ctx context.Context, projectID, screenshotID int) (*Response, error)

DeleteScreenshot deletes a specific screenshot by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.screenshots.delete

func (*ScreenshotsService) DeleteTag added in v0.2.0

func (s *ScreenshotsService) DeleteTag(ctx context.Context, projectID, screenshotID, tagID int) (*Response, error)

DeleteTag deletes a specific tag by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.delete

func (*ScreenshotsService) EditScreenshot added in v0.2.0

func (s *ScreenshotsService) EditScreenshot(ctx context.Context, projectID, screenshotID int, req []*model.UpdateRequest) (
	*model.Screenshot, *Response, error,
)

EditScreenshot edit a specific screenshot by its identifier.

Request body:

  • op (string): Operation to perform with the screenshot. Enum: replace, test
  • path (string <json-pointer>): JSON path to the field that needs to be updated (RFC 6901). Enum: "/name", "labelIds"
  • value (string): New value for the field. Must be a string.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.screenshots.patch

func (*ScreenshotsService) EditTag added in v0.2.0

func (s *ScreenshotsService) EditTag(ctx context.Context, projectID, screenshotID, tagID int, req []*model.UpdateRequest) (
	*model.Tag, *Response, error,
)

EditTag edit a specific tag by its identifier.

Request body:

  • op (string): Operation to perform with the tag. Enum: replace, test
  • path (string <json-pointer>): JSON path to the field that needs to be updated (RFC 6901). Enum: "/stringId", "/position"
  • value (string or int): New value for the field. Must be a string or int.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.patch

func (*ScreenshotsService) GetScreenshot added in v0.2.0

func (s *ScreenshotsService) GetScreenshot(ctx context.Context, projectID, screenshotID int) (
	*model.Screenshot, *Response, error,
)

GetScreenshot returns a specific screenshot by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.get

func (*ScreenshotsService) GetTag added in v0.2.0

func (s *ScreenshotsService) GetTag(ctx context.Context, projectID, screenshotID, tagID int) (
	*model.Tag, *Response, error,
)

GetTag returns a specific tag by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.screenshots.tags.get

func (*ScreenshotsService) ListScreenshots added in v0.2.0

func (s *ScreenshotsService) ListScreenshots(ctx context.Context, projectID int, opts *model.ScreenshotListOptions) (
	[]*model.Screenshot, *Response, error,
)

ListScreenshots returns a list of all screenshots in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.getMany

func (*ScreenshotsService) ListTags added in v0.2.0

func (s *ScreenshotsService) ListTags(ctx context.Context, projectID, screenshotID int, opts *model.ListOptions) (
	[]*model.Tag, *Response, error,
)

ListTags returns a list of all tags for the screenshot.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.getMany

func (*ScreenshotsService) ReplaceTags added in v0.2.0

func (s *ScreenshotsService) ReplaceTags(ctx context.Context, projectID, screenshotID int, req []*model.ReplaceTagsRequest) (
	*Response, error,
)

ReplaceTags replaces all tags on the screenshot.

https://developer.crowdin.com/api/v2/#operation/api.projects.screenshots.tags.putMany

func (*ScreenshotsService) UpdateScreenshot added in v0.2.0

func (s *ScreenshotsService) UpdateScreenshot(ctx context.Context, projectID, screenshotID int, req *model.ScreenshotUpdateRequest) (
	*model.Screenshot, *Response, error,
)

UpdateScreenshot updates a specific screenshot by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.screenshots.put

type SecurityLogsService added in v0.4.0

type SecurityLogsService struct {
	// contains filtered or unexported fields
}

SecurityLogsService provides access to the Security Logs API methods.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Security-Logs

func (*SecurityLogsService) GetUserLog added in v0.4.0

func (s *SecurityLogsService) GetUserLog(ctx context.Context, userID, logID int) (*model.SecurityLog, *Response, error)

https://developer.crowdin.com/api/v2/#operation/api.users.security-logs.get

type SourceFilesService

type SourceFilesService struct {
	// contains filtered or unexported fields
}

Source files are resources for translation. You can keep files structure using folders or manage different versions of the content via branches. Use API to keep the source files up to date, check on file revisions, and manage project branches. Before adding source files to the project, upload each file to the Storage first.

Note: If you use branches, make sure your master branch is the first one you integrate with Crowdin.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Source-Files

func (*SourceFilesService) AddDirectory

func (s *SourceFilesService) AddDirectory(ctx context.Context, projectID int, req *model.DirectoryAddRequest) (
	*model.Directory, *Response, error,
)

AddDirectory creates a new directory in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.post

func (*SourceFilesService) AddFile

func (s *SourceFilesService) AddFile(ctx context.Context, projectID int, req *model.FileAddRequest) (
	*model.File, *Response, error,
)

AddFile adds a new file to the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.post

func (*SourceFilesService) BuildReviewedFiles

func (s *SourceFilesService) BuildReviewedFiles(ctx context.Context, projectID int, req *model.ReviewedBuildRequest) (
	*model.ReviewedBuild, *Response, error,
)

BuildReviewedFiles starts a new build of reviewed source files.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.post

func (*SourceFilesService) CheckReviewedBuildStatus

func (s *SourceFilesService) CheckReviewedBuildStatus(ctx context.Context, projectID, buildID int) (*model.ReviewedBuild, *Response, error)

CheckReviewedBuildStatus checks the status of a specific reviewed source files build.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.get

func (*SourceFilesService) DeleteDirectory

func (s *SourceFilesService) DeleteDirectory(ctx context.Context, projectID, directoryID int) (*Response, error)

DeleteDirectory deletes a directory in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.delete

func (*SourceFilesService) DeleteFile

func (s *SourceFilesService) DeleteFile(ctx context.Context, projectID, fileID int) (*Response, error)

DeleteFile deletes a file in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.delete

func (*SourceFilesService) DownloadFile

func (s *SourceFilesService) DownloadFile(ctx context.Context, projectID, fileID int) (*model.DownloadLink, *Response, error)

DownloadFile returns a download link for a specific file.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.download.get

func (*SourceFilesService) DownloadFilePreview

func (s *SourceFilesService) DownloadFilePreview(ctx context.Context, projectID, fileID int) (*model.DownloadLink, *Response, error)

DownloadFilePreview returns a download link for a specific file preview.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.preview.get

func (*SourceFilesService) DownloadReviewedBuild

func (s *SourceFilesService) DownloadReviewedBuild(ctx context.Context, projectID, buildID int) (*model.DownloadLink, *Response, error)

DownloadReviewedBuild returns a download link for a specific reviewed source files build.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.download.download

func (*SourceFilesService) EditDirectory

func (s *SourceFilesService) EditDirectory(ctx context.Context, projectID, directoryID int, req []*model.UpdateRequest) (
	*model.Directory, *Response, error,
)

EditDirectory updates a directory in the project.

Request body:

  • op: The operation to perform. Enum: replace, test.
  • path: A JSON Pointer as defined in RFC 6901. Enum: "/branchId", "/directoryId", "/name", "/title", "/exportPattern", "/priority".
  • value: The value to be used within the operations. The value must be one of string or integer.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.patch

func (*SourceFilesService) EditFile

func (s *SourceFilesService) EditFile(ctx context.Context, projectID, fileID int, req []*model.UpdateRequest) (
	*model.File, *Response, error,
)

EditFile updates a file in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.patch

func (*SourceFilesService) GetDirectory

func (s *SourceFilesService) GetDirectory(ctx context.Context, projectID, directoryID int) (*model.Directory, *Response, error)

GetDirectory returns a single directory in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.get

func (*SourceFilesService) GetFile

func (s *SourceFilesService) GetFile(ctx context.Context, projectID, fileID int) (*model.File, *Response, error)

GetFile returns a single file in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.get

func (*SourceFilesService) GetFileRevision

func (s *SourceFilesService) GetFileRevision(ctx context.Context, projectID, fileID, revisionID int) (*model.FileRevision, *Response, error)

GetFileRevision returns a single file revision.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.revisions.get

func (*SourceFilesService) ListDirectories

func (s *SourceFilesService) ListDirectories(ctx context.Context, projectID int, opts *model.DirectoryListOptions) (
	[]*model.Directory, *Response, error,
)

ListDirectories returns a list of directories in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.getMany

func (*SourceFilesService) ListFileRevisions

func (s *SourceFilesService) ListFileRevisions(ctx context.Context, projectID, fileID int, opts *model.ListOptions) (
	[]*model.FileRevision, *Response, error,
)

ListFileRevisions returns a list of file revisions.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.revisions.getMany

func (*SourceFilesService) ListFiles

func (s *SourceFilesService) ListFiles(ctx context.Context, projectID int, opts *model.FileListOptions) (
	[]*model.File, *Response, error,
)

ListFiles returns a list of files in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.getMany

func (*SourceFilesService) ListReviewedBuilds

func (s *SourceFilesService) ListReviewedBuilds(ctx context.Context, projectID int, opts *model.ReviewedBuildListOptions) (
	[]*model.ReviewedBuild, *Response, error,
)

ListReviewedBuilds returns a list of reviewed source files builds.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.strings.reviewed-builds.getMany

func (*SourceFilesService) UpdateOrRestoreFile

func (s *SourceFilesService) UpdateOrRestoreFile(ctx context.Context, projectID, fileID int, req *model.FileUpdateRestoreRequest) (
	*model.File, *Response, error,
)

UpdateOrRestoreFile updates a file in the project or restores it to one of the previous revisions. For updating the file, use the `storageId` body parameter. For restoring the file, use the `revisionId` body parameter.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.put

type SourceStringsService

type SourceStringsService struct {
	// contains filtered or unexported fields
}

Source strings are the text units for translation. Instead of modifying source files, you can manage source strings one by one. Use API to add, edit, or delete some specific strings in the source-based and files-based projects (available only for the following file formats: CSV, RESX, JSON, Android XML, iOS strings, PROPERTIES, XLIFF).

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Source-Strings

func (*SourceStringsService) BatchOperations

func (s *SourceStringsService) BatchOperations(ctx context.Context, projectID int, req []*model.UpdateRequest) (
	[]*model.SourceString, *Response, error,
)

BatchOperations allows performing multiple operations on source strings.

Request body:

  • op: The operation to perform. Enum: add, replace, remove
  • path: A JSON Pointer as defined in RFC 6901. Enum: "/{stringId}/identifier", "/{stringId}/text", "/{stringId}/context", "/{stringId}/isHidden", "/{stringId}/maxLength", "/{stringId}/labelIds"
  • value: The value to be used within the operations. The value must be one of string, integer, boolean or map

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.batchPatch

func (*SourceStringsService) Delete

func (s *SourceStringsService) Delete(ctx context.Context, projectID, stringID int) (*Response, error)

Delete removes a specific string by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.delete

func (*SourceStringsService) Edit

func (s *SourceStringsService) Edit(ctx context.Context, projectID, stringID int, req []*model.UpdateRequest) (
	*model.SourceString, *Response, error,
)

Edit updates a specific string by its identifier.

Request body:

  • op: The operation to perform. Enum: replace, test
  • path: A JSON Pointer as defined in RFC 6901. Enum: "/identifier", "/text", "/context", "/isHidden" "/maxLength" "/labelIds"
  • value: The value to be used within the operations. The value must be one of string, integer, boolean or object

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.patch

func (*SourceStringsService) Get

func (s *SourceStringsService) Get(ctx context.Context, projectID, stringID int, opts *model.SourceStringsGetOptions) (
	*model.SourceString, *Response, error,
)

Get returns a specific source string by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.get

func (*SourceStringsService) GetUploadStatus

func (s *SourceStringsService) GetUploadStatus(ctx context.Context, projectID int, uploadID string) (
	*model.SourceStringsUpload, *Response, error,
)

GetUploadStatus returns the status of the uploaded strings.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.strings.uploads.get

func (*SourceStringsService) List

List returns a list of source strings. Use optional parameters to filter the list.

https://developer.crowdin.com/api/v2/#operation/api.projects.strings.getMany

type StorageService

type StorageService struct {
	// contains filtered or unexported fields
}

Storages is a separate container for each file. You need to use Add method before adding files to your projects via API. Files that should be uploaded into storage include files for localization, screenshots, Glossaries, and Translation Memories. Storage `id` is the identifier of the file uploaded to the Storage.

Note: Files uploaded to the storage are kept during the next 24 hours.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Storage

func (*StorageService) Add

func (s *StorageService) Add(ctx context.Context, file *os.File) (*model.Storage, *Response, error)

Add adds a new file to the storage.

`file` is the file to be uploaded. It should be an os.File. ZIP files are not supported.

https://developer.crowdin.com/api/v2/#operation/api.storages.post

func (*StorageService) Delete

func (s *StorageService) Delete(ctx context.Context, id int) (*Response, error)

Delete deletes a file from the storage by its identifier. https://developer.crowdin.com/api/v2/#operation/api.storages.delete

func (*StorageService) Get

func (s *StorageService) Get(ctx context.Context, id int) (*model.Storage, *Response, error)

Get returns a file in the storage by its identifier. https://developer.crowdin.com/api/v2/#operation/api.storages.get

func (*StorageService) List

List returns a list of storages. opts (model.ListOptions) can be used to control pagination. If nil, default values will be used.

limit: A maximum number of items to retrieve (default 25, max 500).
offset: A starting offset in the collection of items (default 0).

https://developer.crowdin.com/api/v2/#operation/api.storages.getMany

type StringCommentsService added in v0.2.0

type StringCommentsService struct {
	// contains filtered or unexported fields
}

Use API to list, add, edit or remove string comments.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/String-Comments

func (*StringCommentsService) Add added in v0.2.0

Add creates a new string comment.

https://developer.crowdin.com/api/v2/#operation/api.projects.comments.post

func (*StringCommentsService) Delete added in v0.2.0

func (s *StringCommentsService) Delete(ctx context.Context, projectID, commentID int) (*Response, error)

Delete removes a string comment.

https://developer.crowdin.com/api/v2/#operation/api.projects.comments.delete

func (*StringCommentsService) Edit added in v0.2.0

func (s *StringCommentsService) Edit(ctx context.Context, projectID, commentID int, req []*model.UpdateRequest) (
	*model.StringComment, *Response, error,
)

Edit updates a string comment.

Request body:

  • op: The operation to perform. Enum: replace, test.
  • path: A JSON Pointer as defined by RFC 6901. Enum: "/text", "/issueStatus".
  • value: The value to be used within the operations. The value must be string.

https://developer.crowdin.com/api/v2/#operation/api.projects.comments.patch

func (*StringCommentsService) Get added in v0.2.0

func (s *StringCommentsService) Get(ctx context.Context, projectID, commentID int) (
	*model.StringComment, *Response, error,
)

Get returns a string comment by its ID.

https://developer.crowdin.com/api/v2/#operation/api.projects.comments.post

func (*StringCommentsService) List added in v0.2.0

List returns a list of string comments.

https://developer.crowdin.com/api/v2/#operation/api.projects.comments.getMany

type StringTranslationsService

type StringTranslationsService struct {
	// contains filtered or unexported fields
}

Use API to add or remove strings translations, approvals, and votes.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/String-Translations

func (*StringTranslationsService) AddApproval

func (s *StringTranslationsService) AddApproval(ctx context.Context, projectID, translationID int) (
	*model.Approval, *Response, error,
)

AddApproval adds a new translation approval.

https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.post

func (*StringTranslationsService) AddTranslation

func (s *StringTranslationsService) AddTranslation(ctx context.Context, projectID int, req *model.TranslationAddRequest) (
	*model.Translation, *Response, error,
)

AddTranslation adds a new string translation.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.post

func (*StringTranslationsService) AddVote

func (s *StringTranslationsService) AddVote(ctx context.Context, projectID int, req *model.VoteAddRequest) (
	*model.Vote, *Response, error,
)

AddVote adds a vote for a translation.

https://developer.crowdin.com/api/v2/#operation/api.projects.votes.post

func (*StringTranslationsService) CancelVote

func (s *StringTranslationsService) CancelVote(ctx context.Context, projectID, voteID int) (*Response, error)

CancelVote cancels a vote for a translation by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.votes.delete

func (*StringTranslationsService) DeleteStringTranslations

func (s *StringTranslationsService) DeleteStringTranslations(ctx context.Context, projectID, stringID int, languageID *string) (
	*Response, error,
)

DeleteStringTranslations deletes string translations by its identifiers.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.deleteMany

func (*StringTranslationsService) DeleteTranslation

func (s *StringTranslationsService) DeleteTranslation(ctx context.Context, projectID, translationID int) (*Response, error)

DeleteTranslation deletes a translation by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.delete

func (*StringTranslationsService) GetApproval

func (s *StringTranslationsService) GetApproval(ctx context.Context, projectID, approvalID int) (*model.Approval, *Response, error)

GetApproval returns a single translation approval by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.get

func (*StringTranslationsService) GetTranslation

func (s *StringTranslationsService) GetTranslation(ctx context.Context, projectID, translationID int, opts *model.TranslationGetOptions) (
	*model.Translation, *Response, error,
)

GetTranslation returns a single string translation by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.get

func (*StringTranslationsService) GetVote

func (s *StringTranslationsService) GetVote(ctx context.Context, projectID, voteID int) (*model.Vote, *Response, error)

GetVote gets a single translation vote by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.votes.get

func (*StringTranslationsService) ListApprovals

func (s *StringTranslationsService) ListApprovals(ctx context.Context, projectID int, opts *model.ApprovalsListOptions) (
	[]*model.Approval, *Response, error,
)

ListApprovals returns a list of translation approvals.

https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.getMany

func (*StringTranslationsService) ListLanguageTranslations

func (s *StringTranslationsService) ListLanguageTranslations(
	ctx context.Context,
	projectID int,
	languageID string,
	opts *model.LanguageTranslationsListOptions) (
	[]*model.LanguageTranslation, *Response, error,
)

ListLanguageTranslations returns a list of translations for a specific language.

Note: For instant translation delivery to your mobile, web, server, or desktop apps, it is recommended to use OTA.

https://developer.crowdin.com/api/v2/#operation/api.projects.languages.translations.getMany

func (*StringTranslationsService) ListStringTranslations

func (s *StringTranslationsService) ListStringTranslations(ctx context.Context, projectID int, opts *model.StringTranslationsListOptions) (
	[]*model.Translation, *Response, error,
)

ListStringTranslations returns a list of string translations.

Note: For instant translation delivery to your mobile, web, server, or desktop apps, it is recommended to use OTA.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.getMany

func (*StringTranslationsService) ListVotes

func (s *StringTranslationsService) ListVotes(ctx context.Context, projectID int, opts *model.VotesListOptions) (
	[]*model.Vote, *Response, error,
)

ListVotes lists translation votes.

Note: Either `translationId` OR `fileId` OR `labelIds` OR `excludeLabelIds` with `languageId` OR `stringId` with `languageId` are required

https://developer.crowdin.com/api/v2/#operation/api.projects.votes.getMany

func (*StringTranslationsService) RemoveApproval

func (s *StringTranslationsService) RemoveApproval(ctx context.Context, projectID, approvalID int) (*Response, error)

RemoveApproval removes a translation approval by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.delete

func (*StringTranslationsService) RemoveStringApprovals added in v0.8.0

func (s *StringTranslationsService) RemoveStringApprovals(ctx context.Context, projectID, stringID int) (*Response, error)

RemoveStringApprovals removes translation approvals by its string identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.approvals.deleteMany

func (*StringTranslationsService) RestoreTranslation

func (s *StringTranslationsService) RestoreTranslation(ctx context.Context, projectID, translationID int) (
	*model.Translation, *Response, error,
)

RestoreTranslation restores a translation by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.put

func (*StringTranslationsService) TranslationAlignment

TranslationAlignment aligns translations.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.alignment.post

type TasksService added in v0.3.0

type TasksService struct {
	// contains filtered or unexported fields
}

Create and assign tasks to get files translated or proofread by specific people. You can set the due dates, split words between people, and receive notifications about the changes and updates on tasks. Tasks are project-specific, so you’ll have to create them within a project.

Use API to create, modify, and delete specific tasks.

API docs: https://developer.crowdin.com/api/v2/#tag/Tasks

func (*TasksService) Add added in v0.3.0

func (s *TasksService) Add(ctx context.Context, projectID int, req model.TaskAddRequester) (*model.Task, *Response, error)

Add creates a new task in a project.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.post

func (*TasksService) AddSettingsTemplate added in v0.3.0

func (s *TasksService) AddSettingsTemplate(ctx context.Context, projectID int, req *model.TaskSettingsTemplateAddRequest) (
	*model.TaskSettingsTemplate, *Response, error,
)

AddSettingsTemplate creates a new task settings template in a project.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.tasks.settings-templates.post

func (*TasksService) Delete added in v0.3.0

func (s *TasksService) Delete(ctx context.Context, projectID, taskID int) (*Response, error)

Delete removes a task from a project by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.delete

func (*TasksService) DeleteSettingsTemplate added in v0.3.0

func (s *TasksService) DeleteSettingsTemplate(ctx context.Context, projectID, taskSettingTemplateID int) (*Response, error)

DeleteSettingsTemplate removes a task settings template from a project by its identifier.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.tasks.settings-templates.delete

func (*TasksService) Edit added in v0.3.0

func (s *TasksService) Edit(ctx context.Context, projectID, taskID int, req []*model.UpdateRequest) (*model.Task, *Response, error)

Edit updates a task in a project by its identifier.

Request body (one of the following): 1. TaskOperation

  • op (string): Operation to perform. Enum: replace, test.
  • path (string <json-pointer>): JSON path to the field to be updated. Enum: "/status", "/title", "/description", "/deadline", "/startedAt", "/resolvedAt", "/splitFiles", "/splitContent", "/fileIds", "/stringIds", "/assignees", "/dateFrom", "/dateTo", "/labelIds", "/excludeLabelIds".
  • value (any): Value to be set. Enum: string, bool, array of integers, array of objects.

2. VendorTaskOperation

  • op (string): Operation to perform. Enum: replace, test.
  • path (string <json-pointer>): JSON path to the field to be updated. Enum: "/title", "/description", "/sttaus".
  • value (any): Value to be set. Enum: string, bool, array of integers, array of objects.

3. PendingTaskOperation

  • op (string): Operation to perform. Enum: replace, test.
  • path (string <json-pointer>): JSON path to the field to be updated. Enum: "/title", "/description", "/assignees", "/deadline".
  • value (any): Value to be set. Enum: string, bool, array of integers, array of objects.

4. VendorPendingTaskOperation

  • op (string): Operation to perform. Enum: replace, test.
  • path (string <json-pointer>): JSON path to the field to be updated. Enum: "/title", "/description".
  • value (any): Value to be set. Enum: string, bool, array of integers, array of objects.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.patch

func (*TasksService) EditArchivedStatus added in v0.3.0

func (s *TasksService) EditArchivedStatus(ctx context.Context, projectID, taskID int, req []*model.UpdateRequest) (
	*model.Task, *Response, error,
)

EditArchivedStatus changes the archived status of the task.

Request body: - op (string): Operation to perform. Enum: replace. - path (string <json-pointer>): JSON path to the field to be updated. Enum: "/isArchived". - value (bool): Value to be set. Enum: true - archive task, false - move a task from archived to a list of all tasks

https://developer.crowdin.com/api/v2/#operation/api.user.tasks.patch

func (*TasksService) EditSettingsTemplate added in v0.3.0

func (s *TasksService) EditSettingsTemplate(ctx context.Context, projectID, taskSettingTemplateID int, req []*model.UpdateRequest) (
	*model.TaskSettingsTemplate, *Response, error,
)

EditSettingsTemplate updates a task settings template in a project by its identifier.

Request body: - op (string): Operation to perform. Enum: replace, test. - path (string <json-pointer>): JSON path to the field to be updated. Enum: "/name", "/config". - value (string|int): Value to be set. Enum: string, integer.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.tasks.settings-templates.patch

func (*TasksService) ExportStrings added in v0.3.0

func (s *TasksService) ExportStrings(ctx context.Context, projectID, taskID int) (*model.DownloadLink, *Response, error)

ExportStrings returns a download link.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.exports.post

func (*TasksService) Get added in v0.3.0

func (s *TasksService) Get(ctx context.Context, projectID, taskID int) (*model.Task, *Response, error)

Get returns a single task in a project by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.get

func (*TasksService) GetSettingsTemplate added in v0.3.0

func (s *TasksService) GetSettingsTemplate(ctx context.Context, projectID, taskSettingTemplateID int) (
	*model.TaskSettingsTemplate, *Response, error,
)

GetSettingsTemplate returns a single task settings template in a project by its identifier.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.tasks.settings-templates.get

func (*TasksService) List added in v0.3.0

func (s *TasksService) List(ctx context.Context, projectID int, opts *model.TasksListOptions) ([]*model.Task, *Response, error)

List returns a list of tasks in a project.

https://developer.crowdin.com/api/v2/#operation/api.projects.tasks.getMany

func (*TasksService) ListSettingsTemplates added in v0.3.0

func (s *TasksService) ListSettingsTemplates(ctx context.Context, projectID int, opts *model.ListOptions) (
	[]*model.TaskSettingsTemplate, *Response, error,
)

ListSettingsTemplates returns a list of task settings templates in a project.

https://developer.crowdin.com/api/v2/string-based/#operation/api.projects.tasks.settings-templates.getMany

func (*TasksService) ListUserTasks added in v0.3.0

func (s *TasksService) ListUserTasks(ctx context.Context, opts *model.UserTasksListOptions) ([]*model.Task, *Response, error)

ListUserTasks returns a list of tasks assigned to the user.

https://developer.crowdin.com/api/v2/#operation/api.user.tasks.getMany

type TeamsService added in v0.4.0

type TeamsService struct {
	// contains filtered or unexported fields
}

TeamsService provides access to the organizaion teams API.

CrowdIn API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Teams

func (*TeamsService) Add added in v0.4.0

Add creates a new team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.post

func (*TeamsService) AddMember added in v0.4.0

func (s *TeamsService) AddMember(ctx context.Context, teamID int, req *model.TeamMemberAddRequest) (
	map[string][]*model.TeamMember, *Response, error,
)

AddMember adds a new member to the team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.members.post

func (*TeamsService) AddToProject added in v0.4.0

func (s *TeamsService) AddToProject(ctx context.Context, projectID int, req *model.ProjectTeamAddRequest) (
	map[string]*model.ProjectTeam, *Response, error,
)

AddToProject adds a team to the project.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.teams.post

func (*TeamsService) Delete added in v0.4.0

func (s *TeamsService) Delete(ctx context.Context, teamID int) (*Response, error)

Delete removes a team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.delete

func (*TeamsService) DeleteMember added in v0.4.0

func (s *TeamsService) DeleteMember(ctx context.Context, teamID, memberID int) (*Response, error)

DeleteMember removes a member from the team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.members.delete

func (*TeamsService) DeleteMembers added in v0.4.0

func (s *TeamsService) DeleteMembers(ctx context.Context, teamID int) (*Response, error)

DeleteMembers deletes all members from the team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.members.deleteMany

func (*TeamsService) Edit added in v0.4.0

func (s *TeamsService) Edit(ctx context.Context, teamID int, req []*model.UpdateRequest) (*model.Team, *Response, error)

Edit updates a team.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.patch

func (*TeamsService) Get added in v0.4.0

func (s *TeamsService) Get(ctx context.Context, teamID int) (*model.Team, *Response, error)

Get returns a team by its identifier.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.get

func (*TeamsService) List added in v0.4.0

List returns a list of teams in the organization.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.getMany

func (*TeamsService) ListMembers added in v0.4.0

func (s *TeamsService) ListMembers(ctx context.Context, teamID int, opts *model.ListOptions) (
	[]*model.TeamMember, *Response, error,
)

ListMembers returns a list of team members.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.teams.members.getMany

type TranslationMemoryService added in v0.3.0

type TranslationMemoryService struct {
	// contains filtered or unexported fields
}

Translation Memory (TM) is a vault of translations that were previously made in other projects. Those translations can be reused to speed up the translation process. Every translation made in the project is automatically added to the project Translation Memory.

Use API to create, upload, download, or remove specific TM. Translation Memory export and import are asynchronous operations and shall be completed with sequence of API methods.

func (*TranslationMemoryService) AddTM added in v0.3.0

AddTM creates a new translation memory.

https://developer.crowdin.com/api/v2/#operation/api.tms.post

func (*TranslationMemoryService) CheckTMExportStatus added in v0.3.0

func (s *TranslationMemoryService) CheckTMExportStatus(ctx context.Context, tmID int, exportID string) (
	*model.TranslationMemoryExport, *Response, error,
)

CheckTMExportStatus returns the status of a specific translation memory export.

https://developer.crowdin.com/api/v2/#operation/api.tms.exports.get

func (*TranslationMemoryService) CheckTMImportStatus added in v0.3.0

func (s *TranslationMemoryService) CheckTMImportStatus(ctx context.Context, tmID int, importID string) (
	*model.TranslationMemoryImport, *Response, error,
)

CheckTMImportStatus returns the status of a specific translation memory import.

https://developer.crowdin.com/api/v2/#operation/api.tms.imports.get

func (*TranslationMemoryService) ClearTM added in v0.3.0

func (s *TranslationMemoryService) ClearTM(ctx context.Context, tmID int) (*Response, error)

ClearTM removes all segments from a specific translation memory.

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.clear

func (*TranslationMemoryService) ConcordanceSearch added in v0.3.0

ConcordanceSearch searches for concordance in a translation memory.

https://developer.crowdin.com/api/v2/#operation/api.projects.tms.concordance.post

func (*TranslationMemoryService) CreateTMSegment added in v0.3.0

CreateTMSegment creates a new translation memory segment.

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.post

func (*TranslationMemoryService) DeleteTM added in v0.3.0

func (s *TranslationMemoryService) DeleteTM(ctx context.Context, tmID int) (*Response, error)

DeleteTM removes a specific translation memory by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.tms.delete

func (*TranslationMemoryService) DeleteTMSegment added in v0.3.0

func (s *TranslationMemoryService) DeleteTMSegment(ctx context.Context, tmID, segmentID int) (*Response, error)

DeleteTMSegment removes a specific translation memory segment by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.delete

func (*TranslationMemoryService) DownloadTM added in v0.3.0

func (s *TranslationMemoryService) DownloadTM(ctx context.Context, tmID int, exportID string) (
	*model.DownloadLink, *Response, error,
)

DownloadTM returns a download link for a specific translation memory export.

https://developer.crowdin.com/api/v2/#operation/api.tms.exports.download.download

func (*TranslationMemoryService) EditTM added in v0.3.0

EditTM updates a specific translation memory by its identifier.

Request body: - op (string): Operation to perform. Enum: replace, test. - path (string): JSON Pointer to the field to update as defined in RFC 6901. - value (string): Value to set.

https://developer.crowdin.com/api/v2/#operation/api.tms.patch

func (*TranslationMemoryService) EditTMSegment added in v0.3.0

func (s *TranslationMemoryService) EditTMSegment(ctx context.Context, tmID, segmentID int, req []*model.UpdateRequest) (
	*model.TMSegment, *Response, error,
)

EditTMSegment updates a specific translation memory segment by its identifier.

Request body: 1. TMSegmentRecordOperationAdd: Add a new record to the segment.

  • op (string): Value: "add".
  • path (string): "/records/-".
  • value (object): Possible fields: text, languageId. Example: {"text":"string","languageId":"string"}

2. TMSegmentRecordOperationReplace: Replace the text of a specific record.

  • op (string): Value: "replace".
  • path (string): "/records/{recordId}/text".
  • value (string): Value to set.

3. TMSegmentRecordOperationRemove: Remove a specific record.

  • op (string): Value: "remove".
  • path (string): "/records/{recordId}".

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.patch

func (*TranslationMemoryService) ExportTM added in v0.3.0

ExportTM creates a new translation memory export.

https://developer.crowdin.com/api/v2/#operation/api.tms.exports.post

func (*TranslationMemoryService) GetTM added in v0.3.0

GetTM returns a specific translation memory by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.tms.get

func (*TranslationMemoryService) GetTMSegment added in v0.3.0

func (s *TranslationMemoryService) GetTMSegment(ctx context.Context, tmID, segmentID int) (
	*model.TMSegment, *Response, error,
)

GetTMSegment returns a specific translation memory segment by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.get

func (*TranslationMemoryService) ImportTM added in v0.3.0

ImportTM creates a new translation memory import.

https://developer.crowdin.com/api/v2/#operation/api.tms.imports.post

func (*TranslationMemoryService) ListTMSegments added in v0.3.0

func (s *TranslationMemoryService) ListTMSegments(ctx context.Context, tmID int, opts *model.TMSegmentsListOptions) (
	[]*model.TMSegment, *Response, error,
)

ListTMSegments returns a list of translation memory segments.

https://developer.crowdin.com/api/v2/#operation/api.tms.segments.getMany

func (*TranslationMemoryService) ListTMs added in v0.3.0

ListTMs returns a list of translation memories.

https://developer.crowdin.com/api/v2/#operation/api.tms.getMany

type TranslationStatusService

type TranslationStatusService struct {
	// contains filtered or unexported fields
}

Status represents the general localization progress on both translations and proofreading. Use API to check translation and proofreading progress on different levels: file, language, branch, directory.

Crowdin API docs: https://developer.crowdin.com/api/v2/#tag/Translation-Status

func (*TranslationStatusService) GetBranchProgress

func (s *TranslationStatusService) GetBranchProgress(ctx context.Context, projectID, branchID int, opts *model.ListOptions) (
	[]*model.TranslationProgress, *Response, error,
)

GetBranchProgress returns the translation and proofreading progress on a branch level.

https://developer.crowdin.com/api/v2/#operation/api.projects.branches.languages.progress.getMany

func (*TranslationStatusService) GetDirectoryProgress

func (s *TranslationStatusService) GetDirectoryProgress(ctx context.Context, projectID, directoryID int, opts *model.ListOptions) (
	[]*model.TranslationProgress, *Response, error,
)

GetDirectoryProgress returns the translation and proofreading progress on a directory level.

https://developer.crowdin.com/api/v2/#operation/api.projects.directories.languages.progress.getMany

func (*TranslationStatusService) GetFileProgress

func (s *TranslationStatusService) GetFileProgress(ctx context.Context, projectID, fileID int, opts *model.ListOptions) (
	[]*model.TranslationProgress, *Response, error,
)

GetFileProgress returns the translation and proofreading progress on a file level.

https://developer.crowdin.com/api/v2/#operation/api.projects.files.languages.progress.getMany

func (*TranslationStatusService) GetLanguageProgress

func (s *TranslationStatusService) GetLanguageProgress(ctx context.Context, projectID int, languageID string, opts *model.ListOptions) (
	[]*model.TranslationProgress, *Response, error,
)

GetLanguageProgress returns the translation and proofreading progress on a language level.

https://developer.crowdin.com/api/v2/#operation/api.projects.languages.files.progress.getMany

func (*TranslationStatusService) GetProjectProgress

func (s *TranslationStatusService) GetProjectProgress(ctx context.Context, projectID int, opts *model.ProjectProgressListOptions) (
	[]*model.TranslationProgress, *Response, error,
)

GetProjectProgress returns the translation and proofreading progress on a project level.

https://developer.crowdin.com/api/v2/#operation/api.projects.languages.progress.getMany

func (*TranslationStatusService) ListQAChecks

func (s *TranslationStatusService) ListQAChecks(ctx context.Context, projectID int, opts *model.QACheckListOptions) (
	[]*model.QACheck, *Response, error,
)

ListQAChecks returns a list of QA check issues.

https://developer.crowdin.com/api/v2/#operation/api.projects.qa-checks.getMany

type TranslationsService

type TranslationsService struct {
	// contains filtered or unexported fields
}

Translators can work with entirely untranslated project or you can pre-translate the files to ease the translations process. Use API to pre-translate files via Machine Translation (MT) or Translation Memory (TM), upload your existing translations, and download translations correspondingly. Pre-translate and build are asynchronous operations and shall be completed with sequence of API methods.

Note: If there are no new translations or changes in build parameters, Crowdin will return the current build for such requests.

func (*TranslationsService) ApplyPreTranslation

func (s *TranslationsService) ApplyPreTranslation(ctx context.Context, projectID int, req *model.PreTranslationRequest) (
	*model.PreTranslation, *Response, error,
)

ApplyPreTranslation applies pre-translation to the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.pre-translations.post

func (*TranslationsService) BuildProjectDirectoryTranslation

func (s *TranslationsService) BuildProjectDirectoryTranslation(
	ctx context.Context,
	projectID, directoryID int,
	req *model.BuildProjectDirectoryTranslationRequest,
) (*model.BuildProjectDirectoryTranslation, *Response, error)

BuildProjectDirectoryTranslation builds translations for a specific directory in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.directories.post

func (*TranslationsService) BuildProjectFileTranslation

func (s *TranslationsService) BuildProjectFileTranslation(
	ctx context.Context,
	projectID, fileID int,
	req *model.BuildProjectFileTranslationRequest,
	etag string,
) (*model.DownloadLink, *Response, error)

BuildProjectFileTranslation builds translations for a specific file in the project.

Note: Pass `etag` identifier to see whether any changes were applied to the file. If etag is not empty, it would be added to the If-None-Match request header. In case the file was changed it would be built. If not you'll receive a 304 (Not Modified) status code.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.files.post

func (*TranslationsService) BuildProjectTranslation

BuildProjectTranslation builds project translations. Request body can be either `model.BuildProjectRequest` or `model.PseudoBuildProjectRequest`.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.post

func (*TranslationsService) CancelBuild

func (s *TranslationsService) CancelBuild(ctx context.Context, projectID, buildID int) (*Response, error)

CancelBuild cancels a build by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.delete

func (*TranslationsService) CheckBuildStatus

func (s *TranslationsService) CheckBuildStatus(ctx context.Context, projectID, buildID int) (
	*model.TranslationsProjectBuild, *Response, error,
)

CheckBuildStatus checks the status of a project build by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.get

func (*TranslationsService) DownloadProjectTranslations

func (s *TranslationsService) DownloadProjectTranslations(ctx context.Context, projectID, buildID int) (
	*model.DownloadLink, *Response, error,
)

DownloadProjectTranslations returns a download link for a specific build.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.download.download

func (*TranslationsService) EditPreTranslation added in v0.9.0

func (s *TranslationsService) EditPreTranslation(
	ctx context.Context, projectID int, preTranslationID string, req []*model.UpdateRequest,
) (*model.PreTranslation, *Response, error)

Edit Pre-Translation updates a specific pre-translation by its identifier.

Request body: - op (string): Operation to perform. Enum: replace, test. - path (string): JSON Pointer to the field to update as defined in RFC 6901. - value (string): Value to set.

https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.pre-translations.patch

func (*TranslationsService) ExportProjectTranslation

func (s *TranslationsService) ExportProjectTranslation(ctx context.Context, projectID int, req *model.ExportTranslationRequest) (
	*model.DownloadLink, *Response, error,
)

ExportProjectTranslation exports project translations for a specific language.

Note: For instant translation delivery to your mobile, web, server, or desktop apps, it is recommended to use OTA.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.exports.post

func (*TranslationsService) ListPreTranslations added in v0.9.0

func (s *TranslationsService) ListPreTranslations(ctx context.Context, projectID int, opts *model.ListOptions) (
	[]*model.PreTranslation, *Response, error,
)

List Pre-Translations returns a list of pre-translations for a specific project.

https://support.crowdin.com/developer/api/v2/#tag/Translations/operation/api.projects.pre-translations.getMany

func (*TranslationsService) ListProjectBuilds

ListProjectBuilds returns a list of builds for a specific project.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.builds.getMany

func (*TranslationsService) PreTranslationStatus

func (s *TranslationsService) PreTranslationStatus(ctx context.Context, projectID int, preTranslationID string) (
	*model.PreTranslation, *Response, error,
)

PreTranslationStatus returns a pre-translation status for project by its identifier.

https://developer.crowdin.com/api/v2/#operation/api.projects.pre-translations.get

func (*TranslationsService) UploadTranslations

func (s *TranslationsService) UploadTranslations(ctx context.Context, projectID int, languageID string, req *model.UploadTranslationsRequest) (
	*model.UploadTranslations, *Response, error,
)

UploadTranslations uploads translations for a specific language in the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.translations.postOnLanguage

type UsersService added in v0.3.0

type UsersService struct {
	// contains filtered or unexported fields
}

Users are the members of your organization with the defined access levels (e.g. manager, admin, contributor).

Use API to get the list of organization users and to check the information on a specific user.

CrowdIn API docs: https://developer.crowdin.com/api/v2/#tag/Users

func (*UsersService) AddProjectMember added in v0.3.0

func (s *UsersService) AddProjectMember(ctx context.Context, projectID int, req *model.ProjectMemberAddRequest) (
	map[string][]*model.ProjectMember, *Response, error,
)

AddProjectMember adds a new member to the project. Returns a list of added and skipped members.

https://developer.crowdin.com/api/v2/#operation/api.projects.members.post

func (*UsersService) Delete added in v0.3.0

func (s *UsersService) Delete(ctx context.Context, userID int) (*Response, error)

Delete removes a user from the organization.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.users.delete

func (*UsersService) DeleteProjectMember added in v0.3.0

func (s *UsersService) DeleteProjectMember(ctx context.Context, projectID, memberID int) (*Response, error)

DeleteProjectMember removes a member from the project.

https://developer.crowdin.com/api/v2/#operation/api.projects.members.delete

func (*UsersService) Edit added in v0.3.0

func (s *UsersService) Edit(ctx context.Context, userID int, req []*model.UpdateRequest) (*model.User, *Response, error)

Edit updates information about a specific user.

Request body:

  • op (string): Operation to perform. Enum: replace.
  • path (string <json-pointer>): Path to the field to update. Enum: "/firstName", "/lastName", "/timezone", "/status", "/adminAccess".
  • value (string): Value to set.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.users.patch

func (*UsersService) Get added in v0.3.0

func (s *UsersService) Get(ctx context.Context, userID int) (*model.User, *Response, error)

Get returns information about a specific user.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.users.getById

func (*UsersService) GetAuthenticated added in v0.3.0

func (s *UsersService) GetAuthenticated(ctx context.Context) (*model.User, *Response, error)

GetAuthenticated returns information about the authenticated user.

https://developer.crowdin.com/api/v2/#operation/api.user.get

func (*UsersService) GetProjectMember added in v0.3.0

func (s *UsersService) GetProjectMember(ctx context.Context, projectID, memberID int) (
	*model.ProjectMember, *Response, error,
)

GetProjectMember returns information or permissions of a specific project member.

https://developer.crowdin.com/api/v2/#operation/api.projects.members.get

func (*UsersService) Invite added in v0.3.0

Invite sends an invitation to a new user.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.users.post

func (*UsersService) List added in v0.3.0

List returns a list of users in the organization.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.users.getMany

func (*UsersService) ListProjectMembers added in v0.3.0

func (s *UsersService) ListProjectMembers(ctx context.Context, projectID int, opts *model.ProjectMembersListOptions) (
	[]*model.ProjectMember, *Response, error,
)

ListProjectMembers returns a list of project members.

https://developer.crowdin.com/api/v2/#operation/api.projects.members.getMany

func (*UsersService) ReplaceProjectMemberPermissions added in v0.3.0

func (s *UsersService) ReplaceProjectMemberPermissions(
	ctx context.Context, projectID, memberID int, req *model.ProjectMemberReplaceRequest,
) (*model.ProjectMember, *Response, error)

ReplaceProjectMemberPermissions replaces permissions of a specific project member.

https://developer.crowdin.com/api/v2/#operation/api.projects.members.put

type VendorsService added in v0.4.0

type VendorsService struct {
	// contains filtered or unexported fields
}

Vendors are the organizations that provide professional translation services. To assign a Vendor to a project workflow you should invite an existing Organization to be a Vendor for you.

Use API to get the list of the Vendors you already invited to your organization.

Crowdin API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Vendors

func (*VendorsService) List added in v0.4.0

List returns a list of vendors.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.vendors.getMany

type WebhooksService added in v0.4.0

type WebhooksService struct {
	// contains filtered or unexported fields
}

Webhooks allow to collect information about events that happen in your Crowdin projects. It is possible to select request type, content type, and add custom payload, which allows to create integrations with other systems on your own.

Webhooks can be configured for the following events:

  • Project file is fully translated
  • Project file is fully reviewed
  • All strings in project are translated
  • All strings in project are reviewed
  • Final translation of string is updated (using Replace in suggestions feature)
  • Source string is added
  • Source string is updated
  • Source string is deleted
  • Source string is translated
  • Translation for source string is updated (using Replace in suggestions feature)
  • One of translations is deleted
  • Translation for string is approved
  • Approval for previously added translation is removed

Use API to create, modify, and delete specific webhooks.

CrowdIn API docs: https://developer.crowdin.com/api/v2/#tag/Webhooks

func (*WebhooksService) Add added in v0.4.0

func (s *WebhooksService) Add(ctx context.Context, projectID int, req *model.WebhookAddRequest) (
	*model.Webhook, *Response, error,
)

Add creates a new webhook.

https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.post

func (*WebhooksService) Delete added in v0.4.0

func (s *WebhooksService) Delete(ctx context.Context, projectID, webhookID int) (*Response, error)

Delete removes a specific webhook.

https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.delete

func (*WebhooksService) Edit added in v0.4.0

func (s *WebhooksService) Edit(ctx context.Context, projectID, webhookID int, req []*model.UpdateRequest) (
	*model.Webhook, *Response, error,
)

Edit modifies a specific webhook.

Request body:

  • Op (string): operation to perform. Enum: replace, test.
  • Path (string <json-pointer>): a JSON Pointer to the target location. Enum: "/name", "/url", "/isActive", "/batchingEnabled", "/contentType", "/events", "/headers", "/requestType", "/payload".
  • Value (any): new value to set.

https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.patch

func (*WebhooksService) Get added in v0.4.0

func (s *WebhooksService) Get(ctx context.Context, projectID, webhookID int) (*model.Webhook, *Response, error)

Get returns a specific webhook for a project.

https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.get

func (*WebhooksService) List added in v0.4.0

func (s *WebhooksService) List(ctx context.Context, projectID int, opts *model.ListOptions) (
	[]*model.Webhook, *Response, error,
)

List returns a list of webhooks for a project.

https://developer.crowdin.com/api/v2/#operation/api.projects.webhooks.getMany

type WorkflowsService added in v0.4.0

type WorkflowsService struct {
	// contains filtered or unexported fields
}

Workflows are the sequences of steps that content in your project should go through (e.g. pre-translation, translation, proofreading). You can use a default template or create the one that works best for you and assign it to the needed projects.

Use API to get the list of workflow templates available in your organization and to check the details of a specific template.

Crowdin API docs: https://developer.crowdin.com/enterprise/api/v2/#tag/Workflows

func (*WorkflowsService) GetStep added in v0.4.0

func (s *WorkflowsService) GetStep(ctx context.Context, projectID, stepID int) (*model.WorkflowStep, *Response, error)

GetStep returns a specific workflow step.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.workflow-steps.get

func (*WorkflowsService) GetTemplate added in v0.4.0

func (s *WorkflowsService) GetTemplate(ctx context.Context, templateID int) (*model.WorkflowTemplate, *Response, error)

GetTemplate returns a specific workflow template.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.workflow-templates.get

func (*WorkflowsService) ListStepStrings added in v0.11.0

func (s *WorkflowsService) ListStepStrings(ctx context.Context, projectID, stepID int, opts *model.WorkflowStepStringsListOptions) (
	[]*model.SourceString, *Response, error,
)

ListStepStrings returns a list of strings on the workflow step.

https://support.crowdin.com/developer/enterprise/api/v2/#tag/Workflows/operation/api.projects.workflow-steps.strings.getMany

func (*WorkflowsService) ListSteps added in v0.4.0

func (s *WorkflowsService) ListSteps(ctx context.Context, projectID string) ([]*model.WorkflowStep, *Response, error)

ListSteps returns a list of workflow steps available in the project.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.workflow-steps.getMany

func (*WorkflowsService) ListTemplates added in v0.4.0

ListTemplates returns a list of workflow templates available in the organization.

https://developer.crowdin.com/enterprise/api/v2/#operation/api.workflow-templates.get

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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