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 AutoSaveException struct {
Peer PeerClass
Settings AutoSaveSettings
}
const AutoSaveExceptionTypeID = 0x81602d47
var (
_ bin .Encoder = &AutoSaveException {}
_ bin .Decoder = &AutoSaveException {}
_ bin .BareEncoder = &AutoSaveException {}
_ bin .BareDecoder = &AutoSaveException {}
)
func (a *AutoSaveException ) Zero () bool {
if a == nil {
return true
}
if !(a .Peer == nil ) {
return false
}
if !(a .Settings .Zero ()) {
return false
}
return true
}
func (a *AutoSaveException ) String () string {
if a == nil {
return "AutoSaveException(nil)"
}
type Alias AutoSaveException
return fmt .Sprintf ("AutoSaveException%+v" , Alias (*a ))
}
func (a *AutoSaveException ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetSettings () (value AutoSaveSettings )
}) {
a .Peer = from .GetPeer ()
a .Settings = from .GetSettings ()
}
func (*AutoSaveException ) TypeID () uint32 {
return AutoSaveExceptionTypeID
}
func (*AutoSaveException ) TypeName () string {
return "autoSaveException"
}
func (a *AutoSaveException ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "autoSaveException" ,
ID : AutoSaveExceptionTypeID ,
}
if a == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Settings" ,
SchemaName : "settings" ,
},
}
return typ
}
func (a *AutoSaveException ) Encode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode autoSaveException#81602d47 as nil" )
}
b .PutID (AutoSaveExceptionTypeID )
return a .EncodeBare (b )
}
func (a *AutoSaveException ) EncodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode autoSaveException#81602d47 as nil" )
}
if a .Peer == nil {
return fmt .Errorf ("unable to encode autoSaveException#81602d47: field peer is nil" )
}
if err := a .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode autoSaveException#81602d47: field peer: %w" , err )
}
if err := a .Settings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode autoSaveException#81602d47: field settings: %w" , err )
}
return nil
}
func (a *AutoSaveException ) Decode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode autoSaveException#81602d47 to nil" )
}
if err := b .ConsumeID (AutoSaveExceptionTypeID ); err != nil {
return fmt .Errorf ("unable to decode autoSaveException#81602d47: %w" , err )
}
return a .DecodeBare (b )
}
func (a *AutoSaveException ) DecodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode autoSaveException#81602d47 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode autoSaveException#81602d47: field peer: %w" , err )
}
a .Peer = value
}
{
if err := a .Settings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode autoSaveException#81602d47: field settings: %w" , err )
}
}
return nil
}
func (a *AutoSaveException ) GetPeer () (value PeerClass ) {
if a == nil {
return
}
return a .Peer
}
func (a *AutoSaveException ) GetSettings () (value AutoSaveSettings ) {
if a == nil {
return
}
return a .Settings
}
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 .