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 InputFolderPeer struct {
Peer InputPeerClass
FolderID int
}
const InputFolderPeerTypeID = 0xfbd2c296
var (
_ bin .Encoder = &InputFolderPeer {}
_ bin .Decoder = &InputFolderPeer {}
_ bin .BareEncoder = &InputFolderPeer {}
_ bin .BareDecoder = &InputFolderPeer {}
)
func (i *InputFolderPeer ) Zero () bool {
if i == nil {
return true
}
if !(i .Peer == nil ) {
return false
}
if !(i .FolderID == 0 ) {
return false
}
return true
}
func (i *InputFolderPeer ) String () string {
if i == nil {
return "InputFolderPeer(nil)"
}
type Alias InputFolderPeer
return fmt .Sprintf ("InputFolderPeer%+v" , Alias (*i ))
}
func (i *InputFolderPeer ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetFolderID () (value int )
}) {
i .Peer = from .GetPeer ()
i .FolderID = from .GetFolderID ()
}
func (*InputFolderPeer ) TypeID () uint32 {
return InputFolderPeerTypeID
}
func (*InputFolderPeer ) TypeName () string {
return "inputFolderPeer"
}
func (i *InputFolderPeer ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputFolderPeer" ,
ID : InputFolderPeerTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
},
}
return typ
}
func (i *InputFolderPeer ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputFolderPeer#fbd2c296 as nil" )
}
b .PutID (InputFolderPeerTypeID )
return i .EncodeBare (b )
}
func (i *InputFolderPeer ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputFolderPeer#fbd2c296 as nil" )
}
if i .Peer == nil {
return fmt .Errorf ("unable to encode inputFolderPeer#fbd2c296: field peer is nil" )
}
if err := i .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputFolderPeer#fbd2c296: field peer: %w" , err )
}
b .PutInt (i .FolderID )
return nil
}
func (i *InputFolderPeer ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputFolderPeer#fbd2c296 to nil" )
}
if err := b .ConsumeID (InputFolderPeerTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputFolderPeer#fbd2c296: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputFolderPeer ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputFolderPeer#fbd2c296 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode inputFolderPeer#fbd2c296: field peer: %w" , err )
}
i .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputFolderPeer#fbd2c296: field folder_id: %w" , err )
}
i .FolderID = value
}
return nil
}
func (i *InputFolderPeer ) GetPeer () (value InputPeerClass ) {
if i == nil {
return
}
return i .Peer
}
func (i *InputFolderPeer ) GetFolderID () (value int ) {
if i == nil {
return
}
return i .FolderID
}
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 .