├── .github ├── codecov.yml └── workflows │ ├── dependency-analysis.yml │ ├── lint-pr-title.yml │ ├── release.yml │ └── publish.yml ├── docs ├── toc.yml └── docfx.json ├── samples ├── Crowdin.Api.Samples.Actions │ ├── GlobalUsings.cs │ ├── CrowdinActions.cs │ ├── Crowdin.Api.Samples.Actions.csproj │ ├── README.md │ ├── Actions │ │ └── CrowdinApiClientExtensions.cs │ └── Program.cs ├── README.md └── Crowdin.Api.Samples │ └── Crowdin.Api.Samples.csproj ├── global.json ├── src └── Crowdin.Api │ ├── SourceFiles │ ├── FileResourceBase.cs │ ├── UpdateOrRestoreFileRequest.cs │ ├── BuildReviewedSourceFilesRequest.cs │ ├── RestoreFileRequest.cs │ ├── AddAssetReferenceRequest.cs │ ├── FileStatus.cs │ ├── FileUpdateOption.cs │ ├── Branch.cs │ ├── AddBranchRequest.cs │ ├── AssetReference.cs │ ├── BranchPatch.cs │ ├── DirectoryPatch.cs │ └── AddDirectoryRequest.cs │ ├── Users │ ├── UserBase.cs │ ├── LanguagePermission.cs │ ├── UserTwoFactorStatus.cs │ ├── ProjectGroup.cs │ ├── UserStatus.cs │ ├── OrganizationRole.cs │ ├── GroupManager.cs │ ├── ProjectMembersResponse.cs │ ├── UserRole.cs │ ├── EnterpriseUserPatch.cs │ └── EnterpriseInviteUserRequest.cs │ ├── AI │ ├── AiReportSchemaBase.cs │ ├── AiProxyChatCompletion.cs │ ├── AiPromptAction.cs │ ├── AiReportType.cs │ ├── AiToolType.cs │ ├── CloneAiPromptRequest.cs │ ├── AiProviderModelResource.cs │ ├── AiToolObject.cs │ ├── AiReportFormat.cs │ ├── AiDatasetPurpose.cs │ ├── AiProviderConfiguration.cs │ ├── AiModelPrice.cs │ ├── AiModelModalities.cs │ ├── AiPromptMode.cs │ ├── GenerateAiReport.cs │ ├── AiTool.cs │ ├── OtherLanguageTranslationsConfig.cs │ ├── ActionRule.cs │ ├── AiModelModalityDetails.cs │ ├── AiSettingsShortcuts.cs │ ├── AiModelFeatures.cs │ ├── AiToolFunction.cs │ ├── AiSettings.cs │ ├── AiHyperParameters.cs │ ├── GenerateAiPromptCompletionRequest.cs │ ├── AiProviderType.cs │ ├── AiSettingsPatch.cs │ ├── CreateAiPromptFineTuningJobRequest.cs │ ├── AiProviderPatch.cs │ ├── AiPromptPatch.cs │ └── AiValidationOptions.cs │ ├── Core │ ├── AssemblyInfo.cs │ ├── RateLimiting │ │ ├── RateException.cs │ │ ├── IRateLimiter.cs │ │ └── RateLimitConfiguration.cs │ ├── CrowdinApiResult.cs │ ├── Constants.cs │ └── Resilience │ │ └── RetryConfiguration.cs │ ├── Tasks │ ├── AddTaskRequest.cs │ ├── TaskPatchBase.cs │ ├── TaskType.cs │ ├── TaskSettingsTemplateConfig.cs │ ├── TaskAssignedTeam.cs │ ├── TaskAssigneeForm.cs │ ├── TaskSettingsTemplateConfigForm.cs │ ├── AddTaskCommentRequest.cs │ ├── AddTaskSettingsTemplate.cs │ ├── TaskProgress.cs │ ├── TaskCost.cs │ ├── TaskArchivedStatusPatch.cs │ ├── TaskCommentPatch.cs │ ├── TaskSettingsTemplatePatch.cs │ ├── LanguageReference.cs │ ├── TaskStatus.cs │ ├── VendorTaskPatch.cs │ ├── TaskSettingsTemplate.cs │ ├── TaskAssignee.cs │ ├── TaskComment.cs │ └── LanguageServicePendingTaskCreateForm.cs │ ├── Workflows │ ├── WorkflowConfig.cs │ ├── WorkflowCrowdsourcingConfig.cs │ ├── WorkflowMtPreTranslationConfig.cs │ ├── WorkflowProofreadingByVendorConfig.cs │ ├── WorkflowTranslationByVendorConfig.cs │ ├── WorkflowProofreadingConfig.cs │ ├── WorkflowTranslationConfig.cs │ ├── WorkflowTmPreTranslationConfig.cs │ ├── WorkflowStatus.cs │ ├── WorkflowStep.cs │ └── WorkflowTemplate.cs │ ├── Reports │ ├── GenerateReportRequest.cs │ ├── GenerateGroupReportRequest.cs │ ├── ScopeType.cs │ ├── ExportReportArchiveRequest.cs │ ├── ReportGroupingMode.cs │ ├── BaseRates.cs │ ├── ReportSettingsTemplateMode.cs │ ├── Match.cs │ ├── ReportFormat.cs │ ├── ReportApprovalRate.cs │ ├── ReportLabelIncludeType.cs │ ├── BaseRatesForm.cs │ ├── ReportUnit.cs │ ├── GroupingParameter.cs │ ├── MatchType.cs │ ├── ReportIndividualRatesForm.cs │ ├── ReportCurrency.cs │ ├── ReportFuzzyIndividualRatesForm.cs │ ├── ReportApprovalIndividualRates.cs │ ├── ReportCreateForm.cs │ ├── UserReportSettingsTemplatePatch.cs │ ├── ReportSettingsTemplatePatch.cs │ └── ProjectMembersGenerateReportRequest.cs │ ├── IQueryParamsProvider.cs │ ├── MachineTranslationEngines │ ├── IMtCredentialsForm.cs │ ├── DeepLProCredentials.cs │ ├── CustomMtTranslateCredentials.cs │ ├── GoogleTranslateCredentials.cs │ ├── YandexTranslateCredentials.cs │ ├── ModernMtTranslateCredentials.cs │ ├── LanguageRecognitionProvider.cs │ ├── GoogleAutoMLTranslateCredentials.cs │ ├── AmazonTranslateCredentials.cs │ ├── MicrosoftTranslateCredentials.cs │ ├── MtEnginePatch.cs │ ├── MtTranslation.cs │ ├── IMachineTranslationEnginesApiExecutor.cs │ └── TranslateViaMtRequest.cs │ ├── ProjectsGroups │ ├── AddProjectRequest.cs │ ├── TagsDetectionAction.cs │ ├── AssignedTm.cs │ ├── ProjectType.cs │ ├── ProjectForm.cs │ ├── ProjectPatch.cs │ ├── ProjectVisibility.cs │ ├── LanguageAccessPolicy.cs │ ├── ProjectExternalType.cs │ ├── DupTranslateAction.cs │ ├── TmPriority.cs │ ├── TmTimeElapsed.cs │ ├── TmContextType.cs │ ├── AddProjectFileFormatSettingsRequest.cs │ ├── AddProjectStringsExporterSettingsRequest.cs │ ├── Project.cs │ ├── NotificationSettings.cs │ ├── AddGroupRequest.cs │ ├── StringsExporterSettings.cs │ ├── GroupPatch.cs │ ├── ProjectFileFormatSettingsPatch.cs │ ├── ProjectStringsExporterSettingsPatch.cs │ ├── ProjectRole.cs │ ├── StringsExporterSettingsResource.cs │ ├── TmPenalties.cs │ └── EnterpriseProject.cs │ ├── Teams │ ├── AddTeamRequest.cs │ ├── AddTeamMembersRequest.cs │ ├── GroupTeam.cs │ ├── ProjectTeamResources.cs │ ├── TeamPatch.cs │ ├── AddTeamMembersResponse.cs │ ├── Team.cs │ ├── TeamMember.cs │ └── ProjectTeamResource.cs │ ├── Labels │ ├── AddLabelRequest.cs │ ├── LabelMatchRule.cs │ ├── AssignLabelToStringsRequest.cs │ ├── AssignLabelToScreenshotsRequest.cs │ ├── Label.cs │ └── LabelPatch.cs │ ├── Pagination.cs │ ├── Bundles │ └── BundleExportAttributes.cs │ ├── StringComments │ ├── CommentAttachmentRequest.cs │ ├── IssueStatus.cs │ ├── StringCommentType.cs │ ├── IssueType.cs │ ├── StringCommentPatch.cs │ ├── AddStringCommentRequest.cs │ └── CommentAttachment.cs │ ├── Clients │ ├── IClientsApiExecutor.cs │ └── Client.cs │ ├── Languages │ ├── LanguagePatch.cs │ ├── ILanguagesApiExecutor.cs │ └── LanguagePatchPath.cs │ ├── Vendors │ ├── IVendorsApiExecutor.cs │ ├── VendorStatus.cs │ └── Vendor.cs │ ├── Translations │ ├── FileDownloadLink.cs │ ├── ImportFileStatistics.cs │ ├── TranslationImportReport.cs │ ├── TranslationImportFile.cs │ ├── ImportSkippedQaCheckCategories.cs │ ├── PreTranslationMethod.cs │ ├── TranslationFormat.cs │ ├── TranslationImportSkipped.cs │ ├── CharTransformationMode.cs │ ├── PreTranslationPatch.cs │ ├── AutoApproveOption.cs │ ├── TranslationImportLanguage.cs │ ├── UploadTranslationsResponse.cs │ ├── BuildProjectFileTranslationResponse.cs │ └── TranslationImportAttributes.cs │ ├── SortingOrder.cs │ ├── TextDirection.cs │ ├── StringTranslations │ ├── AddApprovalRequest.cs │ ├── TranslationAlignment.cs │ ├── WordAlignment.cs │ ├── AddVoteRequest.cs │ ├── TranslationAlignmentRequest.cs │ ├── User.cs │ ├── PluralCategoryName.cs │ ├── AddTranslationRequest.cs │ └── Alignment.cs │ ├── JsonFileType.cs │ ├── TranslationStatus │ ├── FileProgressResource.cs │ ├── ProgressResourceStatus.cs │ ├── ProgressResource.cs │ └── LanguageProgressResource.cs │ ├── Notifications │ ├── SendNotificationToAuthenticatedUserRequest.cs │ ├── INotificationsApiExecutor.cs │ ├── SendNotificationToOrganizationMembersRequest.cs │ └── SendNotificationToProjectMembersRequest.cs │ ├── Distributions │ ├── DistributionExportMode.cs │ ├── DistributionReleaseStatus.cs │ ├── AddDistributionStringBasedRequest.cs │ ├── DistributionPatch.cs │ ├── DistributionStringBasedRelease.cs │ ├── DistributionRelease.cs │ └── AddDistributionRequest.cs │ ├── Priority.cs │ ├── ResponseList.cs │ ├── Screenshots │ ├── Size.cs │ ├── UpdateScreenshotRequest.cs │ ├── Position.cs │ ├── TagPatch.cs │ ├── ScreenshotPatch.cs │ ├── AddScreenshotRequest.cs │ ├── ReplaceTagsRequest.cs │ └── Tag.cs │ ├── PatchEntry.cs │ ├── Storage │ ├── StorageResource.cs │ └── IStorageApiExecutor.cs │ ├── TranslationMemory │ ├── CreateTmSegmentRequest.cs │ ├── CreateTmSegmentRecordsRequest.cs │ ├── TmFileFormat.cs │ ├── TmSegmentResource.cs │ ├── TmSegmentRecordForm.cs │ ├── AddTmRequest.cs │ ├── TmSegmentRecordPatch.cs │ ├── ExportTmRequest.cs │ ├── ImportTmRequest.cs │ ├── TmPatch.cs │ └── ConcordanceSearchRequest.cs │ ├── DownloadLink.cs │ ├── Dictionaries │ ├── Dictionary.cs │ └── IDictionariesApiExecutor.cs │ ├── Issues │ ├── IssueStatus.cs │ ├── IssuePatch.cs │ ├── IssueType.cs │ └── IIssuesApiExecutor.cs │ ├── Webhooks │ ├── RequestType.cs │ ├── Organization │ │ ├── AddWebhookRequest.cs │ │ ├── OrganizationEventType.cs │ │ ├── EnterpriseAddWebhookRequest.cs │ │ ├── EnterpriseOrgEventType.cs │ │ └── IOrganizationWebhooksApiExecutor.cs │ ├── ContentType.cs │ └── IWebhooksApiExecutor.cs │ ├── GraphQL │ ├── IGraphQLApiExecutor.cs │ └── GraphQLRequest.cs │ ├── LanguageAccessRule.cs │ ├── TranslatorRole.cs │ ├── Applications │ ├── ApplicationPermission.cs │ ├── InstallationPatch.cs │ ├── InstallApplicationRequest.cs │ ├── ApplicationModule.cs │ ├── ApplicationProject.cs │ └── ApplicationUser.cs │ ├── CrowdinCredentials.cs │ ├── TranslatorRolePermissions.cs │ ├── Glossaries │ ├── GlossaryFormat.cs │ ├── TermGender.cs │ ├── ExportGlossaryRequest.cs │ ├── AddGlossaryRequest.cs │ ├── TermStatus.cs │ ├── ConceptLanguageDetailsForm.cs │ ├── ConcordanceSearchRequest.cs │ ├── GlossaryPatch.cs │ ├── ImportGlossaryRequest.cs │ ├── TermType.cs │ ├── GlossaryConcordanceResultResource.cs │ ├── GlossaryExportFieldId.cs │ ├── ConceptLanguageDetails.cs │ └── UpdateConceptRequest.cs │ ├── Branches │ ├── AddBranchRequest.cs │ ├── CloneBranchRequest.cs │ ├── BranchMergeStatusId.cs │ ├── MergeBranchRequest.cs │ ├── BranchPatch.cs │ └── Branch.cs │ ├── TranslatorRoleName.cs │ ├── BuildStatus.cs │ ├── SourceStrings │ ├── UpdateOption.cs │ ├── SourceTextForms.cs │ ├── SourceStringPatch.cs │ └── StringBasedProjectFileType.cs │ ├── OperationStatus.cs │ ├── StringCorrections │ ├── AddCorrectionRequest.cs │ └── Correction.cs │ ├── PatchOperation.cs │ ├── Fields │ ├── FieldEntity.cs │ ├── FieldPatch.cs │ ├── AddFieldRequest.cs │ ├── IFieldsApiExecutor.cs │ └── FieldType.cs │ ├── ErrorResource.cs │ ├── Currency.cs │ ├── ColumnType.cs │ ├── SortingRule.cs │ └── CrowdinApiException.cs ├── .editorconfig └── tests └── Crowdin.Api.UnitTesting └── Tests └── Webhooks └── WebhookEventTypeTests.cs /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | github_checks: 2 | annotations: false 3 | -------------------------------------------------------------------------------- /docs/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Home 2 | href: ../README.md 3 | - name: API Documentation 4 | href: obj/api/ -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | // Global using directives 2 | 3 | global using Crowdin.Api.Samples.Actions; -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "5.0", 4 | "rollForward": "latestMajor", 5 | "allowPrerelease": false 6 | } 7 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/FileResourceBase.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Crowdin.Api.SourceFiles 3 | { 4 | public abstract class FileResourceBase 5 | { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/UpdateOrRestoreFileRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Crowdin.Api.SourceFiles 3 | { 4 | public abstract class UpdateOrRestoreFileRequest 5 | { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/UserBase.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Users 5 | { 6 | [PublicAPI] 7 | public abstract class UserBase 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiReportSchemaBase.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiReportSchemaBase 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: InternalsVisibleTo("Crowdin.Api.UnitTesting")] 5 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // for Moq -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 4 4 | charset = utf-8 5 | trim_trailing_whitespace = false 6 | insert_final_newline = false 7 | max_line_length = 120 8 | 9 | [*.yml] 10 | indent_size = 2 -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiProxyChatCompletion.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiProxyChatCompletion 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/AddTaskRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Tasks 5 | { 6 | [PublicAPI] 7 | public abstract class AddTaskRequest 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Workflows 5 | { 6 | [PublicAPI] 7 | public abstract class WorkflowConfig 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskPatchBase.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Tasks 5 | { 6 | [PublicAPI] 7 | public abstract class TaskPatchBase : PatchEntry 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/GenerateReportRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Reports 5 | { 6 | [PublicAPI] 7 | public abstract class GenerateReportRequest 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/IQueryParamsProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | 4 | namespace Crowdin.Api 5 | { 6 | public interface IQueryParamsProvider 7 | { 8 | IDictionary ToQueryParams(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/RateLimiting/RateException.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Crowdin.Api.Core.RateLimiting 3 | { 4 | public class RateException : CrowdinApiException 5 | { 6 | public RateException(string message) : base(429, message) { } 7 | } 8 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/IMtCredentialsForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.MachineTranslationEngines 5 | { 6 | [PublicAPI] 7 | public interface IMtCredentialsForm 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowCrowdsourcingConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Workflows 5 | { 6 | [PublicAPI] 7 | public class WorkflowCrowdsourcingConfig : WorkflowConfig 8 | { 9 | 10 | } 11 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/AddProjectRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api.ProjectsGroups 7 | { 8 | [PublicAPI] 9 | public class AddProjectRequest 10 | { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/GenerateGroupReportRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api.Reports 7 | { 8 | [PublicAPI] 9 | public abstract class GenerateGroupReportRequest 10 | { 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ScopeType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ScopeType 9 | { 10 | [Description("project")] 11 | Project 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/TagsDetectionAction.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.ProjectsGroups 5 | { 6 | [PublicAPI] 7 | public enum TagsDetectionAction 8 | { 9 | Auto = 0, 10 | Count = 1, 11 | Skip = 2 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiPromptAction.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiPromptAction 9 | { 10 | [Description("pre_translate")] 11 | PreTranslate 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiReportType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiReportType 9 | { 10 | [Description("tokens-usage-raw-data")] 11 | TokensUsageRawData 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiToolType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public enum AiToolType 11 | { 12 | [Description("function")] 13 | Function 14 | } 15 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/AddTeamRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Teams 6 | { 7 | [PublicAPI] 8 | public class AddTeamRequest 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/CloneAiPromptRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public class CloneAiPromptRequest 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/AddLabelRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Labels 6 | { 7 | [PublicAPI] 8 | public class AddLabelRequest 9 | { 10 | [JsonProperty("title")] 11 | public string Title { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskType.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Tasks 5 | { 6 | [PublicAPI] 7 | public enum TaskType 8 | { 9 | Translate = 0, 10 | Proofread = 1, 11 | TranslateByVendor = 2, 12 | ProofreadByVendor = 3 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiProviderModelResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public class AiProviderModelResource 9 | { 10 | [JsonProperty("id")] 11 | public string Id { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/AssignedTm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class AssignedTm 9 | { 10 | [JsonProperty("priority")] 11 | public int Priority { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiToolObject.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public class AiToolObject 11 | { 12 | [JsonProperty("tool")] 13 | public AiTool? Tool { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Pagination.cs: -------------------------------------------------------------------------------- 1 | 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api 5 | { 6 | public class Pagination 7 | { 8 | [JsonProperty("limit")] 9 | public int Limit { get; set; } 10 | 11 | [JsonProperty("offset")] 12 | public int Offset { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Bundles/BundleExportAttributes.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Bundles 6 | { 7 | [PublicAPI] 8 | public class BundleExportAttributes 9 | { 10 | [JsonProperty("bundleId")] 11 | public long BundleId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/CommentAttachmentRequest.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.StringComments 5 | { 6 | [PublicAPI] 7 | public class CommentAttachmentRequest 8 | { 9 | [JsonProperty("id")] 10 | public long Id { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Clients/IClientsApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Clients 6 | { 7 | [PublicAPI] 8 | public interface IClientsApiExecutor 9 | { 10 | Task> ListClients(int limit = 25, int offset = 0); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Languages/LanguagePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Languages 6 | { 7 | [PublicAPI] 8 | public class LanguagePatch : PatchEntry 9 | { 10 | [JsonProperty("path")] 11 | public LanguagePatchPath Path { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/LanguagePermission.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public class LanguagePermission 9 | { 10 | [JsonProperty("workflowStepIds")] 11 | public object WorkflowStepIds { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Vendors/IVendorsApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Vendors 6 | { 7 | [PublicAPI] 8 | public interface IVendorsApiExecutor 9 | { 10 | Task> ListVendors(int limit = 25, int offset = 0); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiReportFormat.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiReportFormat 9 | { 10 | [Description("json")] 11 | Json, 12 | 13 | [Description("csv")] 14 | Csv 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectType.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.ProjectsGroups 5 | { 6 | [PublicAPI] 7 | public enum ProjectType 8 | { 9 | FileBased = 0, 10 | StringBased = 1, 11 | FileBasedExternal = 2, 12 | StringBasedExternal = 3 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/FileDownloadLink.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public class FileDownloadLink : DownloadLink 9 | { 10 | [JsonProperty("etag")] 11 | public string Etag { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ExportReportArchiveRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public class ExportReportArchiveRequest 9 | { 10 | [JsonProperty("format")] 11 | public ReportFormat? Format { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SortingOrder.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum SortingOrder 9 | { 10 | [Description("asc")] 11 | Ascending, 12 | 13 | [Description("desc")] 14 | Descending 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/RateLimiting/IRateLimiter.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Net.Http; 4 | using System.Threading.Tasks; 5 | 6 | namespace Crowdin.Api.Core.RateLimiting 7 | { 8 | public interface IRateLimiter 9 | { 10 | Task ExecuteRequest(Func> runRequest); 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/LabelMatchRule.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Labels 6 | { 7 | [PublicAPI] 8 | public enum LabelMatchRule 9 | { 10 | [Description("all")] 11 | All, 12 | 13 | [Description("any")] 14 | Any 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TextDirection.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum TextDirection 9 | { 10 | [Description("ltr")] 11 | LeftToRight, 12 | 13 | [Description("rtl")] 14 | RightToLeft 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public abstract class ProjectForm : AddProjectRequest 9 | { 10 | [JsonProperty("type")] 11 | public ProjectType? Type { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/AddApprovalRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class AddApprovalRequest 9 | { 10 | [JsonProperty("translationId")] 11 | public long TranslationId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/TranslationAlignment.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class TranslationAlignment 9 | { 10 | [JsonProperty("words")] 11 | public WordAlignment[] Words { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskSettingsTemplateConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class TaskSettingsTemplateConfig 9 | { 10 | [JsonProperty("languages")] 11 | public LanguageReference[] Languages { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/JsonFileType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum JsonFileType 9 | { 10 | [Description("i18next_json")] 11 | I18NextJson, 12 | 13 | [Description("nestjs_i18n")] 14 | NestJsI18N 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.ProjectsGroups 5 | { 6 | [PublicAPI] 7 | public class ProjectPatch : PatchEntry 8 | { 9 | // base for ProjectInfoPatch 10 | // base for ProjectSettingPatch 11 | // base for EnterpriseProjectPatch 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/BuildReviewedSourceFilesRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.SourceFiles 6 | { 7 | [PublicAPI] 8 | public class BuildReviewedSourceFilesRequest 9 | { 10 | [JsonProperty("branchId")] 11 | public long? BranchId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationStatus/FileProgressResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationStatus 6 | { 7 | [PublicAPI] 8 | public class FileProgressResource : ProgressResource 9 | { 10 | [JsonProperty("eTag")] 11 | public string Etag { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/ImportFileStatistics.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Crowdin.Api.Translations 4 | { 5 | public class ImportFileStatistics 6 | { 7 | [JsonProperty("phrases")] 8 | public int Phrases { get; set; } 9 | 10 | [JsonProperty("words")] 11 | public int Words { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowMtPreTranslationConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowMtPreTranslationConfig : WorkflowConfig 9 | { 10 | [JsonProperty("mtId")] 11 | public long MtId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/RestoreFileRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.SourceFiles 6 | { 7 | [PublicAPI] 8 | public class RestoreFileRequest : UpdateOrRestoreFileRequest 9 | { 10 | [JsonProperty("revisionId")] 11 | public long RevisionId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationImportReport.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.Translations 5 | { 6 | public class TranslationImportReport 7 | { 8 | [JsonProperty("languages")] 9 | public IEnumerable? Languages { get; set; } 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiDatasetPurpose.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiDatasetPurpose 9 | { 10 | [Description("training")] 11 | Training, 12 | 13 | [Description("validation")] 14 | Validation 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportGroupingMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ReportGroupingMode 9 | { 10 | [Description("user")] 11 | User, 12 | 13 | [Description("language")] 14 | Language 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/AddTeamMembersRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Teams 7 | { 8 | [PublicAPI] 9 | public class AddTeamMembersRequest 10 | { 11 | [JsonProperty("userIds")] 12 | public ICollection UserIds { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationImportFile.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Crowdin.Api.Translations 4 | { 5 | public class TranslationImportFile 6 | { 7 | [JsonProperty("id")] 8 | public string Id { get; set; } 9 | [JsonProperty("statistics")] 10 | public ImportFileStatistics Statistics { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/UserTwoFactorStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public enum UserTwoFactorStatus 9 | { 10 | [Description("enabled")] 11 | Enabled, 12 | 13 | [Description("disabled")] 14 | Disabled 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowProofreadingByVendorConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowProofreadingByVendorConfig : WorkflowConfig 9 | { 10 | [JsonProperty("vendorId")] 11 | public long VendorId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowTranslationByVendorConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowTranslationByVendorConfig : WorkflowConfig 9 | { 10 | [JsonProperty("vendorId")] 11 | public long VendorId { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiProviderConfiguration.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.AI 7 | { 8 | [PublicAPI] 9 | public class AiProviderConfiguration 10 | { 11 | [JsonProperty("actionRules")] 12 | public List ActionRules { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/DeepLProCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class DeepLProCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("apiKey")] 11 | public string ApiKey { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectVisibility.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public enum ProjectVisibility 9 | { 10 | [Description("open")] 11 | Open, 12 | 13 | [Description("private")] 14 | Private 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/BaseRates.cs: -------------------------------------------------------------------------------- 1 | 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.Reports 5 | { 6 | public class BaseRates 7 | { 8 | [JsonProperty("fullTranslation")] 9 | public float FullTranslation { get; set; } 10 | 11 | [JsonProperty("proofread")] 12 | public float Proofread { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/IssueStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.StringComments 6 | { 7 | [PublicAPI] 8 | public enum IssueStatus 9 | { 10 | [Description("resolved")] 11 | Resolved, 12 | 13 | [Description("unresolved")] 14 | UnResolved 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/StringCommentType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.StringComments 6 | { 7 | [PublicAPI] 8 | public enum StringCommentType 9 | { 10 | [Description("comment")] 11 | Comment, 12 | 13 | [Description("issue")] 14 | Issue 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiModelPrice.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiModelPrice 8 | { 9 | [JsonProperty("input")] 10 | public decimal Input { get; set; } 11 | 12 | [JsonProperty("output")] 13 | public decimal Output { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Notifications/SendNotificationToAuthenticatedUserRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Notifications 6 | { 7 | [PublicAPI] 8 | public class SendNotificationToAuthenticatedUserRequest 9 | { 10 | [JsonProperty("message")] 11 | public string Message { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportSettingsTemplateMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ReportSettingsTemplateMode 9 | { 10 | [Description("simple")] 11 | Simple, 12 | 13 | [Description("fuzzy")] 14 | Fuzzy 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/GroupTeam.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Teams 6 | { 7 | [PublicAPI] 8 | public class GroupTeam 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("team")] 14 | public Team Team { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/ImportSkippedQaCheckCategories.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Crowdin.Api.Translations 4 | { 5 | public class ImportSkippedQaCheckCategories 6 | { 7 | [JsonProperty("size")] 8 | public int Size { get; set; } 9 | 10 | [JsonProperty("duplicate")] 11 | public int Duplicate { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/DistributionExportMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Distributions 6 | { 7 | [PublicAPI] 8 | public enum DistributionExportMode 9 | { 10 | [Description("default")] 11 | Default, 12 | 13 | [Description("bundle")] 14 | Bundle 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/LanguageAccessPolicy.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public enum LanguageAccessPolicy 9 | { 10 | [Description("open")] 11 | Open, 12 | 13 | [Description("moderate")] 14 | Moderate 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/ProjectGroup.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public class ProjectGroup 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("name")] 14 | public string Name { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /.github/workflows/dependency-analysis.yml: -------------------------------------------------------------------------------- 1 | name: Dependency Analysis 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | schedule: 8 | - cron: '0 0 * * MON' 9 | workflow_dispatch: 10 | 11 | jobs: 12 | dependency-analysis: 13 | uses: crowdin/.github/.github/workflows/dependency-analysis.yml@main 14 | secrets: 15 | FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} 16 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/RateLimiting/RateLimitConfiguration.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | namespace Crowdin.Api.Core.RateLimiting 5 | { 6 | public class RateLimitConfiguration 7 | { 8 | public int MaxAttempts { get; set; } 9 | 10 | public TimeSpan InitialDelay { get; set; } 11 | 12 | public TimeSpan MaxDelay { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/AssignLabelToStringsRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Labels 7 | { 8 | [PublicAPI] 9 | public class AssignLabelToStringsRequest 10 | { 11 | [JsonProperty("stringIds")] 12 | public ICollection StringIds { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/CustomMtTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class CustomMtTranslateCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("url")] 11 | public string Url { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/GoogleTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class GoogleTranslateCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("apiKey")] 11 | public string ApiKey { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/YandexTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class YandexTranslateCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("apiKey")] 11 | public string ApiKey { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Priority.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum Priority 9 | { 10 | [Description("low")] 11 | Low, 12 | 13 | [Description("normal")] 14 | Normal, 15 | 16 | [Description("high")] 17 | High 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ResponseList.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | public class ResponseList 11 | { 12 | public List Data { get; set; } = new List(); 13 | 14 | public Pagination? Pagination { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/Size.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Screenshots 6 | { 7 | [PublicAPI] 8 | public class Size 9 | { 10 | [JsonProperty("width")] 11 | public int Width { get; set; } 12 | 13 | [JsonProperty("height")] 14 | public int Height { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/ModernMtTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class ModernMtTranslateCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("apiKey")] 11 | public string ApiKey { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectExternalType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public enum ProjectExternalType 9 | { 10 | [Description("translate")] 11 | Translate, 12 | 13 | [Description("proofread")] 14 | Proofread 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/Match.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public class Match 9 | { 10 | [JsonProperty("matchType")] 11 | public MatchTypeObject MatchType { get; set; } 12 | 13 | [JsonProperty("price")] 14 | public float Price { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/PatchEntry.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public abstract class PatchEntry 9 | { 10 | [JsonProperty("op")] 11 | public PatchOperation Operation { get; set; } 12 | 13 | [JsonProperty("value")] 14 | public object Value { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/AssignLabelToScreenshotsRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Labels 7 | { 8 | [PublicAPI] 9 | public class AssignLabelToScreenshotsRequest 10 | { 11 | [JsonProperty("screenshotIds")] 12 | public ICollection ScreenshotIds { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Storage/StorageResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Storage 6 | { 7 | [PublicAPI] 8 | public class StorageResource 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("fileName")] 14 | public string FileName { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskAssignedTeam.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class TaskAssignedTeam 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("wordsCount")] 14 | public int WordsCount { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskAssigneeForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class TaskAssigneeForm 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("wordsCount")] 14 | public int? WordsCount { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskSettingsTemplateConfigForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskSettingsTemplateConfigForm 10 | { 11 | [JsonProperty("languages")] 12 | public ICollection Languages { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /.github/workflows/lint-pr-title.yml: -------------------------------------------------------------------------------- 1 | name: Lint PR Title 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - reopened 8 | - edited 9 | - synchronize 10 | 11 | jobs: 12 | main: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: amannn/action-semantic-pull-request@v5 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Crowdin .NET client usage examples 2 | 3 | This section contains examples of using the Crowdin .NET client. 4 | 5 | - [Samples](Crowdin.Api.Samples) - a set of examples of using the Crowdin .NET client for performing various requests. 6 | - [Actions](Crowdin.Api.Samples.Actions) - a set of examples of using the Crowdin .NET client for performing various use cases that require **multiple API calls**. 7 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportFormat.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ReportFormat 9 | { 10 | [Description("xlsx")] 11 | Xlsx, 12 | 13 | [Description("csv")] 14 | Csv, 15 | 16 | [Description("json")] 17 | Json 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/CreateTmSegmentRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.TranslationMemory 7 | { 8 | [PublicAPI] 9 | public class CreateTmSegmentRequest 10 | { 11 | [JsonProperty("records")] 12 | public ICollection Records { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/DownloadLink.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api 7 | { 8 | [PublicAPI] 9 | public class DownloadLink 10 | { 11 | [JsonProperty("url")] 12 | public string Url { get; set; } 13 | 14 | [JsonProperty("expireIn")] 15 | public DateTimeOffset ExpireIn { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/DupTranslateAction.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.ProjectsGroups 5 | { 6 | [PublicAPI] 7 | public enum DupTranslateAction 8 | { 9 | Show = 0, 10 | Hide = 1, 11 | ShowAndAutoTranslate = 2, 12 | ShowWithVersionBranch = 3, 13 | HideStrict = 4, 14 | ShowWithVersionBranchStrict = 5 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/TmPriority.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class TmPriority 9 | { 10 | [JsonProperty("priority")] 11 | public int Priority { get; set; } 12 | 13 | [JsonProperty("penalty")] 14 | public int Penalty { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/TmTimeElapsed.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class TmTimeElapsed 9 | { 10 | [JsonProperty("months")] 11 | public int Months { get; set; } 12 | 13 | [JsonProperty("penalty")] 14 | public int Penalty { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportApprovalRate.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public class ReportApprovalRate 9 | { 10 | [JsonProperty("mode")] 11 | public string Mode => "approval"; 12 | 13 | [JsonProperty("value")] 14 | public float? Value { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiModelModalities.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiModelModalities 8 | { 9 | [JsonProperty("input")] 10 | public AiModelModalityDetails Input { get; set; } 11 | 12 | [JsonProperty("output")] 13 | public AiModelModalityDetails Output { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiPromptMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiPromptMode 9 | { 10 | [Description("basic")] 11 | Basic, 12 | 13 | [Description("advanced")] 14 | Advanced, 15 | 16 | [Description("external")] 17 | External 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/GenerateAiReport.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public abstract class GenerateAiReport 9 | { 10 | [JsonProperty("type")] 11 | public abstract AiReportType Type { get; } 12 | 13 | [JsonProperty("schema")] 14 | public AiReportSchemaBase Schema { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Dictionaries/Dictionary.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Dictionaries 6 | { 7 | [PublicAPI] 8 | public class Dictionary 9 | { 10 | [JsonProperty("languageId")] 11 | public string LanguageId { get; set; } 12 | 13 | [JsonProperty("words")] 14 | public string[] Words { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/LanguageRecognitionProvider.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public enum LanguageRecognitionProvider 9 | { 10 | [Description("crowdin")] 11 | Crowdin, 12 | 13 | [Description("engine")] 14 | Engine 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/AddTaskCommentRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class AddTaskCommentRequest 9 | { 10 | [JsonProperty("text")] 11 | public string Text { get; set; } 12 | 13 | [JsonProperty("timeSpent")] 14 | public long? TimeSpent { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/UserStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public enum UserStatus 9 | { 10 | [Description("active")] 11 | Active, 12 | 13 | [Description("pending")] 14 | Pending, 15 | 16 | [Description("blocked")] 17 | Blocked 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowProofreadingConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Workflows 7 | { 8 | [PublicAPI] 9 | public class WorkflowProofreadingConfig : WorkflowConfig 10 | { 11 | [JsonProperty("assignees")] 12 | public IDictionary Assignees { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowTranslationConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Workflows 7 | { 8 | [PublicAPI] 9 | public class WorkflowTranslationConfig : WorkflowConfig 10 | { 11 | [JsonProperty("assignees")] 12 | public IDictionary Assignees { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples/Crowdin.Api.Samples.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiTool.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public class AiTool 11 | { 12 | [JsonProperty("type")] 13 | public AiToolType Type { get; set; } 14 | 15 | [JsonProperty("function")] 16 | public AiToolFunction Function { get; set; } = null!; 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/CrowdinApiResult.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Net; 3 | using System.Net.Http.Headers; 4 | using Newtonsoft.Json.Linq; 5 | 6 | namespace Crowdin.Api.Core 7 | { 8 | internal class CrowdinApiResult 9 | { 10 | internal HttpStatusCode StatusCode { get; set; } 11 | 12 | internal JObject JsonObject { get; set; } 13 | 14 | internal HttpResponseHeaders Headers { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Issues/IssueStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Issues 6 | { 7 | [PublicAPI] 8 | public enum IssueStatus 9 | { 10 | [Description("all")] 11 | All, 12 | 13 | [Description("resolved")] 14 | Resolved, 15 | 16 | [Description("unresolved")] 17 | UnResolved 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportLabelIncludeType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ReportLabelIncludeType 9 | { 10 | [Description("strings_with_label")] 11 | StringsWithLabel, 12 | 13 | [Description("strings_without_label")] 14 | StringsWithoutLabel 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/CreateTmSegmentRecordsRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.TranslationMemory 7 | { 8 | [PublicAPI] 9 | public class CreateTmSegmentRecordsRequest 10 | { 11 | [JsonProperty("records")] 12 | public ICollection Records { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/PreTranslationMethod.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public enum PreTranslationMethod 9 | { 10 | [Description("tm")] 11 | Tm, 12 | 13 | [Description("mt")] 14 | Mt, 15 | 16 | [Description("ai")] 17 | Ai 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/RequestType.cs: -------------------------------------------------------------------------------- 1 | 2 | using Crowdin.Api.Core.Converters; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Webhooks 6 | { 7 | [PublicAPI] 8 | [StrictStringRepresentation] 9 | public enum RequestType 10 | { 11 | // ReSharper disable InconsistentNaming 12 | GET, 13 | 14 | POST 15 | // ReSharper restore InconsistentNaming 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/AddAssetReferenceRequest.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.SourceFiles 5 | { 6 | [PublicAPI] 7 | public class AddAssetReferenceRequest 8 | { 9 | [JsonProperty("storageId")] 10 | public long StorageId { get; set; } 11 | 12 | [JsonProperty("name")] 13 | public string Name { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/TmFileFormat.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.TranslationMemory 6 | { 7 | [PublicAPI] 8 | public enum TmFileFormat 9 | { 10 | [Description("tmx")] 11 | Tmx, 12 | 13 | [Description("csv")] 14 | Csv, 15 | 16 | [Description("xlsx")] 17 | Xlsx 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/BaseRatesForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public class BaseRatesForm 9 | { 10 | [JsonProperty("fullTranslation")] 11 | public float FullTranslation { get; set; } 12 | 13 | [JsonProperty("proofread")] 14 | public float Proofread { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/UpdateScreenshotRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Screenshots 6 | { 7 | [PublicAPI] 8 | public class UpdateScreenshotRequest 9 | { 10 | [JsonProperty("storageId")] 11 | public long StorageId { get; set; } 12 | 13 | [JsonProperty("name")] 14 | public string Name { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/Organization/AddWebhookRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Webhooks.Organization 7 | { 8 | [PublicAPI] 9 | public class AddWebhookRequest : AddWebhookRequestBase 10 | { 11 | [JsonProperty("events")] 12 | public ICollection Events { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/Organization/OrganizationEventType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Webhooks.Organization 6 | { 7 | [PublicAPI] 8 | public enum OrganizationEventType 9 | { 10 | [Description("project.created")] 11 | ProjectCreated, 12 | 13 | [Description("project.deleted")] 14 | ProjectDeleted 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/GraphQL/IGraphQLApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json.Linq; 6 | 7 | namespace Crowdin.Api.GraphQL 8 | { 9 | [PublicAPI] 10 | public interface IGraphQLApiExecutor 11 | { 12 | Task ExecuteQuery(GraphQLRequest request); 13 | 14 | Task ExecuteQuery(GraphQLRequest request); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/WordAlignment.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class WordAlignment 9 | { 10 | [JsonProperty("text")] 11 | public string Text { get; set; } 12 | 13 | [JsonProperty("alignments")] 14 | public Alignment[] Alignments { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/TmSegmentResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationMemory 6 | { 7 | [PublicAPI] 8 | public class TmSegmentResource 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("records")] 14 | public TmSegmentRecord[] Records { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/AddTaskSettingsTemplate.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class AddTaskSettingsTemplate 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | 13 | [JsonProperty("config")] 14 | public TaskSettingsTemplateConfigForm Config { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/TmSegmentRecordForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationMemory 6 | { 7 | [PublicAPI] 8 | public class TmSegmentRecordForm 9 | { 10 | [JsonProperty("languageId")] 11 | public string LanguageId { get; set; } 12 | 13 | [JsonProperty("text")] 14 | public string Text { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationFormat.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public enum TranslationFormat 9 | { 10 | [Description("xliff")] 11 | Xliff, 12 | 13 | [Description("android")] 14 | Android, 15 | 16 | [Description("macosx")] 17 | MacOsX 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/OtherLanguageTranslationsConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public class OtherLanguageTranslationsConfig 9 | { 10 | [JsonProperty("isEnabled")] 11 | public bool IsEnabled { get; set; } 12 | 13 | [JsonProperty("languageIds")] 14 | public string[] LanguageIds { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/LanguageAccessRule.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | public class LanguageAccessRule 11 | { 12 | [JsonProperty("allContent")] 13 | public bool? AllContent { get; set; } 14 | 15 | [JsonProperty("workflowStepIds")] 16 | public object? WorkflowStepIds { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/FileStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.SourceFiles 6 | { 7 | [PublicAPI] 8 | public enum FileStatus 9 | { 10 | [Description("active")] 11 | Active, 12 | 13 | [Description("not_imported")] 14 | NotImported, 15 | 16 | [Description("not_configured")] 17 | NotConfigured 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/AddVoteRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class AddVoteRequest 9 | { 10 | [JsonProperty("mark")] 11 | public TranslationVoteMark Mark { get; set; } 12 | 13 | [JsonProperty("translationId")] 14 | public long? TranslationId { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/Organization/EnterpriseAddWebhookRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Webhooks.Organization 7 | { 8 | [PublicAPI] 9 | public class EnterpriseAddWebhookRequest : AddWebhookRequestBase 10 | { 11 | [JsonProperty("events")] 12 | public ICollection Events { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslatorRole.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | public class TranslatorRole 11 | { 12 | [JsonProperty("name")] 13 | public TranslatorRoleName? Name { get; set; } 14 | 15 | [JsonProperty("permissions")] 16 | public TranslatorRolePermissions? Permissions { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/GoogleAutoMLTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | // ReSharper disable once InconsistentNaming 9 | public class GoogleAutoMLTranslateCredentials : IMtCredentialsForm 10 | { 11 | [JsonProperty("credentials")] 12 | public string Credentials { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/ActionRule.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.AI 7 | { 8 | [PublicAPI] 9 | public class ActionRule 10 | { 11 | [JsonProperty("action")] 12 | public AiPromptAction? Action { get; set; } 13 | 14 | [JsonProperty("availableAiModelIds")] 15 | public List AvailableAiModelIds { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/ApplicationPermission.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System; 4 | 5 | namespace Crowdin.Api.Applications 6 | { 7 | [PublicAPI] 8 | public class ApplicationPermissions 9 | { 10 | [JsonProperty("user")] 11 | public ApplicationUser User { get; set; } 12 | 13 | [JsonProperty("project")] 14 | public ApplicationProject Project { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/Label.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Labels 6 | { 7 | [PublicAPI] 8 | public class Label 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("title")] 14 | public string Title { get; set; } 15 | 16 | [JsonProperty("isSystem")] 17 | public bool IsSystem { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/CrowdinCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api 7 | { 8 | [PublicAPI] 9 | public class CrowdinCredentials 10 | { 11 | #pragma warning disable CS8618 12 | public string AccessToken { get; set; } 13 | #pragma warning restore CS8618 14 | 15 | public string? Organization { get; set; } 16 | 17 | public string? BaseUrl { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/DistributionReleaseStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Distributions 6 | { 7 | [PublicAPI] 8 | public enum DistributionReleaseStatus 9 | { 10 | [Description("inProgress")] 11 | InProgress, 12 | 13 | [Description("success")] 14 | Success, 15 | 16 | [Description("failed")] 17 | Failed 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/TmContextType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public enum TmContextType 9 | { 10 | [Description("segmentContext")] 11 | SegmentContext, 12 | 13 | [Description("auto")] 14 | Auto, 15 | 16 | [Description("prevAndNextSegment")] 17 | PrevAndNextSegment 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/ProjectTeamResources.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Teams 8 | { 9 | [PublicAPI] 10 | public class ProjectTeamResources 11 | { 12 | [JsonProperty("skipped")] 13 | public ProjectTeamResource? Skipped { get; set; } 14 | 15 | [JsonProperty("added")] 16 | public ProjectTeamResource? Added { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslatorRolePermissions.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | public class TranslatorRolePermissions 11 | { 12 | [JsonProperty("allLanguages")] 13 | public bool? AllLanguages { get; set; } 14 | 15 | [JsonProperty("languagesAccess")] 16 | public object? LanguagesAccess { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiModelModalityDetails.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiModelModalityDetails 8 | { 9 | [JsonProperty("text")] 10 | public bool Text { get; set; } 11 | 12 | [JsonProperty("image")] 13 | public bool Image { get; set; } 14 | 15 | [JsonProperty("audio")] 16 | public bool Audio { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/Constants.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Crowdin.Api.Core 3 | { 4 | internal static class MessageTexts 5 | { 6 | public const string DeprecatedProperty = "This property is deprecated, please avoid using it"; 7 | 8 | public const string DeprecatedModel = "This model is deprecated, see API docs for alternative"; 9 | 10 | public const string UseBranchesNamespace = "This API is deprecated, see Crowdin.Api.Branches namespace"; 11 | } 12 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/TeamPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Teams 7 | { 8 | [PublicAPI] 9 | public class TeamPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TeamPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TeamPatchPath 17 | { 18 | [Description("/name")] 19 | Name 20 | } 21 | } -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/CrowdinActions.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace Crowdin.Api.Samples.Actions 3 | { 4 | public partial class CrowdinActions 5 | { 6 | private readonly ICrowdinApiClient _crowdinApiClient; 7 | 8 | public CrowdinActions(string accessToken) 9 | { 10 | _crowdinApiClient = new CrowdinApiClient(new CrowdinCredentials 11 | { 12 | AccessToken = accessToken 13 | }); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/GlossaryFormat.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public enum GlossaryFormat 9 | { 10 | [Description("tbx")] 11 | Tbx, 12 | 13 | [Description("tbx_v3")] 14 | TbxV3, 15 | 16 | [Description("csv")] 17 | Csv, 18 | 19 | [Description("xlsx")] 20 | Xlsx 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Labels/LabelPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Labels 7 | { 8 | [PublicAPI] 9 | public class LabelPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public LabelPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum LabelPatchPath 17 | { 18 | [Description("/title")] 19 | Title 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskProgress.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class TaskProgress 9 | { 10 | [JsonProperty("total")] 11 | public int Total { get; set; } 12 | 13 | [JsonProperty("done")] 14 | public int Done { get; set; } 15 | 16 | [JsonProperty("percent")] 17 | public int Percent { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowTmPreTranslationConfig.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowTmPreTranslationConfig : WorkflowConfig 9 | { 10 | [JsonProperty("minRelevant")] 11 | public string MinRelevant { get; set; } 12 | 13 | [JsonProperty("autoSubstitution")] 14 | public int AutoSubstitution { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Issues/IssuePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Issues 7 | { 8 | [PublicAPI] 9 | public class IssuePatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public IssuePatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum IssuePatchPath 17 | { 18 | [Description("/status")] 19 | Status 20 | } 21 | } -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/Crowdin.Api.Samples.Actions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/AmazonTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class AmazonTranslateCredentials : IMtCredentialsForm 9 | { 10 | [JsonProperty("accessKey")] 11 | public string AccessKey { get; set; } 12 | 13 | [JsonProperty("secretKey")] 14 | public string SecretKey { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/OrganizationRole.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public enum OrganizationRole 9 | { 10 | [Description("admin")] 11 | Admin, 12 | 13 | [Description("manager")] 14 | Manager, 15 | 16 | [Description("vendor")] 17 | Vendor, 18 | 19 | [Description("client")] 20 | Client 21 | } 22 | } -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/README.md: -------------------------------------------------------------------------------- 1 | # Use Cases 2 | 3 | - [Create a File](Actions/1_CreateFile.cs) 4 | - [Update a File](Actions/2_UpdateFile.cs) 5 | - [Create a Translation Memory](Actions/3_CreateTm.cs) 6 | - [Create a Glossary](Actions/4_CreateGlossary.cs) 7 | - [Pre-Translate Project](Actions/5_PreTranslateProject.cs) 8 | - [Download Translations](Actions/6_DownloadTranslations.cs) 9 | - [Generate Report](Actions/7_GenerateReport.cs) 10 | - [Execute GraphQL query](Actions/8_GraphQL.cs) 11 | -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiSettingsShortcuts.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public class AiSettingsShortcuts 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | 13 | [JsonProperty("prompt")] 14 | public string Prompt { get; set; } 15 | 16 | [JsonProperty("enabled")] 17 | public bool Enabled { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/TermGender.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public enum TermGender 9 | { 10 | [Description("masculine")] 11 | Masculine, 12 | 13 | [Description("feminine")] 14 | Feminine, 15 | 16 | [Description("neuter")] 17 | Neuter, 18 | 19 | [Description("other")] 20 | Other 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationImportSkipped.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace Crowdin.Api.Translations 4 | { 5 | public class TranslationImportSkipped 6 | { 7 | [JsonProperty("translationEqSource")] 8 | public int TranslationEqSource { get; set; } 9 | 10 | [JsonProperty("hiddenStrings")] 11 | public int HiddenStrings { get; set; } 12 | 13 | [JsonProperty("qaCheck")] 14 | public int QaCheck { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/AddBranchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Branches 8 | { 9 | [PublicAPI] 10 | public class AddBranchRequest 11 | { 12 | [JsonProperty("name")] 13 | #pragma warning disable CS8618 14 | public string Name { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("title")] 18 | public string? Title { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportUnit.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum ReportUnit 9 | { 10 | [Description("strings")] 11 | Strings, 12 | 13 | [Description("words")] 14 | Words, 15 | 16 | [Description("chars")] 17 | Chars, 18 | 19 | [Description("chars_with_spaces")] 20 | CharsWithSpaces 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslatorRoleName.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum TranslatorRoleName 9 | { 10 | [Description("translator")] 11 | Translator, 12 | 13 | [Description("proofreader")] 14 | Proofreader, 15 | 16 | [Description("owner")] 17 | Owner, 18 | 19 | [Description("manager")] 20 | Manager 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Vendors/VendorStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Vendors 6 | { 7 | [PublicAPI] 8 | public enum VendorStatus 9 | { 10 | [Description("pending")] 11 | Pending, 12 | 13 | [Description("confirmed")] 14 | Confirmed, 15 | 16 | [Description("rejected")] 17 | Rejected, 18 | 19 | [Description("deleted")] 20 | Deleted 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiModelFeatures.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.AI 5 | { 6 | [PublicAPI] 7 | public class AiModelFeatures 8 | { 9 | [JsonProperty("streaming")] 10 | public bool Streaming { get; set; } 11 | 12 | [JsonProperty("structuredOutput")] 13 | public bool StructuredOutput { get; set; } 14 | 15 | [JsonProperty("functionCalling")] 16 | public bool FunctionCalling { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/CloneBranchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Branches 8 | { 9 | [PublicAPI] 10 | public class CloneBranchRequest 11 | { 12 | [JsonProperty("name")] 13 | #pragma warning disable CS8618 14 | public string Name { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("title")] 18 | public string? Title { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/ExportGlossaryRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Glossaries 7 | { 8 | [PublicAPI] 9 | public class ExportGlossaryRequest 10 | { 11 | [JsonProperty("format")] 12 | public GlossaryFormat Format { get; set; } 13 | 14 | [JsonProperty("exportFields")] 15 | public ICollection ExportFields { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/GroupingParameter.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum GroupingParameter 9 | { 10 | [Description("user")] 11 | User, 12 | 13 | [Description("language")] 14 | Language, 15 | 16 | [Description("type")] 17 | Type, 18 | 19 | [Description("project")] 20 | Project 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskCost.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskCost 10 | { 11 | [JsonProperty("cost")] 12 | public float Cost { get; set; } 13 | 14 | [JsonProperty("date")] 15 | public DateTimeOffset Date { get; set; } 16 | 17 | [JsonProperty("currency")] 18 | public Currency Currency { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/ContentType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Webhooks 6 | { 7 | [PublicAPI] 8 | public enum ContentType 9 | { 10 | [Description("multipart/form-data")] 11 | MultipartFormData, 12 | 13 | [Description("application/json")] 14 | ApplicationJson, 15 | 16 | [Description("application/x-www-form-urlencoded")] 17 | ApplicationFormUrlencoded 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/BranchMergeStatusId.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Branches 6 | { 7 | [PublicAPI] 8 | public enum BranchMergeStatusId 9 | { 10 | [Description("conflict")] 11 | Conflict, 12 | 13 | [Description("failed")] 14 | Failed, 15 | 16 | [Description("inProgress")] 17 | InProgress, 18 | 19 | [Description("merged")] 20 | Merged 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/AddProjectFileFormatSettingsRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using Crowdin.Api.SourceFiles; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.ProjectsGroups 7 | { 8 | [PublicAPI] 9 | public class AddProjectFileFormatSettingsRequest 10 | { 11 | [JsonProperty("format")] 12 | public ProjectFileType Format { get; set; } 13 | 14 | [JsonProperty("settings")] 15 | public FileFormatSettings Settings { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/AddProjectStringsExporterSettingsRequest.cs: -------------------------------------------------------------------------------- 1 | using Crowdin.Api.SourceFiles; 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class AddProjectStringsExporterSettingsRequest 9 | { 10 | [JsonProperty("format")] 11 | public ProjectFileType Format { get; set; } 12 | 13 | [JsonProperty("settings")] 14 | public StringsExporterSettings Settings { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/AddGlossaryRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public class AddGlossaryRequest 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | 13 | [JsonProperty("languageId")] 14 | public string LanguageId { get; set; } 15 | 16 | [JsonProperty("groupId")] 17 | public long? GroupId { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/TermStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public enum TermStatus 9 | { 10 | [Description("preferred")] 11 | Preferred, 12 | 13 | [Description("admitted")] 14 | Admitted, 15 | 16 | [Description("not recommended")] 17 | NotRecommended, 18 | 19 | [Description("obsolete")] 20 | Obsolete 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/AddTmRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationMemory 6 | { 7 | [PublicAPI] 8 | public class AddTmRequest 9 | { 10 | [JsonProperty("name")] 11 | public string Name { get; set; } 12 | 13 | [JsonProperty("languageId")] 14 | public string LanguageId { get; set; } 15 | 16 | [JsonProperty("groupId")] 17 | public long? GroupId { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/GroupManager.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | using Crowdin.Api.Teams; 6 | 7 | namespace Crowdin.Api.Users 8 | { 9 | [PublicAPI] 10 | public class GroupManager 11 | { 12 | [JsonProperty("id")] 13 | public long Id { get; set; } 14 | 15 | [JsonProperty("user")] 16 | public UserEnterprise User { get; set; } 17 | 18 | [JsonProperty("teams")] 19 | public Team[] Teams { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/InstallationPatch.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System.ComponentModel; 4 | 5 | namespace Crowdin.Api.Applications 6 | { 7 | [PublicAPI] 8 | public class InstallationPatch: PatchEntry 9 | { 10 | [JsonProperty("path")] 11 | public InstallationPatchPath Path { get; set; } 12 | } 13 | 14 | [PublicAPI] 15 | public enum InstallationPatchPath 16 | { 17 | [Description("/permissions")] 18 | Permissions 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Core/Resilience/RetryConfiguration.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using JetBrains.Annotations; 5 | 6 | namespace Crowdin.Api.Core.Resilience 7 | { 8 | [PublicAPI] 9 | public class RetryConfiguration 10 | { 11 | public int RetriesCount { get; set; } 12 | 13 | public int WaitIntervalMilliseconds { get; set; } 14 | 15 | public ICollection> SkipRetryConditions { get; set; } = new List>(); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/CharTransformationMode.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public enum CharTransformationMode 9 | { 10 | [Description("asian")] 11 | Asian, 12 | 13 | [Description("cyrillic")] 14 | Cyrillic, 15 | 16 | [Description("european")] 17 | European, 18 | 19 | [Description("arabic")] 20 | Arabic 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/PreTranslationPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Translations 7 | { 8 | [PublicAPI] 9 | public class PreTranslationPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public PreTranslationPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum PreTranslationPatchPath 17 | { 18 | [Description("/status")] 19 | Status 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/AddTeamMembersResponse.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Teams 6 | { 7 | [PublicAPI] 8 | public class AddTeamMembersResponse 9 | { 10 | [JsonProperty("skipped")] 11 | public TeamMember[] Skipped { get; set; } 12 | 13 | [JsonProperty("added")] 14 | public TeamMember[] Added { get; set; } 15 | 16 | [JsonProperty("pagination")] 17 | public Pagination Pagination { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiToolFunction.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public class AiToolFunction 11 | { 12 | [JsonProperty("name")] 13 | public string Name { get; set; } = null!; 14 | 15 | [JsonProperty("description")] 16 | public string? Description { get; set; } 17 | 18 | [JsonProperty("parameters")] 19 | public object? Parameters { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/ConceptLanguageDetailsForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public class ConceptLanguageDetailsForm 9 | { 10 | [JsonProperty("languageId")] 11 | public string LanguageId { get; set; } 12 | 13 | [JsonProperty("definition")] 14 | public string Definition { get; set; } 15 | 16 | [JsonProperty("note")] 17 | public string Note { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskArchivedStatusPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskArchivedStatusPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TaskArchivedStatusPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TaskArchivedStatusPatchPath 17 | { 18 | [Description("/isArchived")] 19 | IsArchived 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/ProjectMembersResponse.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public class ProjectMembersResponse 9 | { 10 | [JsonProperty("skipped")] 11 | public ProjectMember[] Skipped { get; set; } 12 | 13 | [JsonProperty("added")] 14 | public ProjectMember[] Added { get; set; } 15 | 16 | [JsonProperty("pagination")] 17 | public Pagination Pagination { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiSettings.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public class AiSettings 9 | { 10 | [JsonProperty("assistActionAiPromptId")] 11 | public long AssistActionAiPromptId { get; set; } 12 | 13 | [JsonProperty("showSuggestion")] 14 | public bool ShowSuggestion { get; set; } 15 | 16 | [JsonProperty("shortcuts")] 17 | public AiSettingsShortcuts[] Shortcuts { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/BuildStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum BuildStatus 9 | { 10 | [Description("created")] 11 | Created, 12 | 13 | [Description("in_progress")] 14 | InProgress, 15 | 16 | [Description("finished")] 17 | Finished, 18 | 19 | [Description("failed")] 20 | Failed, 21 | 22 | [Description("canceled")] 23 | Canceled 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceStrings/UpdateOption.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.SourceStrings 6 | { 7 | [PublicAPI] 8 | public enum UpdateOption 9 | { 10 | [Description("clear_translations_and_approvals")] 11 | ClearTranslationsAndApprovals, 12 | 13 | [Description("keep_translations")] 14 | KeepTranslations, 15 | 16 | [Description("keep_translations_and_approvals")] 17 | KeepTranslationsAndApprovals 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/TmSegmentRecordPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.TranslationMemory 7 | { 8 | [PublicAPI] 9 | public class TmSegmentRecordPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TmSegmentRecordPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TmSegmentRecordPatchPath 17 | { 18 | [Description("/text")] 19 | Text 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/AutoApproveOption.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public enum AutoApproveOption 9 | { 10 | [Description("all")] 11 | All, 12 | 13 | [Description("exceptAutoSubstituted")] 14 | ExceptAutoSubstituted, 15 | 16 | [Description("perfectMatchOnly")] 17 | PerfectMatchOnly, 18 | 19 | [Description("none")] 20 | None 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/OperationStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum OperationStatus 9 | { 10 | [Description("created")] 11 | Created, 12 | 13 | [Description("inProgress")] 14 | InProgress, 15 | 16 | [Description("finished")] 17 | Finished, 18 | 19 | [Description("failed")] 20 | Failed, 21 | 22 | [Description("canceled")] 23 | Canceled 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/FileUpdateOption.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.SourceFiles 6 | { 7 | [PublicAPI] 8 | public enum FileUpdateOption 9 | { 10 | [Description("clear_translations_and_approvals")] 11 | ClearTranslationsAndApprovals, 12 | 13 | [Description("keep_translations")] 14 | KeepTranslations, 15 | 16 | [Description("keep_translations_and_approvals")] 17 | KeepTranslationsAndApprovals 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/InstallApplicationRequest.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api.Applications 7 | { 8 | [PublicAPI] 9 | public class InstallApplicationRequest 10 | { 11 | [JsonProperty("url")] 12 | #pragma warning disable CS8618 13 | public string Url { get; set; } 14 | #pragma warning restore CS8618 15 | 16 | [JsonProperty("permissions")] 17 | public ApplicationPermissions? Permissions { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/Project.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class Project : ProjectBase 9 | { 10 | [JsonProperty("languageAccessPolicy")] 11 | public LanguageAccessPolicy LanguageAccessPolicy { get; set; } 12 | 13 | [JsonProperty("cname")] 14 | public string Cname { get; set; } 15 | 16 | [JsonProperty("visibility")] 17 | public ProjectVisibility Visibility { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/Branch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | using Crowdin.Api.Core; 8 | 9 | namespace Crowdin.Api.SourceFiles 10 | { 11 | [PublicAPI] 12 | [Obsolete(MessageTexts.UseBranchesNamespace)] 13 | public class Branch : Crowdin.Api.Branches.Branch 14 | { 15 | [JsonProperty("exportPattern")] 16 | public string ExportPattern { get; set; } 17 | 18 | [JsonProperty("priority")] 19 | public Priority Priority { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiHyperParameters.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public class AiHyperParameters 11 | { 12 | [JsonProperty("batchSize")] 13 | public long? BatchSize { get; set; } 14 | 15 | [JsonProperty("learningRateMultiplier")] 16 | public float? LearningRateMultiplier { get; set; } 17 | 18 | [JsonProperty("nEpochs")] 19 | public long? NEpochs { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Dictionaries/IDictionariesApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | #nullable enable 8 | 9 | namespace Crowdin.Api.Dictionaries 10 | { 11 | [PublicAPI] 12 | public interface IDictionariesApiExecutor 13 | { 14 | Task> ListDictionaries(long projectId, string? languageIds = null); 15 | 16 | Task EditDictionary(long projectId, string languageId, IEnumerable patches); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/Position.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Screenshots 6 | { 7 | [PublicAPI] 8 | public class Position 9 | { 10 | [JsonProperty("x")] 11 | public int X { get; set; } 12 | 13 | [JsonProperty("y")] 14 | public int Y { get; set; } 15 | 16 | [JsonProperty("width")] 17 | public int Width { get; set; } 18 | 19 | [JsonProperty("height")] 20 | public int Height { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/TagPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Screenshots 7 | { 8 | [PublicAPI] 9 | public class TagPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TagPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TagPatchPath 17 | { 18 | [Description("/stringId")] 19 | StringId, 20 | 21 | [Description("/position")] 22 | Position 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringCorrections/AddCorrectionRequest.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringCorrections 6 | { 7 | [PublicAPI] 8 | public class AddCorrectionRequest 9 | { 10 | [JsonProperty("stringId")] 11 | public long StringId { get; set; } 12 | 13 | [JsonProperty("text")] 14 | public string Text { get; set; } 15 | 16 | [JsonProperty("pluralCategoryName")] 17 | public string PluralCategoryName { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Storage/IStorageApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.Storage 8 | { 9 | [PublicAPI] 10 | public interface IStorageApiExecutor 11 | { 12 | Task> ListStorages(int limit = 25, int offset = 0); 13 | 14 | Task AddStorage(Stream fileStream, string filename); 15 | 16 | Task GetStorage(long storageId); 17 | 18 | Task DeleteStorage(long storageId); 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/IssueType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.StringComments 6 | { 7 | [PublicAPI] 8 | public enum IssueType 9 | { 10 | [Description("general_question")] 11 | GeneralQuestion, 12 | 13 | [Description("translation_mistake")] 14 | TranslationMistake, 15 | 16 | [Description("context_request")] 17 | ContextRequest, 18 | 19 | [Description("source_mistake")] 20 | SourceMistake 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/ConcordanceSearchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public class ConcordanceSearchRequest 9 | { 10 | [JsonProperty("sourceLanguageId")] 11 | public string SourceLanguageId { get; set; } 12 | 13 | [JsonProperty("targetLanguageId")] 14 | public string TargetLanguageId { get; set; } 15 | 16 | [JsonProperty("expression")] 17 | public string Expression { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/MatchType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | public enum MatchType 9 | { 10 | [Description("perfect")] 11 | Perfect, 12 | 13 | // ReSharper disable InconsistentNaming 14 | [Description("100")] 15 | Option_100, 16 | 17 | [Description("99-82")] 18 | Option_99_82, 19 | 20 | [Description("81-60")] 21 | Option_81_60 22 | // ReSharper restore InconsistentNaming 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/GlossaryPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Glossaries 7 | { 8 | [PublicAPI] 9 | public class GlossaryPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public GlossaryPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum GlossaryPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/languageId")] 22 | LanguageId 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/ScreenshotPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Screenshots 7 | { 8 | [PublicAPI] 9 | public class ScreenshotPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public ScreenshotPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum ScreenshotPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/labelIds")] 22 | LabelIds 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskCommentPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskCommentPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TaskCommentPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TaskCommentPatchPath 17 | { 18 | [Description("/text")] 19 | Text, 20 | 21 | [Description("/timeSpent")] 22 | TimeSpent 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public enum WorkflowStatus 9 | { 10 | [Description("todo")] 11 | ToDo, 12 | 13 | [Description("done")] 14 | Done, 15 | 16 | [Description("pending")] 17 | Pending, 18 | 19 | [Description("incomplete")] 20 | Incomplete, 21 | 22 | [Description("need_review")] 23 | NeedReview 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/MicrosoftTranslateCredentials.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.MachineTranslationEngines 8 | { 9 | [PublicAPI] 10 | public class MicrosoftTranslateCredentials : IMtCredentialsForm 11 | { 12 | [JsonProperty("apiKey")] 13 | #pragma warning disable CS8618 14 | public string ApiKey { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("model")] 18 | public string? Model { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/TranslationAlignmentRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class TranslationAlignmentRequest 9 | { 10 | [JsonProperty("sourceLanguageId")] 11 | public string SourceLanguageId { get; set; } 12 | 13 | [JsonProperty("targetLanguageId")] 14 | public string TargetLanguageId { get; set; } 15 | 16 | [JsonProperty("text")] 17 | public string Text { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Vendors/Vendor.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Vendors 6 | { 7 | [PublicAPI] 8 | public class Vendor 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("name")] 14 | public string Name { get; set; } 15 | 16 | [JsonProperty("description")] 17 | public string Description { get; set; } 18 | 19 | [JsonProperty("status")] 20 | public VendorStatus Status { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/NotificationSettings.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class NotificationSettings 9 | { 10 | [JsonProperty("translatorNewStrings")] 11 | public bool? TranslatorNewStrings { get; set; } 12 | 13 | [JsonProperty("managerNewStrings")] 14 | public bool? ManagerNewStrings { get; set; } 15 | 16 | [JsonProperty("managerLanguageCompleted")] 17 | public bool? ManagerLanguageCompleted { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/PatchOperation.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public enum PatchOperation 9 | { 10 | [Description("add")] 11 | Add, 12 | 13 | [Description("copy")] 14 | Copy, 15 | 16 | [Description("move")] 17 | Move, 18 | 19 | [Description("remove")] 20 | Remove, 21 | 22 | [Description("replace")] 23 | Replace, 24 | 25 | [Description("test")] 26 | Test 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/Organization/EnterpriseOrgEventType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Webhooks.Organization 6 | { 7 | [PublicAPI] 8 | public enum EnterpriseOrgEventType 9 | { 10 | [Description("group.created")] 11 | GroupCreated, 12 | 13 | [Description("group.deleted")] 14 | GroupDeleted, 15 | 16 | [Description("project.created")] 17 | ProjectCreated, 18 | 19 | [Description("project.deleted")] 20 | ProjectDeleted 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/ExportTmRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.TranslationMemory 8 | { 9 | [PublicAPI] 10 | public class ExportTmRequest 11 | { 12 | [JsonProperty("sourceLanguageId")] 13 | public string? SourceLanguageId { get; set; } 14 | 15 | [JsonProperty("targetLanguageId")] 16 | public string? TargetLanguageId { get; set; } 17 | 18 | [JsonProperty("format")] 19 | public TmFileFormat? Format { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Notifications/INotificationsApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Threading.Tasks; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Notifications 6 | { 7 | [PublicAPI] 8 | public interface INotificationsApiExecutor 9 | { 10 | Task SendNotificationToAuthenticatedUser(SendNotificationToAuthenticatedUserRequest request); 11 | 12 | Task SendNotificationToOrganizationMembers(SendNotificationToOrganizationMembersRequest request); 13 | 14 | Task SendNotificationToProjectMembers(long projectId, SendNotificationToProjectMembersRequest request); 15 | } 16 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/User.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class User 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("username")] 14 | public string Username { get; set; } 15 | 16 | [JsonProperty("fullName")] 17 | public string FullName { get; set; } 18 | 19 | [JsonProperty("avatarUrl")] 20 | public string AvatarUrl { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/AddBranchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | using Crowdin.Api.Core; 8 | 9 | #nullable enable 10 | 11 | namespace Crowdin.Api.SourceFiles 12 | { 13 | [PublicAPI] 14 | [Obsolete(MessageTexts.UseBranchesNamespace)] 15 | public class AddBranchRequest : Crowdin.Api.Branches.AddBranchRequest 16 | { 17 | [JsonProperty("exportPattern")] 18 | public string? ExportPattern { get; set; } 19 | 20 | [JsonProperty("priority")] 21 | public Priority? Priority { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/StringCommentPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.StringComments 7 | { 8 | [PublicAPI] 9 | public class StringCommentPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public StringCommentPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum StringCommentPatchPath 17 | { 18 | [Description("/text")] 19 | Text, 20 | 21 | [Description("/issueStatus")] 22 | IssueStatus 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskSettingsTemplatePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskSettingsTemplatePatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TaskSettingsTemplatePatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TaskSettingsTemplatePatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/config")] 22 | Config 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/LanguageReference.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Tasks 8 | { 9 | [PublicAPI] 10 | public class LanguageReference 11 | { 12 | [JsonProperty("languageId")] 13 | #pragma warning disable CS8618 14 | public string LanguageId { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("userIds")] 18 | public long[]? UserIds { get; set; } 19 | 20 | [JsonProperty("teamIds")] 21 | public long[]? TeamIds { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Issues/IssueType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Issues 6 | { 7 | [PublicAPI] 8 | public enum IssueType 9 | { 10 | [Description("all")] 11 | All, 12 | 13 | [Description("general_question")] 14 | GeneralQuestion, 15 | 16 | [Description("translation_mistake")] 17 | TranslationMistake, 18 | 19 | [Description("context_request")] 20 | ContextRequest, 21 | 22 | [Description("source_mistake")] 23 | SourceMistake 24 | } 25 | } -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/Actions/CrowdinApiClientExtensions.cs: -------------------------------------------------------------------------------- 1 | 2 | using Crowdin.Api.Storage; 3 | 4 | namespace Crowdin.Api.Samples.Actions 5 | { 6 | public static class CrowdinApiClientExtensions 7 | { 8 | public static async Task AddStorage(this ICrowdinApiClient apiClient, string filepath) 9 | { 10 | string fileName = Path.GetFileName(filepath); 11 | 12 | await using FileStream fileStream = File.OpenRead(filepath); 13 | 14 | return await apiClient.Storage.AddStorage(fileStream, fileName); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/AddGroupRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.ProjectsGroups 8 | { 9 | [PublicAPI] 10 | public class AddGroupRequest 11 | { 12 | [JsonProperty("name")] 13 | #pragma warning disable CS8618 14 | public string Name { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("parentId")] 18 | public long? ParentId { get; set; } 19 | 20 | [JsonProperty("description")] 21 | public string? Description { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public enum TaskStatus 9 | { 10 | [Description("todo")] 11 | Todo, 12 | 13 | [Description("pending")] 14 | Pending, 15 | 16 | [Description("in_progress")] 17 | InProgress, 18 | 19 | [Description("review")] 20 | Review, 21 | 22 | [Description("done")] 23 | Done, 24 | 25 | [Description("closed")] 26 | Closed 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Fields/FieldEntity.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Fields 5 | { 6 | [PublicAPI] 7 | 8 | public enum FieldEntity 9 | { 10 | [Description("project")] 11 | Project, 12 | 13 | [Description("user")] 14 | User, 15 | 16 | [Description("task")] 17 | Task, 18 | 19 | [Description("file")] 20 | File, 21 | 22 | [Description("translation")] 23 | Translation, 24 | 25 | [Description("string")] 26 | String, 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/AddScreenshotRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Screenshots 6 | { 7 | [PublicAPI] 8 | public class AddScreenshotRequest 9 | { 10 | [JsonProperty("storageId")] 11 | public long StorageId { get; set; } 12 | 13 | [JsonProperty("name")] 14 | public string Name { get; set; } 15 | 16 | [JsonProperty("autoTag")] 17 | public bool? AutoTag { get; set; } 18 | 19 | [JsonProperty("labelIds")] 20 | public long[] LabelIds { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/ApplicationModule.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace Crowdin.Api.Applications 6 | { 7 | [PublicAPI] 8 | public class ApplicationModule 9 | { 10 | [JsonProperty("key")] 11 | public string Key { get; set; } 12 | 13 | [JsonProperty("type")] 14 | public string Type { get; set; } 15 | 16 | [JsonProperty("data")] 17 | public JObject Data { get; set; } 18 | 19 | [JsonProperty("authenticationType")] 20 | public string AuthenticationType { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/PluralCategoryName.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public enum PluralCategoryName 9 | { 10 | [Description("zero")] 11 | Zero, 12 | 13 | [Description("one")] 14 | One, 15 | 16 | [Description("two")] 17 | Two, 18 | 19 | [Description("few")] 20 | Few, 21 | 22 | [Description("many")] 23 | Many, 24 | 25 | [Description("other")] 26 | Other 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/UserRole.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Users 6 | { 7 | [PublicAPI] 8 | public enum UserRole 9 | { 10 | [Description("all")] 11 | All, 12 | 13 | [Description("owner")] 14 | Owner, 15 | 16 | [Description("manager")] 17 | Manager, 18 | 19 | [Description("proofreader")] 20 | Proofreader, 21 | 22 | [Description("translator")] 23 | Translator, 24 | 25 | [Description("blocked")] 26 | Blocked 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/ImportGlossaryRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Glossaries 9 | { 10 | [PublicAPI] 11 | public class ImportGlossaryRequest 12 | { 13 | [JsonProperty("storageId")] 14 | public long StorageId { get; set; } 15 | 16 | [JsonProperty("scheme")] 17 | public IDictionary? Scheme { get; set; } 18 | 19 | [JsonProperty("firstLineContainsHeader")] 20 | public bool? FirstLineContainsHeader { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/StringsExporterSettings.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.ProjectsGroups 5 | { 6 | [PublicAPI] 7 | public class StringsExporterSettings 8 | { 9 | [JsonProperty("convertPlaceHolders")] 10 | public bool? ConvertPlaceHolders { get; set; } 11 | } 12 | 13 | [PublicAPI] 14 | public class AndroidStringsExporterSettings : StringsExporterSettings 15 | { 16 | 17 | } 18 | 19 | [PublicAPI] 20 | public class MacOsxStringsExporterSettings : StringsExporterSettings 21 | { 22 | 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Notifications/SendNotificationToOrganizationMembersRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using Crowdin.Api.Users; 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | namespace Crowdin.Api.Notifications 8 | { 9 | [PublicAPI] 10 | public class SendNotificationToOrganizationMembersRequest 11 | { 12 | [JsonProperty("userIds")] 13 | public ICollection UserIds { get; set; } 14 | 15 | [JsonProperty("role")] 16 | public UserRole? Role { get; set; } 17 | 18 | [JsonProperty("message")] 19 | public string Message { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Notifications/SendNotificationToProjectMembersRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using Crowdin.Api.Users; 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | namespace Crowdin.Api.Notifications 8 | { 9 | [PublicAPI] 10 | public class SendNotificationToProjectMembersRequest 11 | { 12 | [JsonProperty("userIds")] 13 | public ICollection UserIds { get; set; } 14 | 15 | [JsonProperty("role")] 16 | public UserRole? Role { get; set; } 17 | 18 | [JsonProperty("message")] 19 | public string Message { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/ImportTmRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.TranslationMemory 9 | { 10 | [PublicAPI] 11 | public class ImportTmRequest 12 | { 13 | [JsonProperty("storageId")] 14 | public long StorageId { get; set; } 15 | 16 | [JsonProperty("firstLineContainsHeader")] 17 | public bool? FirstLineContainsHeader { get; set; } 18 | 19 | [JsonProperty("scheme")] 20 | public IDictionary? Scheme { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/TmPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.TranslationMemory 7 | { 8 | [PublicAPI] 9 | public class TmPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public TmPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum TmPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/groupId")] 22 | GroupId, 23 | 24 | [Description("/languageId")] 25 | LanguageId 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/MergeBranchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Branches 6 | { 7 | [PublicAPI] 8 | public class MergeBranchRequest 9 | { 10 | [JsonProperty("deleteAfterMerge")] 11 | public bool? DeleteAfterMerge { get; set; } 12 | 13 | [JsonProperty("sourceBranchId")] 14 | public long SourceBranchId { get; set; } 15 | 16 | [JsonProperty("dryRun")] 17 | public bool? DryRun { get; set; } 18 | [JsonProperty("acceptSourceChanges")] 19 | public bool? AcceptSourceChanges { get; set; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/GraphQL/GraphQLRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | #nullable enable 8 | 9 | namespace Crowdin.Api.GraphQL 10 | { 11 | [PublicAPI] 12 | public class GraphQLRequest 13 | { 14 | [JsonProperty("query")] 15 | public string Query { get; set; } = null!; 16 | 17 | [JsonProperty("operationName")] 18 | public string? OperationName { get; set; } 19 | 20 | [JsonProperty("variables")] 21 | public IDictionary Variables { get; set; } = new Dictionary(0); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportIndividualRatesForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Reports 9 | { 10 | [PublicAPI] 11 | public class ReportIndividualRatesForm 12 | { 13 | [JsonProperty("languageIds")] 14 | public ICollection? LanguageIds { get; set; } 15 | 16 | [JsonProperty("userIds")] 17 | public ICollection? UserIds { get; set; } 18 | 19 | [JsonProperty("rates")] 20 | public ICollection? Rates { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/GenerateAiPromptCompletionRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.AI 9 | { 10 | [PublicAPI] 11 | public class GenerateAiPromptCompletionRequest 12 | { 13 | [JsonProperty("resources")] 14 | public AiPromptContextResources Resources { get; set; } = null!; 15 | 16 | [JsonProperty("tools")] 17 | public ICollection? Tools { get; set; } 18 | 19 | [JsonProperty("tool_choice")] 20 | public object? ToolChoice { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ErrorResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api 6 | { 7 | [PublicAPI] 8 | public class ErrorResource 9 | { 10 | [JsonProperty("key")] 11 | public string Key { get; set; } 12 | 13 | [JsonProperty("errors")] 14 | public AttributeError[] Errors { get; set; } 15 | } 16 | 17 | [PublicAPI] 18 | public class AttributeError 19 | { 20 | [JsonProperty("code")] 21 | public string Code { get; set; } 22 | 23 | [JsonProperty("message")] 24 | public string Message { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/TermType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public enum TermType 9 | { 10 | [Description("full form")] 11 | FullForm, 12 | 13 | [Description("acronym")] 14 | Acronym, 15 | 16 | [Description("abbreviation")] 17 | Abbreviation, 18 | 19 | [Description("short form")] 20 | ShortForm, 21 | 22 | [Description("phrase")] 23 | Phrase, 24 | 25 | [Description("variant")] 26 | Variant 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/GroupPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.ProjectsGroups 7 | { 8 | [PublicAPI] 9 | public class GroupPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public GroupPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum GroupPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/description")] 22 | Description, 23 | 24 | [Description("/parentId")] 25 | ParentId 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectFileFormatSettingsPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.ProjectsGroups 7 | { 8 | [PublicAPI] 9 | public class ProjectFileFormatSettingsPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public ProjectFileFormatSettingsPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum ProjectFileFormatSettingsPatchPath 17 | { 18 | [Description("/format")] 19 | Format, 20 | 21 | [Description("/settings")] 22 | Settings 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportCurrency.cs: -------------------------------------------------------------------------------- 1 | 2 | using Crowdin.Api.Core.Converters; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Reports 6 | { 7 | [PublicAPI] 8 | [StrictStringRepresentation] 9 | public enum ReportCurrency 10 | { 11 | USD, 12 | EUR, 13 | JPY, 14 | GBP, 15 | AUD, 16 | CAD, 17 | CHF, 18 | CNY, 19 | SEK, 20 | NZD, 21 | MXN, 22 | SGD, 23 | HKD, 24 | NOK, 25 | KRW, 26 | TRY, 27 | RUB, 28 | INR, 29 | BRL, 30 | ZAR, 31 | GEL, 32 | UAH 33 | } 34 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/VendorTaskPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class VendorTaskPatch : TaskPatchBase 10 | { 11 | [JsonProperty("path")] 12 | public VendorTaskPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum VendorTaskPatchPath 17 | { 18 | [Description("/title")] 19 | Title, 20 | 21 | [Description("/description")] 22 | Description, 23 | 24 | [Description("/status")] 25 | Status 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportFuzzyIndividualRatesForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Reports 9 | { 10 | [PublicAPI] 11 | public class ReportFuzzyIndividualRatesForm 12 | { 13 | [JsonProperty("languageIds")] 14 | public ICollection? LanguageIds { get; set; } 15 | 16 | [JsonProperty("userIds")] 17 | public ICollection? UserIds { get; set; } 18 | 19 | [JsonProperty("rates")] 20 | public ICollection? Rates { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationStatus/ProgressResourceStatus.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationStatus 6 | { 7 | [PublicAPI] 8 | public class ProgressResourceStatus 9 | { 10 | [JsonProperty("total")] 11 | public int Total { get; set; } 12 | 13 | [JsonProperty("translated")] 14 | public int Translated { get; set; } 15 | 16 | [JsonProperty("preTranslateAppliedTo")] 17 | public int PreTranslateAppliedTo { get; set; } 18 | 19 | [JsonProperty("approved")] 20 | public int Approved { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiProviderType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.AI 6 | { 7 | [PublicAPI] 8 | public enum AiProviderType 9 | { 10 | [Description("open_ai")] 11 | OpenAi, 12 | 13 | [Description("azure_open_ai")] 14 | AzureOpenAi, 15 | 16 | [Description("google_gemini")] 17 | GoogleGemini, 18 | 19 | [Description("mistral_ai")] 20 | MistralAi, 21 | 22 | [Description("anthropic")] 23 | Anthropic, 24 | 25 | [Description("custom_ai")] 26 | CustomAi 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/AddDistributionStringBasedRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Distributions 9 | { 10 | [PublicAPI] 11 | public class AddDistributionStringBasedRequest 12 | { 13 | 14 | [JsonProperty("name")] 15 | #pragma warning disable CS8618 16 | public string Name { get; set; } 17 | #pragma warning restore CS8618 18 | 19 | [JsonProperty("bundleIds")] 20 | #pragma warning disable CS8618 21 | public ICollection? BundleIds { get; set; } 22 | #pragma warning restore CS8618 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/GlossaryConcordanceResultResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public class GlossaryConcordanceResultResource 9 | { 10 | [JsonProperty("glossary")] 11 | public Glossary Glossary { get; set; } 12 | 13 | [JsonProperty("concept")] 14 | public Concept Concept { get; set; } 15 | 16 | [JsonProperty("sourceTerms")] 17 | public Term[] SourceTerms { get; set; } 18 | 19 | [JsonProperty("targetTerms")] 20 | public Term[] TargetTerms { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectStringsExporterSettingsPatch.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class ProjectStringsExporterSettingsPatch : PatchEntry 9 | { 10 | [JsonProperty("path")] 11 | public ProjectStringsExporterSettingsPatchPath Path { get; set; } 12 | } 13 | 14 | [PublicAPI] 15 | public enum ProjectStringsExporterSettingsPatchPath 16 | { 17 | [Description("/format")] 18 | Format, 19 | 20 | [Description("/settings")] 21 | Settings 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportApprovalIndividualRates.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Reports 9 | { 10 | [PublicAPI] 11 | public class ReportApprovalIndividualRates 12 | { 13 | [JsonProperty("languageIdsTo")] 14 | public ICollection? LanguageIdsTo { get; set; } 15 | 16 | [JsonProperty("userIds")] 17 | public ICollection? UserIds { get; set; } 18 | 19 | [JsonProperty("rates")] 20 | public ICollection? Rates { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Currency.cs: -------------------------------------------------------------------------------- 1 | 2 | using Crowdin.Api.Core.Converters; 3 | using JetBrains.Annotations; 4 | 5 | // ReSharper disable InconsistentNaming 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | [StrictStringRepresentation] 11 | public enum Currency 12 | { 13 | USD, 14 | EUR, 15 | JPY, 16 | GBP, 17 | AUD, 18 | CAD, 19 | CHF, 20 | CNY, 21 | SEK, 22 | NZD, 23 | MXN, 24 | SGD, 25 | HKD, 26 | NOK, 27 | KRW, 28 | TRY, 29 | RUB, 30 | INR, 31 | BRL, 32 | ZAR, 33 | GEL, 34 | UAH 35 | } 36 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/MtEnginePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.MachineTranslationEngines 7 | { 8 | [PublicAPI] 9 | public class MtEnginePatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public MtEnginePatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum MtEnginePatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/type")] 22 | Type, 23 | 24 | [Description("/credentials")] 25 | Credentials 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/ReplaceTagsRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using Newtonsoft.Json; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api.Screenshots 7 | { 8 | public class ReplaceTagsRequest 9 | { 10 | 11 | } 12 | 13 | public class AddTagRequest : ReplaceTagsRequest 14 | { 15 | [JsonProperty("stringId")] 16 | public long StringId { get; set; } 17 | 18 | [JsonProperty("position")] 19 | public Position? Position { get; set; } 20 | } 21 | 22 | public class AutoTagReplaceTagsRequest : ReplaceTagsRequest 23 | { 24 | [JsonProperty("autoTag")] 25 | public bool AutoTag { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/MtTranslation.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.MachineTranslationEngines 6 | { 7 | [PublicAPI] 8 | public class MtTranslation 9 | { 10 | [JsonProperty("sourceLanguageId")] 11 | public string SourceLanguageId { get; set; } 12 | 13 | [JsonProperty("targetLanguageId")] 14 | public string TargetLanguageId { get; set; } 15 | 16 | [JsonProperty("strings")] 17 | public string[] Strings { get; set; } 18 | 19 | [JsonProperty("translations")] 20 | public string[] Translations { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiSettingsPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.AI 7 | { 8 | [PublicAPI] 9 | public class AiSettingsPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public AiSettingsPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum AiSettingsPatchPath 17 | { 18 | [Description("/assistActionAiPromptId")] 19 | AssistActionAiPromptId, 20 | 21 | [Description("/shortcuts")] 22 | Shortcuts, 23 | 24 | [Description("/showSuggestion")] 25 | ShowSuggestion 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ColumnType.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api 5 | { 6 | [PublicAPI] 7 | public static class ColumnType 8 | { 9 | public const string None = "none"; 10 | 11 | public const string Identifier = "identifier"; 12 | 13 | public const string SourcePhrase = "sourcePhrase"; 14 | 15 | public const string SourceOrTranslation = "sourceOrTranslation"; 16 | 17 | public const string Translation = "translation"; 18 | 19 | public const string Context = "context"; 20 | 21 | public const string MaxLength = "maxLength"; 22 | 23 | public const string Labels = "labels"; 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/ProjectRole.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public enum ProjectRole 9 | { 10 | [Description("manager")] 11 | Manager, 12 | 13 | [Description("developer")] 14 | Developer, 15 | 16 | [Description("translator")] 17 | Translator, 18 | 19 | [Description("proofreader")] 20 | Proofreader, 21 | 22 | [Description("language_coordinator")] 23 | LanguageCoordinator, 24 | 25 | [Description("member")] 26 | Member 27 | } 28 | } -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | run-name: Release ${{ github.event.inputs.version }} version 3 | 4 | on: 5 | workflow_dispatch: 6 | inputs: 7 | version: 8 | type: choice 9 | description: Version 10 | options: 11 | - patch 12 | - minor 13 | 14 | jobs: 15 | version: 16 | permissions: 17 | contents: write 18 | uses: crowdin/.github/.github/workflows/bump-version.yml@main 19 | 20 | publish: 21 | runs-on: ubuntu-latest 22 | needs: version 23 | permissions: 24 | contents: write 25 | steps: 26 | - uses: peter-evans/repository-dispatch@v3 27 | with: 28 | event-type: publish 29 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowStep.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowStep 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("title")] 14 | public string Title { get; set; } 15 | 16 | [JsonProperty("type")] 17 | public WorkflowStepType Type { get; set; } 18 | 19 | [JsonProperty("languages")] 20 | public string[] Languages { get; set; } 21 | 22 | [JsonProperty("config")] 23 | public object Config { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Languages/ILanguagesApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.Languages 8 | { 9 | [PublicAPI] 10 | public interface ILanguagesApiExecutor 11 | { 12 | Task> ListSupportedLanguages(int limit = 25, int offset = 0); 13 | 14 | Task AddCustomLanguage(AddCustomLanguageRequest request); 15 | 16 | Task GetLanguage(string languageId); 17 | 18 | Task DeleteCustomLanguage(string languageId); 19 | 20 | Task EditCustomLanguage(string languageId, IEnumerable patches); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Workflows/WorkflowTemplate.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Workflows 6 | { 7 | [PublicAPI] 8 | public class WorkflowTemplate 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("title")] 14 | public string Title { get; set; } 15 | 16 | [JsonProperty("description")] 17 | public string Description { get; set; } 18 | 19 | [JsonProperty("groupId")] 20 | public long GroupId { get; set; } 21 | 22 | [JsonProperty("isDefault")] 23 | public bool IsDefault { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/ApplicationProject.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | 6 | namespace Crowdin.Api.Applications 7 | { 8 | [PublicAPI] 9 | public class ApplicationProject 10 | { 11 | [JsonProperty("value")] 12 | public ApplicationProjectValue Value { get; set; } 13 | 14 | [JsonProperty("ids")] 15 | public ICollection Ids { get; set; } 16 | } 17 | 18 | [PublicAPI] 19 | public enum ApplicationProjectValue 20 | { 21 | [Description("own")] 22 | Own, 23 | [Description("restricted")] 24 | Restricted 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/Crowdin.Api.Samples.Actions/Program.cs: -------------------------------------------------------------------------------- 1 | 2 | Console.WriteLine("This is a Crowdin Samples project"); 3 | 4 | const string accessToken = "insert token here"; 5 | 6 | var actions = new CrowdinActions(accessToken); 7 | 8 | // Available actions 9 | // Uncomment needed and add arguments 10 | 11 | // await actions.CreateFile(projectId, filePath); 12 | // await actions.UpdateFile(projectId, filePath1, filePath2); 13 | // await actions.CreateTm(filePath); 14 | // await actions.CreateGlossary(filePath); 15 | // await actions.PreTranslateProject(filePath); 16 | // await actions.DownloadTranslations(projectId); 17 | // await actions.GenerateReport(projectId, directoryId, fileId); 18 | // await actions.ExecuteGraphQLRawQuery(); -------------------------------------------------------------------------------- /src/Crowdin.Api/Fields/FieldPatch.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Crowdin.Api.Dictionaries; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Fields 7 | { 8 | public class FieldPatch : PatchEntry 9 | { 10 | [JsonProperty("path")] 11 | public FieldPatchPath Path { get; set; } 12 | } 13 | 14 | [PublicAPI] 15 | public enum FieldPatchPath 16 | { 17 | [Description("/name")] 18 | Name, 19 | 20 | [Description("/description")] 21 | Description, 22 | 23 | [Description("/config")] 24 | Config, 25 | 26 | [Description("/entities")] 27 | Entities 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Languages/LanguagePatchPath.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Languages 6 | { 7 | [PublicAPI] 8 | public enum LanguagePatchPath 9 | { 10 | [Description("/name")] 11 | Name, 12 | 13 | [Description("/textDirection")] 14 | TextDirection, 15 | 16 | [Description("/pluralCategoryNames")] 17 | PluralCategoryNames, 18 | 19 | [Description("/threeLettersCode")] 20 | ThreeLettersCode, 21 | 22 | [Description("/localeCode")] 23 | LocaleCode, 24 | 25 | [Description("/dialectOf")] 26 | DialectOf 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceStrings/SourceTextForms.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.SourceStrings 8 | { 9 | [PublicAPI] 10 | public class SourceTextForms 11 | { 12 | [JsonProperty("one")] 13 | public string? One { get; set; } 14 | 15 | [JsonProperty("two")] 16 | public string? Two { get; set; } 17 | 18 | [JsonProperty("few")] 19 | public string? Few { get; set; } 20 | 21 | [JsonProperty("many")] 22 | public string? Many { get; set; } 23 | 24 | [JsonProperty("other")] 25 | public string? Other { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/Team.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Teams 7 | { 8 | [PublicAPI] 9 | public class Team 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("name")] 15 | public string Name { get; set; } 16 | 17 | [JsonProperty("totalMembers")] 18 | public int TotalMembers { get; set; } 19 | 20 | [JsonProperty("createdAt")] 21 | public DateTimeOffset CreatedAt { get; set; } 22 | 23 | [JsonProperty("updatedAt")] 24 | public DateTimeOffset? UpdatedAt { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/BranchPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Branches 7 | { 8 | [PublicAPI] 9 | public class BranchPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public BranchPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum BranchPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/title")] 22 | Title, 23 | 24 | [Description("/exportPattern")] 25 | ExportPattern, 26 | 27 | [Description("/priority")] 28 | Priority 29 | } 30 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Screenshots/Tag.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Screenshots 7 | { 8 | [PublicAPI] 9 | public class Tag 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("screenshotId")] 15 | public long ScreenshotId { get; set; } 16 | 17 | [JsonProperty("stringId")] 18 | public long StringId { get; set; } 19 | 20 | [JsonProperty("position")] 21 | public Position Position { get; set; } 22 | 23 | [JsonProperty("createdAt")] 24 | public DateTimeOffset CreatedAt { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SortingRule.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using Crowdin.Api.Core; 4 | using JetBrains.Annotations; 5 | 6 | namespace Crowdin.Api 7 | { 8 | [PublicAPI] 9 | public class SortingRule 10 | { 11 | public string Field { get; set; } 12 | 13 | public SortingOrder? Order { get; set; } 14 | 15 | public override string ToString() 16 | { 17 | if (string.IsNullOrWhiteSpace(Field)) 18 | { 19 | throw new ArgumentNullException(nameof(Field), $"Field is required"); 20 | } 21 | 22 | return Field + (Order.HasValue ? " " + Order.Value.ToDescriptionString() : string.Empty); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Issues/IIssuesApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.Issues 8 | { 9 | [PublicAPI] 10 | public interface IIssuesApiExecutor 11 | { 12 | Task> ListReportedIssues( 13 | long projectId, 14 | int limit = 25, 15 | int offset = 0, 16 | IssueType? type = null, 17 | IssueStatus? status = null); 18 | 19 | Task> ListReportedIssues(long projectId, IssuesListParams @params); 20 | 21 | Task EditIssue(long projectId, long issueId, IEnumerable patches); 22 | } 23 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationImportLanguage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public class TranslationImportLanguage 9 | { 10 | [JsonProperty("id")] 11 | public string Id { get; set; } 12 | 13 | [JsonProperty("files")] 14 | public List Files { get; set; } 15 | 16 | [JsonProperty("skipped")] 17 | public TranslationImportSkipped Skipped { get; set; } 18 | 19 | [JsonProperty("skippedQaCheckCategories")] 20 | public ImportSkippedQaCheckCategories SkippedQaCheckCategories { get; set; } 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/IWebhooksApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.Webhooks 8 | { 9 | [PublicAPI] 10 | public interface IWebhooksApiExecutor 11 | { 12 | Task> ListWebhooks(long projectId, int limit = 25, int offset = 0); 13 | 14 | Task AddWebhook(long projectId, AddWebhookRequest request); 15 | 16 | Task GetWebhook(long projectId, long webhookId); 17 | 18 | Task DeleteWebhook(long projectId, long webhookId); 19 | 20 | Task EditWebhook(long projectId, long webhookId, IEnumerable patches); 21 | } 22 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportCreateForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Reports 7 | { 8 | [PublicAPI] 9 | public class ReportCreateForm 10 | { 11 | [JsonProperty("mode")] 12 | public ReportCreateMode? Mode { get; set; } 13 | 14 | [JsonProperty("value")] 15 | public float? Value { get; set; } 16 | } 17 | 18 | [PublicAPI] 19 | public enum ReportCreateMode 20 | { 21 | [Description("no_match")] 22 | NoMatch, 23 | 24 | [Description("tm_match")] 25 | TmMatch, 26 | 27 | [Description("approval")] 28 | Approval 29 | } 30 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/UploadTranslationsResponse.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Translations 6 | { 7 | [PublicAPI] 8 | public class UploadTranslationsResponse 9 | { 10 | [JsonProperty("projectId")] 11 | public long ProjectId { get; set; } 12 | 13 | [JsonProperty("storageId")] 14 | public long StorageId { get; set; } 15 | 16 | [JsonProperty("languageId")] 17 | public string LanguageId { get; set; } 18 | 19 | [JsonProperty("fileId")] 20 | public long? FileId { get; set; } 21 | 22 | [JsonProperty("branchId")] 23 | public long? BranchId { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/EnterpriseUserPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Users 7 | { 8 | [PublicAPI] 9 | public class EnterpriseUserPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public EnterpriseUserPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum EnterpriseUserPatchPath 17 | { 18 | [Description("/firstName")] 19 | FirstName, 20 | 21 | [Description("/lastName")] 22 | LastName, 23 | 24 | [Description("/timezone")] 25 | TimeZone, 26 | 27 | [Description("/status")] 28 | Status 29 | } 30 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/DistributionPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Distributions 7 | { 8 | [PublicAPI] 9 | public class DistributionPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public DistributionPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum DistributionPatchPath 17 | { 18 | [Description("/exportMode")] 19 | ExportMode, 20 | 21 | [Description("/name")] 22 | Name, 23 | 24 | [Description("/fileIds")] 25 | FileIds, 26 | 27 | [Description("/bundleIds")] 28 | BundleIds, 29 | } 30 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskSettingsTemplate.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskSettingsTemplate 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("name")] 15 | public string Name { get; set; } 16 | 17 | [JsonProperty("config")] 18 | public TaskSettingsTemplateConfig Config { get; set; } 19 | 20 | [JsonProperty("createdAt")] 21 | public DateTimeOffset CreatedAt { get; set; } 22 | 23 | [JsonProperty("updatedAt")] 24 | public DateTimeOffset? UpdatedAt { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Fields/AddFieldRequest.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.Fields 5 | { 6 | [PublicAPI] 7 | public class AddFieldRequest 8 | { 9 | [JsonProperty("name")] 10 | public string Name { get; set; } 11 | 12 | [JsonProperty("slug")] 13 | public string Slug { get; set; } 14 | 15 | [JsonProperty("type")] 16 | public FieldType Type { get; set; } 17 | 18 | [JsonProperty("description")] 19 | public string Description { get; set; } 20 | 21 | [JsonProperty("entities")] 22 | public FieldEntity[] Entities { get; set; } 23 | 24 | [JsonProperty("config")] 25 | public FieldConfig Config { get; set; } 26 | 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/AddTranslationRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class AddTranslationRequest 9 | { 10 | [JsonProperty("stringId")] 11 | public long StringId { get; set; } 12 | 13 | [JsonProperty("languageId")] 14 | public string LanguageId { get; set; } 15 | 16 | [JsonProperty("text")] 17 | public string Text { get; set; } 18 | 19 | [JsonProperty("pluralCategoryName")] 20 | public PluralCategoryName? PluralCategoryName { get; set; } 21 | 22 | [JsonProperty("addToTm")] 23 | public bool? AddToTm { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/UserReportSettingsTemplatePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Reports 7 | { 8 | [PublicAPI] 9 | public class UserReportSettingsTemplatePatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public UserReportSettingsTemplatePatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum UserReportSettingsTemplatePatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/currency")] 22 | Currency, 23 | 24 | [Description("/unit")] 25 | Unit, 26 | 27 | [Description("/config")] 28 | Config 29 | } 30 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringCorrections/Correction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using Crowdin.Api.StringTranslations; 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | namespace Crowdin.Api.StringCorrections 8 | { 9 | [PublicAPI] 10 | public class Correction 11 | { 12 | [JsonProperty("id")] 13 | public long Id { get; set; } 14 | 15 | [JsonProperty("text")] 16 | public string Text { get; set; } 17 | 18 | [JsonProperty("pluralCategoryName")] 19 | public string PluralCategoryName { get; set; } 20 | 21 | [JsonProperty("user")] 22 | public User User { get; set; } 23 | 24 | [JsonProperty("createdAt")] 25 | public DateTimeOffset CreatedAt { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/GlossaryExportFieldId.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.Glossaries 6 | { 7 | [PublicAPI] 8 | public enum GlossaryExportFieldId 9 | { 10 | [Description("term")] 11 | Term, 12 | 13 | [Description("description")] 14 | Description, 15 | 16 | [Description("partOfSpeech")] 17 | PartOfSpeech, 18 | 19 | [Description("type")] 20 | Type, 21 | 22 | [Description("status")] 23 | Status, 24 | 25 | [Description("gender")] 26 | Gender, 27 | 28 | [Description("note")] 29 | Note, 30 | 31 | [Description("url")] 32 | Url 33 | } 34 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/AssetReference.cs: -------------------------------------------------------------------------------- 1 | using Crowdin.Api.Users; 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | using System; 5 | 6 | namespace Crowdin.Api.SourceFiles 7 | { 8 | [PublicAPI] 9 | public class AssetReference 10 | { 11 | [JsonProperty("id")] 12 | public int Id { get; set; } 13 | 14 | [JsonProperty("name")] 15 | public string Name { get; set; } 16 | 17 | [JsonProperty("url")] 18 | public string Url { get; set; } 19 | 20 | [JsonProperty("user")] 21 | public User User { get; set; } 22 | 23 | [JsonProperty("createdAt")] 24 | public DateTimeOffset CreatedAt { get; set; } 25 | 26 | [JsonProperty("mimeType")] 27 | public string MimeType { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskAssignee.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.Tasks 6 | { 7 | [PublicAPI] 8 | public class TaskAssignee 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("username")] 14 | public string UserName { get; set; } 15 | 16 | [JsonProperty("fullName")] 17 | public string FullName { get; set; } 18 | 19 | [JsonProperty("avatarUrl")] 20 | public string AvatarUrl { get; set; } 21 | 22 | [JsonProperty("wordsCount")] 23 | public int WordsCount { get; set; } 24 | 25 | [JsonProperty("wordsLeft")] 26 | public int WordsLeft { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationStatus/ProgressResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationStatus 6 | { 7 | [PublicAPI] 8 | public class ProgressResource 9 | { 10 | [JsonProperty("words")] 11 | public ProgressResourceStatus Words { get; set; } 12 | 13 | [JsonProperty("phrases")] 14 | public ProgressResourceStatus Phrases { get; set; } 15 | 16 | [JsonProperty("translationProgress")] 17 | public int TranslationProgress { get; set; } 18 | 19 | [JsonProperty("approvalProgress")] 20 | public int ApprovalProgress { get; set; } 21 | 22 | [JsonProperty("languageId")] 23 | public string LanguageId { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/IMachineTranslationEnginesApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.MachineTranslationEngines 8 | { 9 | [PublicAPI] 10 | public interface IMachineTranslationEnginesApiExecutor 11 | { 12 | Task> ListMts(long? groupId = null, int limit = 25, int offset = 0); 13 | 14 | Task AddMt(AddMtEngineRequest request); 15 | 16 | Task GetMt(long mtId); 17 | 18 | Task DeleteMt(long mtId); 19 | 20 | Task EditMt(long mtId, IEnumerable patches); 21 | 22 | Task TranslateViaMt(long mtId, TranslateViaMtRequest request); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationMemory/ConcordanceSearchRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationMemory 6 | { 7 | [PublicAPI] 8 | public class ConcordanceSearchRequest 9 | { 10 | [JsonProperty("sourceLanguageId")] 11 | public string SourceLanguageId { get; set; } 12 | 13 | [JsonProperty("targetLanguageId")] 14 | public string TargetLanguageId { get; set; } 15 | 16 | [JsonProperty("autoSubstitution")] 17 | public bool AutoSubstitution { get; set; } 18 | 19 | [JsonProperty("minRelevant")] 20 | public int MinRelevant { get; set; } 21 | 22 | [JsonProperty("expression")] 23 | public string Expression { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceStrings/SourceStringPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.SourceStrings 7 | { 8 | [PublicAPI] 9 | public class SourceStringPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public StringPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum StringPatchPath 17 | { 18 | [Description("/text")] 19 | Text, 20 | 21 | [Description("/context")] 22 | Context, 23 | 24 | [Description("/isHidden")] 25 | IsHidden, 26 | 27 | [Description("/maxLength")] 28 | MaxLength, 29 | 30 | [Description("/labelIds")] 31 | LabelIds 32 | } 33 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/CreateAiPromptFineTuningJobRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.AI 8 | { 9 | [PublicAPI] 10 | public class CreateAiPromptFineTuningJobRequest 11 | { 12 | [JsonProperty("dryRun")] 13 | public bool? DryRun { get; set; } 14 | 15 | // ReSharper disable once StringLiteralTypo -> reviewed 16 | [JsonProperty("hyperparameters")] 17 | public AiHyperParameters? HyperParameters { get; set; } 18 | 19 | [JsonProperty("trainingOptions")] 20 | public AiTrainingOptions TrainingOptions { get; set; } = null!; 21 | 22 | [JsonProperty("validationOptions")] 23 | public AiValidationOptions? ValidationOptions { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Branches/Branch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Branches 7 | { 8 | [PublicAPI] 9 | public class Branch 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("projectId")] 15 | public long ProjectId { get; set; } 16 | 17 | [JsonProperty("name")] 18 | public string Name { get; set; } 19 | 20 | [JsonProperty("title")] 21 | public string Title { get; set; } 22 | 23 | [JsonProperty("createdAt")] 24 | public DateTimeOffset CreatedAt { get; set; } 25 | 26 | [JsonProperty("updatedAt")] 27 | public DateTimeOffset? UpdatedAt { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/DistributionStringBasedRelease.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Distributions 8 | { 9 | [PublicAPI] 10 | public class DistributionStringBasedRelease 11 | { 12 | [JsonProperty("status")] 13 | public DistributionReleaseStatus? Status { get; set; } 14 | 15 | [JsonProperty("progress")] 16 | public int? Progress { get; set; } 17 | 18 | [JsonProperty("currentLanguageId")] 19 | public string? CurrentLanguageId { get; set; } 20 | 21 | [JsonProperty("currentBranchId")] 22 | public long? CurrentBranchId { get; set; } 23 | 24 | [JsonProperty("date")] 25 | public DateTimeOffset? Date { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/TeamMember.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Teams 7 | { 8 | [PublicAPI] 9 | public class TeamMember 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("username")] 15 | public string Username { get; set; } 16 | 17 | [JsonProperty("firstName")] 18 | public string FirstName { get; set; } 19 | 20 | [JsonProperty("lastName")] 21 | public string LastName { get; set; } 22 | 23 | [JsonProperty("avatarUrl")] 24 | public string AvatarUrl { get; set; } 25 | 26 | [JsonProperty("addedAt")] 27 | public DateTimeOffset AddedAt { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /tests/Crowdin.Api.UnitTesting/Tests/Webhooks/WebhookEventTypeTests.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Linq; 4 | using Crowdin.Api.Webhooks; 5 | 6 | using Newtonsoft.Json; 7 | using Xunit; 8 | 9 | namespace Crowdin.Api.UnitTesting.Tests.Webhooks 10 | { 11 | public class WebhookEventTypeTests 12 | { 13 | private static readonly JsonSerializerSettings DefaultSettings = TestUtils.CreateJsonSerializerOptions(); 14 | 15 | [Fact] 16 | public void ShouldAllEventsBeUnique() 17 | { 18 | var serializedEvents = Enum.GetValues() 19 | .Select(e => JsonConvert.SerializeObject(e, DefaultSettings)) 20 | .ToArray(); 21 | 22 | Assert.Equal(serializedEvents.Length, serializedEvents.Distinct().Count()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/DistributionRelease.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Distributions 9 | { 10 | [PublicAPI] 11 | public class DistributionRelease 12 | { 13 | [JsonProperty("status")] 14 | public DistributionReleaseStatus? Status { get; set; } 15 | 16 | [JsonProperty("progress")] 17 | public int? Progress { get; set; } 18 | 19 | [JsonProperty("currentLanguageId")] 20 | public string? CurrentLanguageId { get; set; } 21 | 22 | [JsonProperty("currentFileId")] 23 | public long? CurrentFileId { get; set; } 24 | 25 | [JsonProperty("date")] 26 | public DateTimeOffset? Date { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/StringsExporterSettingsResource.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Crowdin.Api.SourceFiles; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.ProjectsGroups 7 | { 8 | [PublicAPI] 9 | public class StringsExporterSettingsResource 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("format")] 15 | public ProjectFileType Format { get; set; } 16 | 17 | [JsonProperty("settings")] 18 | public StringsExporterSettings Settings { get; set; } 19 | 20 | [JsonProperty("createdAt")] 21 | public DateTimeOffset CreatedAt { get; set; } 22 | 23 | [JsonProperty("updatedAt")] 24 | public DateTimeOffset? UpdatedAt { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/TmPenalties.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class TmPenalties 9 | { 10 | [JsonProperty("autoSubstitution")] 11 | public int AutoSubstitution { get; set; } 12 | 13 | [JsonProperty("tmPriority")] 14 | public TmPriority TmPriority { get; set; } 15 | 16 | [JsonProperty("multipleTranslations")] 17 | public int MultipleTranslations { get; set; } 18 | 19 | [JsonProperty("timeSinceLastUsage")] 20 | public TmTimeElapsed TimeSinceLastUsage { get; set; } 21 | 22 | [JsonProperty("timeSinceLastModified")] 23 | public TmTimeElapsed TimeSinceLastModified { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ReportSettingsTemplatePatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Reports 7 | { 8 | [PublicAPI] 9 | public class ReportSettingsTemplatePatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public ReportSettingsTemplatePatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum ReportSettingsTemplatePatchPath 17 | { 18 | [Description("name")] 19 | Name, 20 | 21 | [Description("currency")] 22 | Currency, 23 | 24 | [Description("unit")] 25 | Unit, 26 | 27 | [Description("mode")] 28 | Mode, 29 | 30 | [Description("config")] 31 | Config 32 | } 33 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Users/EnterpriseInviteUserRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.Users 8 | { 9 | [PublicAPI] 10 | public class EnterpriseInviteUserRequest 11 | { 12 | [JsonProperty("email")] 13 | #pragma warning disable CS8618 14 | public string Email { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("firstName")] 18 | public string? FirstName { get; set; } 19 | 20 | [JsonProperty("lastName")] 21 | public string? LastName { get; set; } 22 | 23 | [JsonProperty("timezone")] 24 | public string? TimeZone { get; set; } 25 | 26 | [JsonProperty("adminAccess")] 27 | public bool? AdminAccess { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/CrowdinApiException.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api 8 | { 9 | [PublicAPI] 10 | public class CrowdinApiException : Exception 11 | { 12 | public int? Code { get; } 13 | 14 | public object? Related { get; } 15 | 16 | public string ResponseJson { get; set; } 17 | 18 | public CrowdinApiException(string message) : base(message) 19 | { 20 | 21 | } 22 | 23 | public CrowdinApiException(int code, string message) : this(message) 24 | { 25 | Code = code; 26 | } 27 | 28 | public CrowdinApiException(string message, object? related) : this(message) 29 | { 30 | Related = related; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringTranslations/Alignment.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.StringTranslations 6 | { 7 | [PublicAPI] 8 | public class Alignment 9 | { 10 | [JsonProperty("sourceWord")] 11 | public string SourceWord { get; set; } 12 | 13 | [JsonProperty("sourceLemma")] 14 | public string SourceLemma { get; set; } 15 | 16 | [JsonProperty("targetWord")] 17 | public string TargetWord { get; set; } 18 | 19 | [JsonProperty("targetLemma")] 20 | public string TargetLemma { get; set; } 21 | 22 | [JsonProperty("match")] 23 | public int Match { get; set; } 24 | 25 | [JsonProperty("probability")] 26 | public float Probability { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Fields/IFieldsApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | #nullable enable 8 | 9 | namespace Crowdin.Api.Fields 10 | { 11 | [PublicAPI] 12 | public interface IFieldsApiExecutor 13 | { 14 | Task> ListFields( 15 | string? search, 16 | FieldEntity? entity, 17 | FieldType? type, 18 | int limit = 25, 19 | int offset = 0); 20 | 21 | Task> ListFields(FieldsListParams @params); 22 | 23 | Task AddField(AddFieldRequest request); 24 | 25 | Task GetField(long fieldId); 26 | 27 | Task DeleteField(long fieldId); 28 | 29 | Task EditField(long fieldId, IEnumerable patches); 30 | } 31 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceStrings/StringBasedProjectFileType.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | 5 | namespace Crowdin.Api.SourceStrings 6 | { 7 | [PublicAPI] 8 | public enum StringBasedProjectFileType 9 | { 10 | [Description("auto")] 11 | Auto, 12 | 13 | [Description("android")] 14 | Android, 15 | 16 | [Description("macosx")] 17 | MacOsX, 18 | 19 | [Description("arb")] 20 | Arb, 21 | 22 | [Description("csv")] 23 | Csv, 24 | 25 | [Description("json")] 26 | Json, 27 | 28 | [Description("xlsx")] 29 | Xlsx, 30 | 31 | [Description("xliff")] 32 | Xliff, 33 | 34 | [Description("xliff_two")] 35 | XliffTwo 36 | } 37 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Webhooks/Organization/IOrganizationWebhooksApiExecutor.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | using JetBrains.Annotations; 6 | 7 | namespace Crowdin.Api.Webhooks.Organization 8 | { 9 | [PublicAPI] 10 | public interface IOrganizationWebhooksApiExecutor 11 | { 12 | Task> ListWebhooks(int limit = 25, int offset = 0); 13 | 14 | Task AddWebhook(AddWebhookRequestBase request); 15 | 16 | Task GetWebhook(long organizationWebhookId); 17 | 18 | Task DeleteWebhook(long organizationWebhookId); 19 | 20 | Task EditWebhook( 21 | long organizationWebhookId, 22 | IEnumerable patches); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/ConceptLanguageDetails.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Glossaries 7 | { 8 | [PublicAPI] 9 | public class ConceptLanguageDetails 10 | { 11 | [JsonProperty("languageId")] 12 | public string LanguageId { get; set; } 13 | 14 | [JsonProperty("userId")] 15 | public long UserId { get; set; } 16 | 17 | [JsonProperty("definition")] 18 | public string Definition { get; set; } 19 | 20 | [JsonProperty("note")] 21 | public string Note { get; set; } 22 | 23 | [JsonProperty("createdAt")] 24 | public DateTimeOffset CreatedAt { get; set; } 25 | 26 | [JsonProperty("updatedAt")] 27 | public DateTimeOffset? UpdatedAt { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/ProjectsGroups/EnterpriseProject.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.ProjectsGroups 6 | { 7 | [PublicAPI] 8 | public class EnterpriseProject : ProjectBase 9 | { 10 | [JsonProperty("groupId")] 11 | public long GroupId { get; set; } 12 | 13 | [JsonProperty("background")] 14 | public string Background { get; set; } 15 | 16 | [JsonProperty("isExternal")] 17 | public bool IsExternal { get; set; } 18 | 19 | [JsonProperty("externalType")] 20 | public ProjectExternalType? ExternalType { get; set; } 21 | 22 | [JsonProperty("workflowId")] 23 | public long WorkflowId { get; set; } 24 | 25 | [JsonProperty("hasCrowdsourcing")] 26 | public bool HasCrowdSourcing { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiProviderPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.AI 7 | { 8 | [PublicAPI] 9 | public class AiProviderPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public AiProviderPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum AiProviderPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/type")] 22 | Type, 23 | 24 | [Description("/credentials")] 25 | Credentials, 26 | 27 | [Description("/config")] 28 | Config, 29 | 30 | [Description("/isEnabled")] 31 | IsEnabled, 32 | 33 | [Description("/useSystemCredentials")] 34 | UseSystemCredentials 35 | } 36 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Applications/ApplicationUser.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | 6 | namespace Crowdin.Api.Applications 7 | { 8 | [PublicAPI] 9 | public class ApplicationUser 10 | { 11 | [JsonProperty("value")] 12 | public ApplicationUserValue Value { get; set; } 13 | 14 | [JsonProperty("ids")] 15 | public ICollection Ids { get; set; } 16 | } 17 | 18 | [PublicAPI] 19 | public enum ApplicationUserValue 20 | { 21 | [Description("owner")] 22 | Owner, 23 | 24 | [Description("managers")] 25 | Managers, 26 | 27 | [Description("all")] 28 | All, 29 | 30 | [Description("guests")] 31 | Guests, 32 | 33 | [Description("restricted")] 34 | Restricted 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/BranchPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.ComponentModel; 4 | 5 | using JetBrains.Annotations; 6 | using Newtonsoft.Json; 7 | 8 | using Crowdin.Api.Core; 9 | 10 | namespace Crowdin.Api.SourceFiles 11 | { 12 | [PublicAPI] 13 | [Obsolete(MessageTexts.UseBranchesNamespace)] 14 | public class BranchPatch : PatchEntry 15 | { 16 | [JsonProperty("path")] 17 | public BranchPatchPath Path { get; set; } 18 | } 19 | 20 | [PublicAPI] 21 | [Obsolete(MessageTexts.UseBranchesNamespace)] 22 | public enum BranchPatchPath 23 | { 24 | [Description("/name")] 25 | Name, 26 | 27 | [Description("/title")] 28 | Title, 29 | 30 | [Description("/exportPattern")] 31 | ExportPattern, 32 | 33 | [Description("/priority")] 34 | Priority 35 | } 36 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/DirectoryPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.SourceFiles 7 | { 8 | [PublicAPI] 9 | public class DirectoryPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public DirectoryPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum DirectoryPatchPath 17 | { 18 | [Description("/branchId")] 19 | BranchId, 20 | 21 | [Description("/directoryId")] 22 | DirectoryId, 23 | 24 | [Description("/name")] 25 | Name, 26 | 27 | [Description("/title")] 28 | Title, 29 | 30 | [Description("/exportPattern")] 31 | ExportPattern, 32 | 33 | [Description("/priority")] 34 | Priority 35 | } 36 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/TranslationStatus/LanguageProgressResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | namespace Crowdin.Api.TranslationStatus 6 | { 7 | [PublicAPI] 8 | public class LanguageProgressResource 9 | { 10 | [JsonProperty("words")] 11 | public ProgressResourceStatus Words { get; set; } 12 | 13 | [JsonProperty("phrases")] 14 | public ProgressResourceStatus Phrases { get; set; } 15 | 16 | [JsonProperty("translationProgress")] 17 | public int TranslationProgress { get; set; } 18 | 19 | [JsonProperty("approvalProgress")] 20 | public int ApprovalProgress { get; set; } 21 | 22 | [JsonProperty("fileId")] 23 | public long FileId { get; set; } 24 | 25 | [JsonProperty("eTag")] 26 | public string Etag { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Glossaries/UpdateConceptRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Glossaries 7 | { 8 | [PublicAPI] 9 | public class UpdateConceptRequest 10 | { 11 | [JsonProperty("subject")] 12 | public string Subject { get; set; } 13 | 14 | [JsonProperty("definition")] 15 | public string Definition { get; set; } 16 | 17 | [JsonProperty("note")] 18 | public string Note { get; set; } 19 | 20 | [JsonProperty("url")] 21 | public string Url { get; set; } 22 | 23 | [JsonProperty("figure")] 24 | public string Figure { get; set; } 25 | 26 | [JsonProperty("languagesDetails")] 27 | public ICollection LanguagesDetails { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/MachineTranslationEngines/TranslateViaMtRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.MachineTranslationEngines 9 | { 10 | [PublicAPI] 11 | public class TranslateViaMtRequest 12 | { 13 | [JsonProperty("languageRecognitionProvider")] 14 | public LanguageRecognitionProvider? LanguageRecognitionProvider { get; set; } 15 | 16 | [JsonProperty("sourceLanguageId")] 17 | public string? SourceLanguageId { get; set; } 18 | 19 | [JsonProperty("targetLanguageId")] 20 | #pragma warning disable CS8618 21 | public string TargetLanguageId { get; set; } 22 | #pragma warning restore CS8618 23 | 24 | [JsonProperty("strings")] 25 | public ICollection? Strings { get; set; } 26 | } 27 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/BuildProjectFileTranslationResponse.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | 4 | #nullable enable 5 | 6 | namespace Crowdin.Api.Translations 7 | { 8 | [PublicAPI] 9 | public class BuildProjectFileTranslationResponse 10 | { 11 | public ResponseType Type { get; set; } 12 | 13 | public FileDownloadLink? Link { get; set; } 14 | 15 | public BuildProjectFileTranslationResponse(FileDownloadLink link) 16 | { 17 | Type = ResponseType.DownloadLink; 18 | Link = link; 19 | } 20 | 21 | public BuildProjectFileTranslationResponse(ResponseType type) 22 | { 23 | Type = type; 24 | } 25 | 26 | [PublicAPI] 27 | public enum ResponseType 28 | { 29 | DownloadLink, 30 | NoContent, 31 | FileNotModified 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/TaskComment.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Tasks 7 | { 8 | [PublicAPI] 9 | public class TaskComment 10 | { 11 | [JsonProperty("id")] 12 | public long Id { get; set; } 13 | 14 | [JsonProperty("userId")] 15 | public long UserId { get; set; } 16 | 17 | [JsonProperty("taskId")] 18 | public long TaskId { get; set; } 19 | 20 | [JsonProperty("text")] 21 | public string Text { get; set; } 22 | 23 | [JsonProperty("timeSpent")] 24 | public long? TimeSpent { get; set; } 25 | 26 | [JsonProperty("createdAt")] 27 | public DateTimeOffset CreatedAt { get; set; } 28 | 29 | [JsonProperty("updatedAt")] 30 | public DateTimeOffset UpdatedAt { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Clients/Client.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | using System.ComponentModel; 4 | 5 | namespace Crowdin.Api.Clients 6 | { 7 | [PublicAPI] 8 | public class Client 9 | { 10 | [JsonProperty("id")] 11 | public long Id { get; set; } 12 | 13 | [JsonProperty("name")] 14 | public string Name { get; set; } 15 | 16 | [JsonProperty("description")] 17 | public string Description { get; set; } 18 | 19 | [JsonProperty("status")] 20 | public ClientStatus Status { get; set; } 21 | } 22 | 23 | [PublicAPI] 24 | public enum ClientStatus 25 | { 26 | [Description("pending")] 27 | Pending, 28 | 29 | [Description("confirmed")] 30 | Confirmed, 31 | 32 | [Description("rejected")] 33 | Rejected, 34 | 35 | [Description("deleted")] 36 | Deleted 37 | } 38 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Reports/ProjectMembersGenerateReportRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.Reports 7 | { 8 | [PublicAPI] 9 | public class ProjectMembersGenerateReportRequest : GenerateReportRequest 10 | { 11 | [JsonProperty("name")] 12 | public string Name => "project-members"; 13 | 14 | [JsonProperty("schema")] 15 | public SchemaObject Schema { get; set; } 16 | 17 | [PublicAPI] 18 | public class SchemaObject 19 | { 20 | [JsonProperty("format")] 21 | public ReportFormat? Format { get; set; } 22 | 23 | [JsonProperty("dateFrom")] 24 | public DateTimeOffset? DateFrom { get; set; } 25 | 26 | [JsonProperty("dateTo")] 27 | public DateTimeOffset? DateTo { get; set; } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /docs/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "files": [ "src/Crowdin.Api/Crowdin.Api.csproj" ], 7 | "exclude": [ "**/bin/**", "**/obj/**" ], 8 | "src": ".." 9 | } 10 | ], 11 | "dest": "obj/api" 12 | } 13 | ], 14 | "build": { 15 | "content": [ 16 | { 17 | "files": [ "**/*.yml" ], 18 | "src": "obj/api", 19 | "dest": "api" 20 | }, 21 | { 22 | "files": [ "toc.yml" ] 23 | }, 24 | { 25 | "files": [ "*.md" ], 26 | "src": ".." 27 | } 28 | ], 29 | "globalMetadata": { 30 | "_appTitle": "Docs", 31 | "_enableSearch": true 32 | }, 33 | "markdownEngineName": "markdig", 34 | "dest": "_site", 35 | "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ] 36 | } 37 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/SourceFiles/AddDirectoryRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using JetBrains.Annotations; 3 | using Newtonsoft.Json; 4 | 5 | #nullable enable 6 | 7 | namespace Crowdin.Api.SourceFiles 8 | { 9 | [PublicAPI] 10 | public class AddDirectoryRequest 11 | { 12 | [JsonProperty("name")] 13 | #pragma warning disable CS8618 14 | public string Name { get; set; } 15 | #pragma warning restore CS8618 16 | 17 | [JsonProperty("branchId")] 18 | public long? BranchId { get; set; } 19 | 20 | [JsonProperty("directoryId")] 21 | public long? DirectoryId { get; set; } 22 | 23 | [JsonProperty("title")] 24 | public string? Title { get; set; } 25 | 26 | [JsonProperty("exportPattern")] 27 | public string? ExportPattern { get; set; } 28 | 29 | [JsonProperty("priority")] 30 | public Priority? Priority { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/AddStringCommentRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.StringComments 7 | { 8 | [PublicAPI] 9 | public class AddStringCommentRequest 10 | { 11 | [JsonProperty("text")] 12 | public string Text { get; set; } 13 | 14 | [JsonProperty("stringId")] 15 | public long StringId { get; set; } 16 | 17 | [JsonProperty("targetLanguageId")] 18 | public string TargetLanguageId { get; set; } 19 | 20 | [JsonProperty("type")] 21 | public StringCommentType Type { get; set; } 22 | 23 | [JsonProperty("issueType")] 24 | public IssueType? IssueType { get; set; } 25 | 26 | [JsonProperty("attachments")] 27 | public List Attachments { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Translations/TranslationImportAttributes.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.Translations 5 | { 6 | public class TranslationImportAttributes 7 | { 8 | [JsonProperty("storageId")] 9 | public long StorageId { get; set; } 10 | 11 | [JsonProperty("fileId")] 12 | public long FileId { get; set; } 13 | 14 | [JsonProperty("importEqSuggestions")] 15 | public bool ImportEqSuggestions { get; set; } 16 | 17 | [JsonProperty("autoApproveImported")] 18 | public bool AutoApproveImported { get; set; } 19 | 20 | [JsonProperty("translateHidden")] 21 | public bool TranslateHidden { get; set; } 22 | 23 | [JsonProperty("addToTm")] 24 | public bool AddToTm { get; set; } 25 | 26 | [JsonProperty("languageIds")] 27 | public List LanguageIds { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/StringComments/CommentAttachment.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using Newtonsoft.Json; 3 | 4 | namespace Crowdin.Api.StringComments 5 | { 6 | [PublicAPI] 7 | public class CommentAttachment 8 | { 9 | [JsonProperty("id")] 10 | public long Id { get; set; } 11 | 12 | [JsonProperty("name")] 13 | public string Name { get; set; } 14 | 15 | [JsonProperty("mime")] 16 | public string Mime { get; set; } 17 | 18 | [JsonProperty("size")] 19 | public int Size { get; set; } 20 | 21 | [JsonProperty("category")] 22 | public string Category { get; set; } 23 | 24 | [JsonProperty("thumbnailUrl")] 25 | public string ThumbnailUrl { get; set; } 26 | 27 | [JsonProperty("url")] 28 | public string Url { get; set; } 29 | 30 | [JsonProperty("downloadUrl")] 31 | public string DownloadUrl { get; set; } 32 | } 33 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Tasks/LanguageServicePendingTaskCreateForm.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Tasks 9 | { 10 | [PublicAPI] 11 | public class LanguageServicePendingTaskCreateForm : AddTaskRequest 12 | { 13 | [JsonProperty("precedingTaskId")] 14 | public long PrecedingTaskId { get; set; } 15 | 16 | [JsonProperty("type")] 17 | public TaskType Type { get; set; } 18 | 19 | [JsonProperty("vendor")] 20 | public TaskVendor Vendor { get; set; } 21 | 22 | [JsonProperty("title")] 23 | public string Title { get; set; } = null!; 24 | 25 | [JsonProperty("description")] 26 | public string? Description { get; set; } 27 | 28 | [JsonProperty("deadline")] 29 | public DateTimeOffset? DeadLine { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Fields/FieldType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | 4 | namespace Crowdin.Api.Fields 5 | { 6 | [PublicAPI] 7 | public enum FieldType 8 | { 9 | [Description("checkbox")] 10 | CheckBox, 11 | 12 | [Description("radiobuttons")] 13 | RadioButtons, 14 | 15 | [Description("date")] 16 | Date, 17 | 18 | [Description("datetime")] 19 | DateTime, 20 | 21 | [Description("number")] 22 | Number, 23 | 24 | [Description("labels")] 25 | Labels, 26 | 27 | [Description("select")] 28 | Select, 29 | 30 | [Description("multiselect")] 31 | MultiSelect, 32 | 33 | [Description("text")] 34 | Text, 35 | 36 | [Description("textarea")] 37 | TextArea, 38 | 39 | [Description("url")] 40 | Url 41 | } 42 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/Teams/ProjectTeamResource.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using Crowdin.Api.Users; 4 | using JetBrains.Annotations; 5 | using Newtonsoft.Json; 6 | 7 | namespace Crowdin.Api.Teams 8 | { 9 | [PublicAPI] 10 | public class ProjectTeamResource 11 | { 12 | [JsonProperty("id")] 13 | public long Id { get; set; } 14 | 15 | [JsonProperty("hasManagerAccess")] 16 | public bool HasManagerAccess { get; set; } 17 | 18 | [JsonProperty("hasAccessToAllWorkflowSteps")] 19 | public bool HasAccessToAllWorkflowSteps { get; set; } 20 | 21 | [JsonProperty("permissions")] 22 | #pragma warning disable CS8618 23 | public IDictionary Permissions { get; set; } 24 | #pragma warning restore CS8618 25 | 26 | [JsonProperty("roles")] 27 | public ICollection Roles { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | release: 5 | types: [published] 6 | repository_dispatch: 7 | types: [publish] 8 | 9 | env: 10 | PROJECT_PATH: src/Crowdin.Api 11 | PROJECT_CSPROJ_PATH: src/Crowdin.Api/Crowdin.Api.csproj 12 | 13 | jobs: 14 | publish-nuget: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | 21 | - name: Setup .NET SDK 22 | uses: actions/setup-dotnet@v4 23 | with: 24 | dotnet-version: 7.0.x 25 | 26 | - name: Build the project 27 | run: dotnet build -c Release ${{ env.PROJECT_CSPROJ_PATH }} 28 | 29 | - name: Create the package 30 | run: dotnet pack -c Release ${{ env.PROJECT_CSPROJ_PATH }} 31 | 32 | - name: Publish the package to NuGet 33 | run: dotnet nuget push ${{ env.PROJECT_PATH }}/bin/Release/*.nupkg -s https://nuget.org -k ${{ secrets.NUGET_KEY }} 34 | -------------------------------------------------------------------------------- /src/Crowdin.Api/Distributions/AddDistributionRequest.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections.Generic; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | #nullable enable 7 | 8 | namespace Crowdin.Api.Distributions 9 | { 10 | [PublicAPI] 11 | public class AddDistributionRequest 12 | { 13 | [JsonProperty("exportMode")] 14 | public DistributionExportMode? ExportMode { get; set; } 15 | 16 | [JsonProperty("name")] 17 | #pragma warning disable CS8618 18 | public string Name { get; set; } 19 | #pragma warning restore CS8618 20 | 21 | [JsonProperty("fileIds")] 22 | #pragma warning disable CS8618 23 | public ICollection? FileIds { get; set; } 24 | #pragma warning restore CS8618 25 | 26 | [JsonProperty("bundleIds")] 27 | #pragma warning disable CS8618 28 | public ICollection? BundleIds { get; set; } 29 | #pragma warning restore CS8618 30 | } 31 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiPromptPatch.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using JetBrains.Annotations; 4 | using Newtonsoft.Json; 5 | 6 | namespace Crowdin.Api.AI 7 | { 8 | [PublicAPI] 9 | public class AiPromptPatch : PatchEntry 10 | { 11 | [JsonProperty("path")] 12 | public AiPromptPatchPath Path { get; set; } 13 | } 14 | 15 | [PublicAPI] 16 | public enum AiPromptPatchPath 17 | { 18 | [Description("/name")] 19 | Name, 20 | 21 | [Description("/action")] 22 | Action, 23 | 24 | [Description("/aiProviderId")] 25 | AiProviderId, 26 | 27 | [Description("/aiModelId")] 28 | AiModelId, 29 | 30 | [Description("/isEnabled")] 31 | IsEnabled, 32 | 33 | [Description("/enabledProjectIds")] 34 | EnabledProjectIds, 35 | 36 | [Description("/config")] 37 | Config 38 | } 39 | } -------------------------------------------------------------------------------- /src/Crowdin.Api/AI/AiValidationOptions.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | using JetBrains.Annotations; 6 | using Newtonsoft.Json; 7 | 8 | #nullable enable 9 | 10 | namespace Crowdin.Api.AI 11 | { 12 | [PublicAPI] 13 | public class AiValidationOptions 14 | { 15 | [JsonProperty("projectIds")] 16 | public List? ProjectIds { get; set; } 17 | 18 | [JsonProperty("dateFrom")] 19 | public DateTimeOffset? DateFrom { get; set; } 20 | 21 | [JsonProperty("dateTo")] 22 | public DateTimeOffset? DateTo { get; set; } 23 | 24 | [JsonProperty("maxFileSize")] 25 | public long? MaxFileSize { get; set; } 26 | 27 | [JsonProperty("minExamplesCount")] 28 | public long? MinExamplesCount { get; set; } 29 | 30 | [JsonProperty("maxExamplesCount")] 31 | public long? MaxExamplesCount { get; set; } 32 | } 33 | } --------------------------------------------------------------------------------