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 ChatlistsGetChatlistUpdatesRequest struct {
Chatlist InputChatlistDialogFilter
}
const ChatlistsGetChatlistUpdatesRequestTypeID = 0x89419521
var (
_ bin .Encoder = &ChatlistsGetChatlistUpdatesRequest {}
_ bin .Decoder = &ChatlistsGetChatlistUpdatesRequest {}
_ bin .BareEncoder = &ChatlistsGetChatlistUpdatesRequest {}
_ bin .BareDecoder = &ChatlistsGetChatlistUpdatesRequest {}
)
func (g *ChatlistsGetChatlistUpdatesRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Chatlist .Zero ()) {
return false
}
return true
}
func (g *ChatlistsGetChatlistUpdatesRequest ) String () string {
if g == nil {
return "ChatlistsGetChatlistUpdatesRequest(nil)"
}
type Alias ChatlistsGetChatlistUpdatesRequest
return fmt .Sprintf ("ChatlistsGetChatlistUpdatesRequest%+v" , Alias (*g ))
}
func (g *ChatlistsGetChatlistUpdatesRequest ) FillFrom (from interface {
GetChatlist () (value InputChatlistDialogFilter )
}) {
g .Chatlist = from .GetChatlist ()
}
func (*ChatlistsGetChatlistUpdatesRequest ) TypeID () uint32 {
return ChatlistsGetChatlistUpdatesRequestTypeID
}
func (*ChatlistsGetChatlistUpdatesRequest ) TypeName () string {
return "chatlists.getChatlistUpdates"
}
func (g *ChatlistsGetChatlistUpdatesRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "chatlists.getChatlistUpdates" ,
ID : ChatlistsGetChatlistUpdatesRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chatlist" ,
SchemaName : "chatlist" ,
},
}
return typ
}
func (g *ChatlistsGetChatlistUpdatesRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode chatlists.getChatlistUpdates#89419521 as nil" )
}
b .PutID (ChatlistsGetChatlistUpdatesRequestTypeID )
return g .EncodeBare (b )
}
func (g *ChatlistsGetChatlistUpdatesRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode chatlists.getChatlistUpdates#89419521 as nil" )
}
if err := g .Chatlist .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatlists.getChatlistUpdates#89419521: field chatlist: %w" , err )
}
return nil
}
func (g *ChatlistsGetChatlistUpdatesRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode chatlists.getChatlistUpdates#89419521 to nil" )
}
if err := b .ConsumeID (ChatlistsGetChatlistUpdatesRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode chatlists.getChatlistUpdates#89419521: %w" , err )
}
return g .DecodeBare (b )
}
func (g *ChatlistsGetChatlistUpdatesRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode chatlists.getChatlistUpdates#89419521 to nil" )
}
{
if err := g .Chatlist .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatlists.getChatlistUpdates#89419521: field chatlist: %w" , err )
}
}
return nil
}
func (g *ChatlistsGetChatlistUpdatesRequest ) GetChatlist () (value InputChatlistDialogFilter ) {
if g == nil {
return
}
return g .Chatlist
}
func (c *Client ) ChatlistsGetChatlistUpdates (ctx context .Context , chatlist InputChatlistDialogFilter ) (*ChatlistsChatlistUpdates , error ) {
var result ChatlistsChatlistUpdates
request := &ChatlistsGetChatlistUpdatesRequest {
Chatlist : chatlist ,
}
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 .