-
Notifications
You must be signed in to change notification settings - Fork 20
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: Email Addresses API #224
Conversation
Error json.RawMessage `json:"error,omitempty"` | ||
} | ||
|
||
type LinkedIdentification struct { |
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 don't like this name, so if you have something better to suggest, please do!
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.
Sounds fine to me. I would maybe omit the Identification
prefix from the struct field names.
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.
Done!
@@ -422,3 +422,8 @@ func String(v string) *string { | |||
func Int64(v int64) *int64 { | |||
return &v | |||
} | |||
|
|||
// Bool returns a pointer to the provided bool value. | |||
func Bool(v bool) *bool { |
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.
🔧 Suggestion since this function is exported:
func Bool(v bool) *bool { | |
func BoolPtr(v bool) *bool { |
Error json.RawMessage `json:"error,omitempty"` | ||
} | ||
|
||
type LinkedIdentification struct { |
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.
Sounds fine to me. I would maybe omit the Identification
prefix from the struct field names.
client := NewClient(config) | ||
_, err := client.Create(context.Background(), &CreateParams{}) | ||
require.Error(t, err) | ||
apiErr, ok := err.(*clerk.APIErrorResponse) |
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.
💡 Perhaps a helper is useful?
apiErr, ok := clerk.AsErrorResponse(err)
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.
Good idea. However, I cannot see how this would help.
I imagine that if we change the APIErrorResponse
type, even if we had the helper, we would still have to change the code that uses the error response type. 🤔
Happy to add the helper in a separate PR.
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.
It would mostly serve as a guide. Autocompletion may help you write the conversion faster too. Otherwise someone must probably remember or look up the error type? The rest of the code will remain the same, you're absolutely right!
Added support for the Email Addresses API operations Create, Read, Update and Delete.
a3ac8e3
to
beba9f0
Compare
Added support for the Email Addresses API operations Create, Read, Update and Delete.