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 AuthExportedAuthorization struct {
ID int64
Bytes []byte
}
const AuthExportedAuthorizationTypeID = 0xb434e2b8
var (
_ bin .Encoder = &AuthExportedAuthorization {}
_ bin .Decoder = &AuthExportedAuthorization {}
_ bin .BareEncoder = &AuthExportedAuthorization {}
_ bin .BareDecoder = &AuthExportedAuthorization {}
)
func (e *AuthExportedAuthorization ) Zero () bool {
if e == nil {
return true
}
if !(e .ID == 0 ) {
return false
}
if !(e .Bytes == nil ) {
return false
}
return true
}
func (e *AuthExportedAuthorization ) String () string {
if e == nil {
return "AuthExportedAuthorization(nil)"
}
type Alias AuthExportedAuthorization
return fmt .Sprintf ("AuthExportedAuthorization%+v" , Alias (*e ))
}
func (e *AuthExportedAuthorization ) FillFrom (from interface {
GetID () (value int64 )
GetBytes () (value []byte )
}) {
e .ID = from .GetID ()
e .Bytes = from .GetBytes ()
}
func (*AuthExportedAuthorization ) TypeID () uint32 {
return AuthExportedAuthorizationTypeID
}
func (*AuthExportedAuthorization ) TypeName () string {
return "auth.exportedAuthorization"
}
func (e *AuthExportedAuthorization ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "auth.exportedAuthorization" ,
ID : AuthExportedAuthorizationTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Bytes" ,
SchemaName : "bytes" ,
},
}
return typ
}
func (e *AuthExportedAuthorization ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode auth.exportedAuthorization#b434e2b8 as nil" )
}
b .PutID (AuthExportedAuthorizationTypeID )
return e .EncodeBare (b )
}
func (e *AuthExportedAuthorization ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode auth.exportedAuthorization#b434e2b8 as nil" )
}
b .PutLong (e .ID )
b .PutBytes (e .Bytes )
return nil
}
func (e *AuthExportedAuthorization ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode auth.exportedAuthorization#b434e2b8 to nil" )
}
if err := b .ConsumeID (AuthExportedAuthorizationTypeID ); err != nil {
return fmt .Errorf ("unable to decode auth.exportedAuthorization#b434e2b8: %w" , err )
}
return e .DecodeBare (b )
}
func (e *AuthExportedAuthorization ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode auth.exportedAuthorization#b434e2b8 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode auth.exportedAuthorization#b434e2b8: field id: %w" , err )
}
e .ID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode auth.exportedAuthorization#b434e2b8: field bytes: %w" , err )
}
e .Bytes = value
}
return nil
}
func (e *AuthExportedAuthorization ) GetID () (value int64 ) {
if e == nil {
return
}
return e .ID
}
func (e *AuthExportedAuthorization ) GetBytes () (value []byte ) {
if e == nil {
return
}
return e .Bytes
}
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 .