feat: add Style Guides API support#251
Open
innomaxx wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Style Guides API support to the Crowdin Python client by introducing a new StyleGuidesResource (list/create/get/delete/patch) exposed via CrowdinClient.style_guides, along with corresponding enums, TypedDict request shapes, and unit tests. Resolves issue #247.
Changes:
- New
style_guidespackage (resource, enums, types,__init__) with CRUD methods under thestyle-guidespath. - Re-exports
StyleGuidesResourcefromcrowdin_api/api_resources/__init__.pyand wires it as aCrowdinClientproperty. - Adds resource unit tests following the existing pattern; also alphabetizes a few existing imports.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crowdin_api/api_resources/style_guides/resource.py | New StyleGuidesResource implementing list/add/get/delete/edit operations. |
| crowdin_api/api_resources/style_guides/enums.py | New ListStyleGuidesOrderBy and StyleGuidePatchPath enums. |
| crowdin_api/api_resources/style_guides/types.py | New AddStyleGuideRequest and StyleGuidePatchRequest TypedDicts. |
| crowdin_api/api_resources/style_guides/init.py | Excludes tests from pdoc output. |
| crowdin_api/api_resources/style_guides/tests/test_style_guides_resources.py | Unit tests for the new resource methods and path helper. |
| crowdin_api/api_resources/init.py | Exports StyleGuidesResource; re-sorts a few existing imports alphabetically. |
| crowdin_api/client.py | Adds CrowdinClient.style_guides property. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+43
to
+47
| return self.requester.request( | ||
| method="get", | ||
| path=self.get_style_guides_path(), | ||
| params=params, | ||
| ) |
Comment on lines
+363
to
+367
| @property | ||
| def style_guides(self) -> api_resources.StyleGuidesResource: | ||
| return api_resources.StyleGuidesResource( | ||
| requester=self.get_api_requestor(), page_size=self.PAGE_SIZE | ||
| ) |
Comment on lines
53
to
55
| "StringCommentsResource", | ||
| "StyleGuidesResource", | ||
| "StringTranslationsResource", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #247