-
Notifications
You must be signed in to change notification settings - Fork 34
feat(sourceFiles): add support for new File References API #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using JetBrains.Annotations; | ||
| using Newtonsoft.Json; | ||
|
|
||
| namespace Crowdin.Api.SourceFiles | ||
| { | ||
| [PublicAPI] | ||
| public class AddAssetReferenceRequest | ||
| { | ||
| [JsonProperty("storageId")] | ||
| public long StorageId { get; set; } | ||
|
|
||
| [JsonProperty("name")] | ||
| public string Name { get; set; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| using Crowdin.Api.Users; | ||
| using JetBrains.Annotations; | ||
| using Newtonsoft.Json; | ||
| using System; | ||
|
|
||
| namespace Crowdin.Api.SourceFiles | ||
| { | ||
| [PublicAPI] | ||
| public class AssetReference | ||
| { | ||
| [JsonProperty("id")] | ||
| public int Id { get; set; } | ||
|
|
||
| [JsonProperty("name")] | ||
| public string Name { get; set; } | ||
|
|
||
| [JsonProperty("url")] | ||
| public string Url { get; set; } | ||
|
|
||
| [JsonProperty("user")] | ||
| public User User { get; set; } | ||
|
|
||
| [JsonProperty("createdAt")] | ||
| public DateTimeOffset CreatedAt { get; set; } | ||
|
|
||
| [JsonProperty("mimeType")] | ||
| public string MimeType { get; set; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||
| | ||||||||
|
|
||||||||
| using System; | ||||||||
| using System.Collections.Generic; | ||||||||
| using System.Linq; | ||||||||
|
|
@@ -8,6 +8,7 @@ | |||||||
| using JetBrains.Annotations; | ||||||||
|
|
||||||||
| using Crowdin.Api.Core; | ||||||||
| using System.IO; | ||||||||
|
|
||||||||
| #nullable enable | ||||||||
|
|
||||||||
|
|
@@ -467,5 +468,73 @@ public async Task<DownloadLink> DownloadReviewedSourceFiles(long projectId, long | |||||||
| } | ||||||||
|
|
||||||||
| #endregion | ||||||||
|
|
||||||||
| #region File References | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
| /// List asset references. Documentation: | ||||||||
| /// <a href="https://support.crowdin.com/api/v2/#operation/api.projects.files.references.getMany">Crowdin API</a> | ||||||||
| /// <a href="https://support.crowdin.com/enterprise/api/#operation/api.projects.files.references.getMany">Crowdin Enterprise API</a> | ||||||||
| /// </summary> | ||||||||
| [PublicAPI] | ||||||||
| public async Task<ResponseList<AssetReference>> ListAssetReferences(long projectId, long fileId, int limit = 25, int offset = 0) | ||||||||
| { | ||||||||
| string url = FormUrl_FileReferences(projectId, fileId); | ||||||||
| IDictionary<string, string> queryParams = Utils.CreateQueryParamsFromPaging(limit, offset); | ||||||||
| CrowdinApiResult result = await _apiClient.SendGetRequest(url, queryParams); | ||||||||
| return _jsonParser.ParseResponseList<AssetReference>(result.JsonObject); | ||||||||
| } | ||||||||
|
|
||||||||
| /// <summary> | ||||||||
| /// Add asset reference. Documentation: | ||||||||
| /// <a href="https://support.crowdin.com/api/v2/#operation/api.projects.files.references.post">Crowdin API</a> | ||||||||
| /// <a href="https://support.crowdin.com/enterprise/api/#operation/api.projects.files.references.post">Crowdin Enterprise API</a> | ||||||||
| /// </summary> | ||||||||
|
||||||||
| /// </summary> | |
| /// </summary> | |
| [PublicAPI] |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing [PublicAPI] attribute for consistency with other public methods in this class like ListAssetReferences.
| /// </summary> | |
| /// </summary> | |
| [PublicAPI] |
Copilot
AI
Oct 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing [PublicAPI] attribute for consistency with other public methods in this class like ListAssetReferences.
| /// </summary> | |
| /// </summary> | |
| [PublicAPI] |
Uh oh!
There was an error while loading. Please reload this page.