-
Notifications
You must be signed in to change notification settings - Fork 16
feat(source_files): add new endpoints for Asset References management #122
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
base: main
Are you sure you want to change the base?
feat(source_files): add new endpoints for Asset References management #122
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
==========================================
- Coverage 98.21% 97.45% -0.76%
==========================================
Files 68 68
Lines 3296 3322 +26
==========================================
Hits 3237 3237
- Misses 33 59 +26
Partials 26 26 ☔ 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 adds support for Asset Reference operations in the Crowdin API client. Asset references allow attaching reference files to assets for additional context.
Key changes:
- Added four new API methods for managing asset references: list, add, get, and delete
- Introduced data models for asset references including request/response structures and user info
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crowdin/source_files.go | Added four new methods (ListAssetReferences, AddAssetReference, GetAssetReference, DeleteAssetReference) to SourceFilesService for managing asset references |
| crowdin/model/source_files.go | Added data structures for asset references including AddAssetReferenceRequest, UserInfo, AssetReference, and related response types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| StorageID int `json:"storageId"` | ||
| Name string `json:"name"` | ||
| } | ||
|
|
Copilot
AI
Oct 29, 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.
The AddAssetReferenceRequest struct is missing a Validate() method. Following the pattern established by similar request structs like FileAddRequest and DirectoryAddRequest, this should include validation to ensure required fields (StorageID and Name) are provided.
| // Validate checks if the AddAssetReferenceRequest is valid. | |
| // It implements the crowdin.RequestValidator interface. | |
| func (r *AddAssetReferenceRequest) Validate() error { | |
| if r == nil { | |
| return ErrNilRequest | |
| } | |
| if r.StorageID == 0 { | |
| return errors.New("missing required field: StorageID") | |
| } | |
| if r.Name == "" { | |
| return errors.New("missing required field: Name") | |
| } | |
| return nil | |
| } |
|
@andrii-bodnar hey, i have created a fresh pull reqeust with changes you suggested, but i still creating problem. As you suggested to run golangci-lint locally i tried that, but it is giving issues in file that i havent changed. |
|
Hi @GauravJangra9988. The issues were clearly outlined in my previous comments and by the Copilot bot. Resolving initial issues based on this documented feedback is a prerequisite for review and a necessary part of the contribution process. I cannot take the time to debug or write the fixes for you. Please resolve all outstanding items independently, then request a new review. |

Closed old pull request #119
This is new pull request solving issue #118