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 InvokeWithReCaptchaRequest struct {
Token string
Query bin .Object
}
const InvokeWithReCaptchaRequestTypeID = 0xadbb0f94
var (
_ bin .Encoder = &InvokeWithReCaptchaRequest {}
_ bin .Decoder = &InvokeWithReCaptchaRequest {}
_ bin .BareEncoder = &InvokeWithReCaptchaRequest {}
_ bin .BareDecoder = &InvokeWithReCaptchaRequest {}
)
func (i *InvokeWithReCaptchaRequest ) Zero () bool {
if i == nil {
return true
}
if !(i .Token == "" ) {
return false
}
if !(i .Query == nil ) {
return false
}
return true
}
func (i *InvokeWithReCaptchaRequest ) String () string {
if i == nil {
return "InvokeWithReCaptchaRequest(nil)"
}
type Alias InvokeWithReCaptchaRequest
return fmt .Sprintf ("InvokeWithReCaptchaRequest%+v" , Alias (*i ))
}
func (i *InvokeWithReCaptchaRequest ) FillFrom (from interface {
GetToken () (value string )
GetQuery () (value bin .Object )
}) {
i .Token = from .GetToken ()
i .Query = from .GetQuery ()
}
func (*InvokeWithReCaptchaRequest ) TypeID () uint32 {
return InvokeWithReCaptchaRequestTypeID
}
func (*InvokeWithReCaptchaRequest ) TypeName () string {
return "invokeWithReCaptcha"
}
func (i *InvokeWithReCaptchaRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "invokeWithReCaptcha" ,
ID : InvokeWithReCaptchaRequestTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Token" ,
SchemaName : "token" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
}
return typ
}
func (i *InvokeWithReCaptchaRequest ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithReCaptcha#adbb0f94 as nil" )
}
b .PutID (InvokeWithReCaptchaRequestTypeID )
return i .EncodeBare (b )
}
func (i *InvokeWithReCaptchaRequest ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithReCaptcha#adbb0f94 as nil" )
}
b .PutString (i .Token )
if err := i .Query .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode invokeWithReCaptcha#adbb0f94: field query: %w" , err )
}
return nil
}
func (i *InvokeWithReCaptchaRequest ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithReCaptcha#adbb0f94 to nil" )
}
if err := b .ConsumeID (InvokeWithReCaptchaRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode invokeWithReCaptcha#adbb0f94: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InvokeWithReCaptchaRequest ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithReCaptcha#adbb0f94 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode invokeWithReCaptcha#adbb0f94: field token: %w" , err )
}
i .Token = value
}
{
if err := i .Query .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode invokeWithReCaptcha#adbb0f94: field query: %w" , err )
}
}
return nil
}
func (i *InvokeWithReCaptchaRequest ) GetToken () (value string ) {
if i == nil {
return
}
return i .Token
}
func (i *InvokeWithReCaptchaRequest ) GetQuery () (value bin .Object ) {
if i == nil {
return
}
return i .Query
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .