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 ChatlistsExportedChatlistInvite struct {
Filter DialogFilterClass
Invite ExportedChatlistInvite
}
const ChatlistsExportedChatlistInviteTypeID = 0x10e6e3a6
var (
_ bin .Encoder = &ChatlistsExportedChatlistInvite {}
_ bin .Decoder = &ChatlistsExportedChatlistInvite {}
_ bin .BareEncoder = &ChatlistsExportedChatlistInvite {}
_ bin .BareDecoder = &ChatlistsExportedChatlistInvite {}
)
func (e *ChatlistsExportedChatlistInvite ) Zero () bool {
if e == nil {
return true
}
if !(e .Filter == nil ) {
return false
}
if !(e .Invite .Zero ()) {
return false
}
return true
}
func (e *ChatlistsExportedChatlistInvite ) String () string {
if e == nil {
return "ChatlistsExportedChatlistInvite(nil)"
}
type Alias ChatlistsExportedChatlistInvite
return fmt .Sprintf ("ChatlistsExportedChatlistInvite%+v" , Alias (*e ))
}
func (e *ChatlistsExportedChatlistInvite ) FillFrom (from interface {
GetFilter () (value DialogFilterClass )
GetInvite () (value ExportedChatlistInvite )
}) {
e .Filter = from .GetFilter ()
e .Invite = from .GetInvite ()
}
func (*ChatlistsExportedChatlistInvite ) TypeID () uint32 {
return ChatlistsExportedChatlistInviteTypeID
}
func (*ChatlistsExportedChatlistInvite ) TypeName () string {
return "chatlists.exportedChatlistInvite"
}
func (e *ChatlistsExportedChatlistInvite ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "chatlists.exportedChatlistInvite" ,
ID : ChatlistsExportedChatlistInviteTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Filter" ,
SchemaName : "filter" ,
},
{
Name : "Invite" ,
SchemaName : "invite" ,
},
}
return typ
}
func (e *ChatlistsExportedChatlistInvite ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode chatlists.exportedChatlistInvite#10e6e3a6 as nil" )
}
b .PutID (ChatlistsExportedChatlistInviteTypeID )
return e .EncodeBare (b )
}
func (e *ChatlistsExportedChatlistInvite ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode chatlists.exportedChatlistInvite#10e6e3a6 as nil" )
}
if e .Filter == nil {
return fmt .Errorf ("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field filter is nil" )
}
if err := e .Filter .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field filter: %w" , err )
}
if err := e .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatlists.exportedChatlistInvite#10e6e3a6: field invite: %w" , err )
}
return nil
}
func (e *ChatlistsExportedChatlistInvite ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode chatlists.exportedChatlistInvite#10e6e3a6 to nil" )
}
if err := b .ConsumeID (ChatlistsExportedChatlistInviteTypeID ); err != nil {
return fmt .Errorf ("unable to decode chatlists.exportedChatlistInvite#10e6e3a6: %w" , err )
}
return e .DecodeBare (b )
}
func (e *ChatlistsExportedChatlistInvite ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode chatlists.exportedChatlistInvite#10e6e3a6 to nil" )
}
{
value , err := DecodeDialogFilter (b )
if err != nil {
return fmt .Errorf ("unable to decode chatlists.exportedChatlistInvite#10e6e3a6: field filter: %w" , err )
}
e .Filter = value
}
{
if err := e .Invite .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatlists.exportedChatlistInvite#10e6e3a6: field invite: %w" , err )
}
}
return nil
}
func (e *ChatlistsExportedChatlistInvite ) GetFilter () (value DialogFilterClass ) {
if e == nil {
return
}
return e .Filter
}
func (e *ChatlistsExportedChatlistInvite ) GetInvite () (value ExportedChatlistInvite ) {
if e == nil {
return
}
return e .Invite
}
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 .