gen: sugared RPC request builder #146
Labels
area: gen
Codegen issues
enhancement
New feature or request
epic
Feature that is too big for single issue
stale
For now use to make request we have to write something like:
and there are some problems
You need to write
MessagesSendMedia(ctx, ...)
instead ofor
You need to write types
tg.InputMediaUploadedDocument
ortg.MessagesSendMediaRequest
instead of pretty methods likeSendMedia
orUploadedDocument
.You need to fill fields like
RandomID
manually, but it can be filled automatically using givenRandomIDSource
Field
Peer
can be using different structures, so we can use mappers from gen: mappers for similar types #144 to provide multiple filling methodsSome classes in schema have a
empty
constructor which can be used by default, for exampleInputMessagesFilterEmpty
We can use zero values as valid fields in some cases even if these fields required by schema, for example
message.sendMedia
does not really require non-emptymessage
field.Finally, the sugared RPC call would be like
The text was updated successfully, but these errors were encountered: