-
Notifications
You must be signed in to change notification settings - Fork 17
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(go): add more playground examples #1447
Conversation
✅ Deploy Preview for api-clients-automation ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
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.
Niiiiice 👌🏻
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.
Looks nice ! Thanks for adding them 😀
analyticsClient := analytics.NewClient(appID, apiKey, analytics.US) | ||
|
||
getTopFilterForAttributeResponse, err := analyticsClient.GetTopFilterForAttribute( | ||
analyticsClient.NewApiGetTopFilterForAttributeRequest("myAttribute1,myAttribute2").WithIndex(indexName), |
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.
For a future improvement for DX, what about putting only the optional parameters inside an struct ? And keep the required ones at the first level
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.
tbh I also noticed that the required param can be handled in a better position, and already took a private note about it when creating these examples 😀
--
But directly removing from the struct may bring some other problems, I think more to add in the to New
function for the request struct.
For example; using like analyticsClient.NewApiGetTopFilterForAttributeRequest("myAttribute1,myAttribute2", indexName)
if the index name is required. So it would be more clear to user what is required when creating the request struct.
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-664
More structured playground examples were added for the go client to give more examples to test.
Changes included:
🧪 Test
can be tested with
yarn docker playground go {client}