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