Skip to content
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

feat(routes): add moderation route support #61

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

ashley-evans
Copy link
Contributor

Resolves #23

Firstly, thanks for putting this package together - It's really useful!

I am utilizing the Moderation API as part of some of my projects so I thought I would add support for it here.

I've attempted to follow the same structure / approach as the rest of the routes but please let me know if there is anything else I need to add.

I wasn't quite sure what the builders section was for, so I have just copied another example.

Copy link
Owner

@mharrisb1 mharrisb1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. Everything looks great 👍

For builders (or anything under /helpers) it's really just random utils to help with common patterns I found myself repeating over and over so adding anything there is super low priority but always encouraged especially if it will help you out.

The only change I'd request is let's make the model_dict and model_parse utils more flexible and add args/kwargs to the function signature and pass those into the proxied method instead of explicitly marking by_alias as true.

Here's an example that I had in another project where I needed to support Pydantic V1 and V2

https://github.com/mharrisb1/cube-http-client/blob/main/src/cube_http/_utils/serde.py

When you make that quick change I'll merge this in and release everything as v0.10

@@ -15,7 +15,7 @@ def json_loads(b: bytes) -> Any:

def model_dict(m: BaseModel) -> dict[str, Any]:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just update these function signatures and where you used model_dict in moderations and we're good 👍

@mharrisb1
Copy link
Owner

I'll fix CI when I'm able to get to my laptop. Should be able to checkout forks and test

@mharrisb1 mharrisb1 merged commit 70d76f0 into mharrisb1:main Aug 26, 2024
0 of 4 checks passed
@ashley-evans ashley-evans deleted the feat/moderation branch August 26, 2024 09:56
@ashley-evans
Copy link
Contributor Author

I'll fix CI when I'm able to get to my laptop. Should be able to checkout forks and test

Thanks for sorting the CI + reviewing this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add support for moderation endpoint
2 participants