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

Create a macro to automatically generate APIs #10

Open
paulpdaniels opened this issue Jan 11, 2020 · 0 comments
Open

Create a macro to automatically generate APIs #10

paulpdaniels opened this issue Jan 11, 2020 · 0 comments

Comments

@paulpdaniels
Copy link
Collaborator

Currently the process is very manual i.e. given a particular method signature like:

    def deleteChat(channelId: String, ts: String, asUser: Option[Boolean]): ZIO[R with SlackEnv, SlackError, Boolean] =
      sendM(request("chat.delete", "channel" -> channelId, "ts" -> ts, "as_user" -> asUser)) >>= isOk

It should be possible to create a simple macro so that we can just write:

def deleteChat(channelId: String, ts: String, asUser: Option[Boolean]): ZIO[R with SlackEnv, SlackError, Boolean] = Method.buildOk("chat.delete")

Here each of the arguments could be converted from camelCase to snake_case and then the resolver would know how to resolve based on the type.

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

No branches or pull requests

1 participant