package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type MessagesGetBotAppRequest struct {
App InputBotAppClass
Hash int64
}
const MessagesGetBotAppRequestTypeID = 0x34fdc5c3
var (
_ bin .Encoder = &MessagesGetBotAppRequest {}
_ bin .Decoder = &MessagesGetBotAppRequest {}
_ bin .BareEncoder = &MessagesGetBotAppRequest {}
_ bin .BareDecoder = &MessagesGetBotAppRequest {}
)
func (g *MessagesGetBotAppRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .App == nil ) {
return false
}
if !(g .Hash == 0 ) {
return false
}
return true
}
func (g *MessagesGetBotAppRequest ) String () string {
if g == nil {
return "MessagesGetBotAppRequest(nil)"
}
type Alias MessagesGetBotAppRequest
return fmt .Sprintf ("MessagesGetBotAppRequest%+v" , Alias (*g ))
}
func (g *MessagesGetBotAppRequest ) FillFrom (from interface {
GetApp () (value InputBotAppClass )
GetHash () (value int64 )
}) {
g .App = from .GetApp ()
g .Hash = from .GetHash ()
}
func (*MessagesGetBotAppRequest ) TypeID () uint32 {
return MessagesGetBotAppRequestTypeID
}
func (*MessagesGetBotAppRequest ) TypeName () string {
return "messages.getBotApp"
}
func (g *MessagesGetBotAppRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getBotApp" ,
ID : MessagesGetBotAppRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "App" ,
SchemaName : "app" ,
},
{
Name : "Hash" ,
SchemaName : "hash" ,
},
}
return typ
}
func (g *MessagesGetBotAppRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getBotApp#34fdc5c3 as nil" )
}
b .PutID (MessagesGetBotAppRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetBotAppRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getBotApp#34fdc5c3 as nil" )
}
if g .App == nil {
return fmt .Errorf ("unable to encode messages.getBotApp#34fdc5c3: field app is nil" )
}
if err := g .App .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.getBotApp#34fdc5c3: field app: %w" , err )
}
b .PutLong (g .Hash )
return nil
}
func (g *MessagesGetBotAppRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getBotApp#34fdc5c3 to nil" )
}
if err := b .ConsumeID (MessagesGetBotAppRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getBotApp#34fdc5c3: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetBotAppRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getBotApp#34fdc5c3 to nil" )
}
{
value , err := DecodeInputBotApp (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.getBotApp#34fdc5c3: field app: %w" , err )
}
g .App = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getBotApp#34fdc5c3: field hash: %w" , err )
}
g .Hash = value
}
return nil
}
func (g *MessagesGetBotAppRequest ) GetApp () (value InputBotAppClass ) {
if g == nil {
return
}
return g .App
}
func (g *MessagesGetBotAppRequest ) GetHash () (value int64 ) {
if g == nil {
return
}
return g .Hash
}
func (c *Client ) MessagesGetBotApp (ctx context .Context , request *MessagesGetBotAppRequest ) (*MessagesBotApp , error ) {
var result MessagesBotApp
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , nil
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .