-
Notifications
You must be signed in to change notification settings - Fork 3
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(all): expand #1
Conversation
This is quite a lot of changes 😅. The PR has multiple times more effort put into it than the entire project which is interesting. I have been taking a few looks at this in the last few days even though there's a decent amount of |
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.
Most looks great! Just a reminder, you've left some todo
s for yourself in lib.rs
.
Also another thing, in CI I usually do cargo clippy --all-features
, not sure how I forgot it in this repo.
I'll also have to rethink CI testing cause obviously without a key that wont work. I will probably create a separate API key just these tests but I'll have to see.
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
and this project adheres to | ||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
<!-- ## [Unreleased] --> |
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.
Would be nice to have a before-after conversion similar to what I had in v0.3. Since there was just 1 method before this PR this should be easy. I have a code example here.
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 weird formatting is a result of me using deno fmt for markdown files.
I'm a bit confused, do you want an example in the client documentation?
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.
I think Github likes showing 6 lines minimum because I specifically selected the "unreleased" line. Meant to add an example similar to this:
for the "hello world" example I had in the repo before, in case anyone that was using the crate already wants to upgrade. I can add this myself as well.
|
|
No, options were automatically generated by the openapi-generator from the .yaml file. |
Ah makes sense. I'm not 100% sure on this but from the docs it does not look like these should be optional which is weird that they then get generated like this. I think it seems safe to remove them but I wonder if they get generated like that with the idea that a response might have a completely different structure if it was an error (thus each param is optional cause it might not exist, to avoid crashes). What do you think? |
Looks like the response fields in https://github.com/resend/resend-go/blob/main/emails.go#L12 Edit. Oh well, other are not tagged: https://github.com/resend/resend-go/blob/main/audiences.go#L28 I think it's reasonable to only remove options from the response fields that aren't tagged. |
|
I think it's best to not tackle the rate limiting at all. It's best (and easier of course) to let the users deal with it, especially since there's different ways to deal with it + there's the possibility some users are not even rate limited to begin with (not sure if some premium plan changes this for example). As for the todos:
|
Only a few things left then:
|
|
pub async fn create(&self, audience: &AudienceId, contact: ContactData) -> Result<ContactId> { ... }
Btw, what's the reason for a custom |
Yeah ig ids are fine as references and we can keep everything else as owned values. Any other thoughts on this? I've mostly kept the config from back when I was still very new to the language, just out of habit. I should re-evaluate it at some point cause I bet it is annoying to deal with 😅. It is not just pedantic cause i like my editor spamming me with warnings |
I'll take a look at the readme and the changelog but other than that everything is (finally 🎉) done right? |
Yeah, I think so. I'll double-check in the evening. |
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.
LGTM!
Changes so far:
reqwest/native-tls
(enabled by default) andreqwest/rustls-tls
async
withblocking
, same as inreqwest
Result
type aliasbase_url
support with an env varRESEND_BASE_URL
impl Default
for a client with an env varRESEND_API_KEY
USER-AGENT
to the request withRESEND_USER_AGENT