-
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #350 +/- ##
===========================================
+ Coverage 50.38% 68.33% +17.95%
===========================================
Files 277 437 +160
Lines 3688 6779 +3091
Branches 0 559 +559
===========================================
+ Hits 1858 4632 +2774
- Misses 1830 2098 +268
- Partials 0 49 +49 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR introduces support for the File References API in the Crowdin SDK, enabling management of asset references attached to source files.
- Adds four new API methods: list, add, get, and delete asset references
- Introduces
AssetReferenceandAddAssetReferenceRequestmodel classes - Includes comprehensive unit tests with mocked API responses
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Crowdin.Api/SourceFiles/SourceFilesApiExecutor.cs | Implements four asset reference API methods with helper URL formatters |
| src/Crowdin.Api/SourceFiles/ISourceFilesApiExecutor.cs | Adds interface definitions for the new asset reference operations |
| src/Crowdin.Api/SourceFiles/AssetReference.cs | Defines the AssetReference model with properties like Id, Name, Url, User, CreatedAt, and MimeType |
| src/Crowdin.Api/SourceFiles/AddAssetReferenceRequest.cs | Defines the request model for adding asset references with StorageId and Name properties |
| tests/Crowdin.Api.UnitTesting/Tests/SourceFiles/AssetReferenceTests.cs | Provides unit tests for all four asset reference operations including success and failure scenarios |
| tests/Crowdin.Api.UnitTesting/Resources/SourceFiles.resx | Adds mock JSON responses for list, add, and get asset reference operations |
Files not reviewed (1)
- tests/Crowdin.Api.UnitTesting/Resources/SourceFiles.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/Crowdin.Api.UnitTesting/Tests/SourceFiles/AssetReferenceTests.cs
Outdated
Show resolved
Hide resolved
| /// 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> |
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] |
| /// Get asset reference. Documentation: | ||
| /// <a href="https://support.crowdin.com/api/v2/#operation/api.projects.files.references.get">Crowdin API</a> | ||
| /// <a href="https://support.crowdin.com/enterprise/api/#operation/api.projects.files.references.get">Crowdin Enterprise API</a> | ||
| /// </summary> |
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] |
| /// Delete asset reference. Documentation: | ||
| /// <a href="https://support.crowdin.com/api/v2/#operation/api.projects.files.references.delete">Crowdin API</a> | ||
| /// <a href="https://support.crowdin.com/enterprise/api/#operation/api.projects.files.references.delete">Crowdin Enterprise API</a> | ||
| /// </summary> |
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] |
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.
@GajicAleksandra thank you!
No description provided.