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 InvokeWithMessagesRangeRequest struct {
Range MessageRange
Query bin .Object
}
const InvokeWithMessagesRangeRequestTypeID = 0x365275f2
var (
_ bin .Encoder = &InvokeWithMessagesRangeRequest {}
_ bin .Decoder = &InvokeWithMessagesRangeRequest {}
_ bin .BareEncoder = &InvokeWithMessagesRangeRequest {}
_ bin .BareDecoder = &InvokeWithMessagesRangeRequest {}
)
func (i *InvokeWithMessagesRangeRequest ) Zero () bool {
if i == nil {
return true
}
if !(i .Range .Zero ()) {
return false
}
if !(i .Query == nil ) {
return false
}
return true
}
func (i *InvokeWithMessagesRangeRequest ) String () string {
if i == nil {
return "InvokeWithMessagesRangeRequest(nil)"
}
type Alias InvokeWithMessagesRangeRequest
return fmt .Sprintf ("InvokeWithMessagesRangeRequest%+v" , Alias (*i ))
}
func (i *InvokeWithMessagesRangeRequest ) FillFrom (from interface {
GetRange () (value MessageRange )
GetQuery () (value bin .Object )
}) {
i .Range = from .GetRange ()
i .Query = from .GetQuery ()
}
func (*InvokeWithMessagesRangeRequest ) TypeID () uint32 {
return InvokeWithMessagesRangeRequestTypeID
}
func (*InvokeWithMessagesRangeRequest ) TypeName () string {
return "invokeWithMessagesRange"
}
func (i *InvokeWithMessagesRangeRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "invokeWithMessagesRange" ,
ID : InvokeWithMessagesRangeRequestTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Range" ,
SchemaName : "range" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
}
return typ
}
func (i *InvokeWithMessagesRangeRequest ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithMessagesRange#365275f2 as nil" )
}
b .PutID (InvokeWithMessagesRangeRequestTypeID )
return i .EncodeBare (b )
}
func (i *InvokeWithMessagesRangeRequest ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithMessagesRange#365275f2 as nil" )
}
if err := i .Range .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode invokeWithMessagesRange#365275f2: field range: %w" , err )
}
if err := i .Query .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode invokeWithMessagesRange#365275f2: field query: %w" , err )
}
return nil
}
func (i *InvokeWithMessagesRangeRequest ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithMessagesRange#365275f2 to nil" )
}
if err := b .ConsumeID (InvokeWithMessagesRangeRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode invokeWithMessagesRange#365275f2: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InvokeWithMessagesRangeRequest ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithMessagesRange#365275f2 to nil" )
}
{
if err := i .Range .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode invokeWithMessagesRange#365275f2: field range: %w" , err )
}
}
{
if err := i .Query .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode invokeWithMessagesRange#365275f2: field query: %w" , err )
}
}
return nil
}
func (i *InvokeWithMessagesRangeRequest ) GetRange () (value MessageRange ) {
if i == nil {
return
}
return i .Range
}
func (i *InvokeWithMessagesRangeRequest ) GetQuery () (value bin .Object ) {
if i == nil {
return
}
return i .Query
}
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 .