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 MessagesReceivedQueueRequest struct {
MaxQts int
}
const MessagesReceivedQueueRequestTypeID = 0x55a5bb66
var (
_ bin .Encoder = &MessagesReceivedQueueRequest {}
_ bin .Decoder = &MessagesReceivedQueueRequest {}
_ bin .BareEncoder = &MessagesReceivedQueueRequest {}
_ bin .BareDecoder = &MessagesReceivedQueueRequest {}
)
func (r *MessagesReceivedQueueRequest ) Zero () bool {
if r == nil {
return true
}
if !(r .MaxQts == 0 ) {
return false
}
return true
}
func (r *MessagesReceivedQueueRequest ) String () string {
if r == nil {
return "MessagesReceivedQueueRequest(nil)"
}
type Alias MessagesReceivedQueueRequest
return fmt .Sprintf ("MessagesReceivedQueueRequest%+v" , Alias (*r ))
}
func (r *MessagesReceivedQueueRequest ) FillFrom (from interface {
GetMaxQts () (value int )
}) {
r .MaxQts = from .GetMaxQts ()
}
func (*MessagesReceivedQueueRequest ) TypeID () uint32 {
return MessagesReceivedQueueRequestTypeID
}
func (*MessagesReceivedQueueRequest ) TypeName () string {
return "messages.receivedQueue"
}
func (r *MessagesReceivedQueueRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.receivedQueue" ,
ID : MessagesReceivedQueueRequestTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MaxQts" ,
SchemaName : "max_qts" ,
},
}
return typ
}
func (r *MessagesReceivedQueueRequest ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode messages.receivedQueue#55a5bb66 as nil" )
}
b .PutID (MessagesReceivedQueueRequestTypeID )
return r .EncodeBare (b )
}
func (r *MessagesReceivedQueueRequest ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode messages.receivedQueue#55a5bb66 as nil" )
}
b .PutInt (r .MaxQts )
return nil
}
func (r *MessagesReceivedQueueRequest ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode messages.receivedQueue#55a5bb66 to nil" )
}
if err := b .ConsumeID (MessagesReceivedQueueRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.receivedQueue#55a5bb66: %w" , err )
}
return r .DecodeBare (b )
}
func (r *MessagesReceivedQueueRequest ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode messages.receivedQueue#55a5bb66 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.receivedQueue#55a5bb66: field max_qts: %w" , err )
}
r .MaxQts = value
}
return nil
}
func (r *MessagesReceivedQueueRequest ) GetMaxQts () (value int ) {
if r == nil {
return
}
return r .MaxQts
}
func (c *Client ) MessagesReceivedQueue (ctx context .Context , maxqts int ) ([]int64 , error ) {
var result LongVector
request := &MessagesReceivedQueueRequest {
MaxQts : maxqts ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return []int64 (result .Elems ), 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 .