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 UpdateNewMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateNewMessageTypeID = 0x1f2b0afd
func (u UpdateNewMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewMessage {}
_ bin .Decoder = &UpdateNewMessage {}
_ bin .BareEncoder = &UpdateNewMessage {}
_ bin .BareDecoder = &UpdateNewMessage {}
_ UpdateClass = &UpdateNewMessage {}
)
func (u *UpdateNewMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateNewMessage ) String () string {
if u == nil {
return "UpdateNewMessage(nil)"
}
type Alias UpdateNewMessage
return fmt .Sprintf ("UpdateNewMessage%+v" , Alias (*u ))
}
func (u *UpdateNewMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateNewMessage ) TypeID () uint32 {
return UpdateNewMessageTypeID
}
func (*UpdateNewMessage ) TypeName () string {
return "updateNewMessage"
}
func (u *UpdateNewMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewMessage" ,
ID : UpdateNewMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateNewMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewMessage#1f2b0afd as nil" )
}
b .PutID (UpdateNewMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewMessage#1f2b0afd as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewMessage#1f2b0afd: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewMessage#1f2b0afd: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateNewMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewMessage#1f2b0afd to nil" )
}
if err := b .ConsumeID (UpdateNewMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewMessage#1f2b0afd to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewMessage#1f2b0afd: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateNewMessage ) GetMessage () (value MessageClass ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateNewMessage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateNewMessage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateMessageID struct {
ID int
RandomID int64
}
const UpdateMessageIDTypeID = 0x4e90bfd6
func (u UpdateMessageID ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessageID {}
_ bin .Decoder = &UpdateMessageID {}
_ bin .BareEncoder = &UpdateMessageID {}
_ bin .BareDecoder = &UpdateMessageID {}
_ UpdateClass = &UpdateMessageID {}
)
func (u *UpdateMessageID ) Zero () bool {
if u == nil {
return true
}
if !(u .ID == 0 ) {
return false
}
if !(u .RandomID == 0 ) {
return false
}
return true
}
func (u *UpdateMessageID ) String () string {
if u == nil {
return "UpdateMessageID(nil)"
}
type Alias UpdateMessageID
return fmt .Sprintf ("UpdateMessageID%+v" , Alias (*u ))
}
func (u *UpdateMessageID ) FillFrom (from interface {
GetID () (value int )
GetRandomID () (value int64 )
}) {
u .ID = from .GetID ()
u .RandomID = from .GetRandomID ()
}
func (*UpdateMessageID ) TypeID () uint32 {
return UpdateMessageIDTypeID
}
func (*UpdateMessageID ) TypeName () string {
return "updateMessageID"
}
func (u *UpdateMessageID ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessageID" ,
ID : UpdateMessageIDTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "RandomID" ,
SchemaName : "random_id" ,
},
}
return typ
}
func (u *UpdateMessageID ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageID#4e90bfd6 as nil" )
}
b .PutID (UpdateMessageIDTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessageID ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageID#4e90bfd6 as nil" )
}
b .PutInt (u .ID )
b .PutLong (u .RandomID )
return nil
}
func (u *UpdateMessageID ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageID#4e90bfd6 to nil" )
}
if err := b .ConsumeID (UpdateMessageIDTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessageID ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageID#4e90bfd6 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageID#4e90bfd6: field random_id: %w" , err )
}
u .RandomID = value
}
return nil
}
func (u *UpdateMessageID ) GetID () (value int ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateMessageID ) GetRandomID () (value int64 ) {
if u == nil {
return
}
return u .RandomID
}
type UpdateDeleteMessages struct {
Messages []int
Pts int
PtsCount int
}
const UpdateDeleteMessagesTypeID = 0xa20db0e5
func (u UpdateDeleteMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteMessages {}
_ bin .Decoder = &UpdateDeleteMessages {}
_ bin .BareEncoder = &UpdateDeleteMessages {}
_ bin .BareDecoder = &UpdateDeleteMessages {}
_ UpdateClass = &UpdateDeleteMessages {}
)
func (u *UpdateDeleteMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateDeleteMessages ) String () string {
if u == nil {
return "UpdateDeleteMessages(nil)"
}
type Alias UpdateDeleteMessages
return fmt .Sprintf ("UpdateDeleteMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteMessages ) FillFrom (from interface {
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateDeleteMessages ) TypeID () uint32 {
return UpdateDeleteMessagesTypeID
}
func (*UpdateDeleteMessages ) TypeName () string {
return "updateDeleteMessages"
}
func (u *UpdateDeleteMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteMessages" ,
ID : UpdateDeleteMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateDeleteMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteMessages#a20db0e5 as nil" )
}
b .PutID (UpdateDeleteMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteMessages#a20db0e5 as nil" )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateDeleteMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteMessages#a20db0e5 to nil" )
}
if err := b .ConsumeID (UpdateDeleteMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteMessages#a20db0e5 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteMessages#a20db0e5: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateDeleteMessages ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
func (u *UpdateDeleteMessages ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateDeleteMessages ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateUserTyping struct {
UserID int64
Action SendMessageActionClass
}
const UpdateUserTypingTypeID = 0xc01e857f
func (u UpdateUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserTyping {}
_ bin .Decoder = &UpdateUserTyping {}
_ bin .BareEncoder = &UpdateUserTyping {}
_ bin .BareDecoder = &UpdateUserTyping {}
_ UpdateClass = &UpdateUserTyping {}
)
func (u *UpdateUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateUserTyping ) String () string {
if u == nil {
return "UpdateUserTyping(nil)"
}
type Alias UpdateUserTyping
return fmt .Sprintf ("UpdateUserTyping%+v" , Alias (*u ))
}
func (u *UpdateUserTyping ) FillFrom (from interface {
GetUserID () (value int64 )
GetAction () (value SendMessageActionClass )
}) {
u .UserID = from .GetUserID ()
u .Action = from .GetAction ()
}
func (*UpdateUserTyping ) TypeID () uint32 {
return UpdateUserTypingTypeID
}
func (*UpdateUserTyping ) TypeName () string {
return "updateUserTyping"
}
func (u *UpdateUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserTyping" ,
ID : UpdateUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserTyping#c01e857f as nil" )
}
b .PutID (UpdateUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserTyping#c01e857f as nil" )
}
b .PutLong (u .UserID )
if u .Action == nil {
return fmt .Errorf ("unable to encode updateUserTyping#c01e857f: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserTyping#c01e857f: field action: %w" , err )
}
return nil
}
func (u *UpdateUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserTyping#c01e857f to nil" )
}
if err := b .ConsumeID (UpdateUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#c01e857f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserTyping#c01e857f to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#c01e857f: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserTyping#c01e857f: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u *UpdateUserTyping ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateUserTyping ) GetAction () (value SendMessageActionClass ) {
if u == nil {
return
}
return u .Action
}
type UpdateChatUserTyping struct {
ChatID int64
FromID PeerClass
Action SendMessageActionClass
}
const UpdateChatUserTypingTypeID = 0x83487af0
func (u UpdateChatUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatUserTyping {}
_ bin .Decoder = &UpdateChatUserTyping {}
_ bin .BareEncoder = &UpdateChatUserTyping {}
_ bin .BareDecoder = &UpdateChatUserTyping {}
_ UpdateClass = &UpdateChatUserTyping {}
)
func (u *UpdateChatUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .FromID == nil ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateChatUserTyping ) String () string {
if u == nil {
return "UpdateChatUserTyping(nil)"
}
type Alias UpdateChatUserTyping
return fmt .Sprintf ("UpdateChatUserTyping%+v" , Alias (*u ))
}
func (u *UpdateChatUserTyping ) FillFrom (from interface {
GetChatID () (value int64 )
GetFromID () (value PeerClass )
GetAction () (value SendMessageActionClass )
}) {
u .ChatID = from .GetChatID ()
u .FromID = from .GetFromID ()
u .Action = from .GetAction ()
}
func (*UpdateChatUserTyping ) TypeID () uint32 {
return UpdateChatUserTypingTypeID
}
func (*UpdateChatUserTyping ) TypeName () string {
return "updateChatUserTyping"
}
func (u *UpdateChatUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatUserTyping" ,
ID : UpdateChatUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "FromID" ,
SchemaName : "from_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateChatUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatUserTyping#83487af0 as nil" )
}
b .PutID (UpdateChatUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatUserTyping#83487af0 as nil" )
}
b .PutLong (u .ChatID )
if u .FromID == nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#83487af0: field from_id is nil" )
}
if err := u .FromID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#83487af0: field from_id: %w" , err )
}
if u .Action == nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#83487af0: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatUserTyping#83487af0: field action: %w" , err )
}
return nil
}
func (u *UpdateChatUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatUserTyping#83487af0 to nil" )
}
if err := b .ConsumeID (UpdateChatUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#83487af0: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatUserTyping#83487af0 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#83487af0: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#83487af0: field from_id: %w" , err )
}
u .FromID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatUserTyping#83487af0: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u *UpdateChatUserTyping ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateChatUserTyping ) GetFromID () (value PeerClass ) {
if u == nil {
return
}
return u .FromID
}
func (u *UpdateChatUserTyping ) GetAction () (value SendMessageActionClass ) {
if u == nil {
return
}
return u .Action
}
type UpdateChatParticipants struct {
Participants ChatParticipantsClass
}
const UpdateChatParticipantsTypeID = 0x7761198
func (u UpdateChatParticipants ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipants {}
_ bin .Decoder = &UpdateChatParticipants {}
_ bin .BareEncoder = &UpdateChatParticipants {}
_ bin .BareDecoder = &UpdateChatParticipants {}
_ UpdateClass = &UpdateChatParticipants {}
)
func (u *UpdateChatParticipants ) Zero () bool {
if u == nil {
return true
}
if !(u .Participants == nil ) {
return false
}
return true
}
func (u *UpdateChatParticipants ) String () string {
if u == nil {
return "UpdateChatParticipants(nil)"
}
type Alias UpdateChatParticipants
return fmt .Sprintf ("UpdateChatParticipants%+v" , Alias (*u ))
}
func (u *UpdateChatParticipants ) FillFrom (from interface {
GetParticipants () (value ChatParticipantsClass )
}) {
u .Participants = from .GetParticipants ()
}
func (*UpdateChatParticipants ) TypeID () uint32 {
return UpdateChatParticipantsTypeID
}
func (*UpdateChatParticipants ) TypeName () string {
return "updateChatParticipants"
}
func (u *UpdateChatParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipants" ,
ID : UpdateChatParticipantsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Participants" ,
SchemaName : "participants" ,
},
}
return typ
}
func (u *UpdateChatParticipants ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipants#7761198 as nil" )
}
b .PutID (UpdateChatParticipantsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipants ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipants#7761198 as nil" )
}
if u .Participants == nil {
return fmt .Errorf ("unable to encode updateChatParticipants#7761198: field participants is nil" )
}
if err := u .Participants .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipants#7761198: field participants: %w" , err )
}
return nil
}
func (u *UpdateChatParticipants ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipants#7761198 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipants#7761198: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipants ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipants#7761198 to nil" )
}
{
value , err := DecodeChatParticipants (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipants#7761198: field participants: %w" , err )
}
u .Participants = value
}
return nil
}
func (u *UpdateChatParticipants ) GetParticipants () (value ChatParticipantsClass ) {
if u == nil {
return
}
return u .Participants
}
type UpdateUserStatus struct {
UserID int64
Status UserStatusClass
}
const UpdateUserStatusTypeID = 0xe5bdf8de
func (u UpdateUserStatus ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserStatus {}
_ bin .Decoder = &UpdateUserStatus {}
_ bin .BareEncoder = &UpdateUserStatus {}
_ bin .BareDecoder = &UpdateUserStatus {}
_ UpdateClass = &UpdateUserStatus {}
)
func (u *UpdateUserStatus ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Status == nil ) {
return false
}
return true
}
func (u *UpdateUserStatus ) String () string {
if u == nil {
return "UpdateUserStatus(nil)"
}
type Alias UpdateUserStatus
return fmt .Sprintf ("UpdateUserStatus%+v" , Alias (*u ))
}
func (u *UpdateUserStatus ) FillFrom (from interface {
GetUserID () (value int64 )
GetStatus () (value UserStatusClass )
}) {
u .UserID = from .GetUserID ()
u .Status = from .GetStatus ()
}
func (*UpdateUserStatus ) TypeID () uint32 {
return UpdateUserStatusTypeID
}
func (*UpdateUserStatus ) TypeName () string {
return "updateUserStatus"
}
func (u *UpdateUserStatus ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserStatus" ,
ID : UpdateUserStatusTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Status" ,
SchemaName : "status" ,
},
}
return typ
}
func (u *UpdateUserStatus ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserStatus#e5bdf8de as nil" )
}
b .PutID (UpdateUserStatusTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserStatus ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserStatus#e5bdf8de as nil" )
}
b .PutLong (u .UserID )
if u .Status == nil {
return fmt .Errorf ("unable to encode updateUserStatus#e5bdf8de: field status is nil" )
}
if err := u .Status .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserStatus#e5bdf8de: field status: %w" , err )
}
return nil
}
func (u *UpdateUserStatus ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserStatus#e5bdf8de to nil" )
}
if err := b .ConsumeID (UpdateUserStatusTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#e5bdf8de: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserStatus ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserStatus#e5bdf8de to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#e5bdf8de: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeUserStatus (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserStatus#e5bdf8de: field status: %w" , err )
}
u .Status = value
}
return nil
}
func (u *UpdateUserStatus ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateUserStatus ) GetStatus () (value UserStatusClass ) {
if u == nil {
return
}
return u .Status
}
type UpdateUserName struct {
UserID int64
FirstName string
LastName string
Usernames []Username
}
const UpdateUserNameTypeID = 0xa7848924
func (u UpdateUserName ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserName {}
_ bin .Decoder = &UpdateUserName {}
_ bin .BareEncoder = &UpdateUserName {}
_ bin .BareDecoder = &UpdateUserName {}
_ UpdateClass = &UpdateUserName {}
)
func (u *UpdateUserName ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .FirstName == "" ) {
return false
}
if !(u .LastName == "" ) {
return false
}
if !(u .Usernames == nil ) {
return false
}
return true
}
func (u *UpdateUserName ) String () string {
if u == nil {
return "UpdateUserName(nil)"
}
type Alias UpdateUserName
return fmt .Sprintf ("UpdateUserName%+v" , Alias (*u ))
}
func (u *UpdateUserName ) FillFrom (from interface {
GetUserID () (value int64 )
GetFirstName () (value string )
GetLastName () (value string )
GetUsernames () (value []Username )
}) {
u .UserID = from .GetUserID ()
u .FirstName = from .GetFirstName ()
u .LastName = from .GetLastName ()
u .Usernames = from .GetUsernames ()
}
func (*UpdateUserName ) TypeID () uint32 {
return UpdateUserNameTypeID
}
func (*UpdateUserName ) TypeName () string {
return "updateUserName"
}
func (u *UpdateUserName ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserName" ,
ID : UpdateUserNameTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "FirstName" ,
SchemaName : "first_name" ,
},
{
Name : "LastName" ,
SchemaName : "last_name" ,
},
{
Name : "Usernames" ,
SchemaName : "usernames" ,
},
}
return typ
}
func (u *UpdateUserName ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserName#a7848924 as nil" )
}
b .PutID (UpdateUserNameTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserName ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserName#a7848924 as nil" )
}
b .PutLong (u .UserID )
b .PutString (u .FirstName )
b .PutString (u .LastName )
b .PutVectorHeader (len (u .Usernames ))
for idx , v := range u .Usernames {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserName#a7848924: field usernames element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateUserName ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserName#a7848924 to nil" )
}
if err := b .ConsumeID (UpdateUserNameTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserName ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserName#a7848924 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: field first_name: %w" , err )
}
u .FirstName = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: field last_name: %w" , err )
}
u .LastName = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: field usernames: %w" , err )
}
if headerLen > 0 {
u .Usernames = make ([]Username , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value Username
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateUserName#a7848924: field usernames: %w" , err )
}
u .Usernames = append (u .Usernames , value )
}
}
return nil
}
func (u *UpdateUserName ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateUserName ) GetFirstName () (value string ) {
if u == nil {
return
}
return u .FirstName
}
func (u *UpdateUserName ) GetLastName () (value string ) {
if u == nil {
return
}
return u .LastName
}
func (u *UpdateUserName ) GetUsernames () (value []Username ) {
if u == nil {
return
}
return u .Usernames
}
type UpdateNewAuthorization struct {
Flags bin .Fields
Unconfirmed bool
Hash int64
Date int
Device string
Location string
}
const UpdateNewAuthorizationTypeID = 0x8951abef
func (u UpdateNewAuthorization ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewAuthorization {}
_ bin .Decoder = &UpdateNewAuthorization {}
_ bin .BareEncoder = &UpdateNewAuthorization {}
_ bin .BareDecoder = &UpdateNewAuthorization {}
_ UpdateClass = &UpdateNewAuthorization {}
)
func (u *UpdateNewAuthorization ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Unconfirmed == false ) {
return false
}
if !(u .Hash == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Device == "" ) {
return false
}
if !(u .Location == "" ) {
return false
}
return true
}
func (u *UpdateNewAuthorization ) String () string {
if u == nil {
return "UpdateNewAuthorization(nil)"
}
type Alias UpdateNewAuthorization
return fmt .Sprintf ("UpdateNewAuthorization%+v" , Alias (*u ))
}
func (u *UpdateNewAuthorization ) FillFrom (from interface {
GetUnconfirmed () (value bool )
GetHash () (value int64 )
GetDate () (value int , ok bool )
GetDevice () (value string , ok bool )
GetLocation () (value string , ok bool )
}) {
u .Unconfirmed = from .GetUnconfirmed ()
u .Hash = from .GetHash ()
if val , ok := from .GetDate (); ok {
u .Date = val
}
if val , ok := from .GetDevice (); ok {
u .Device = val
}
if val , ok := from .GetLocation (); ok {
u .Location = val
}
}
func (*UpdateNewAuthorization ) TypeID () uint32 {
return UpdateNewAuthorizationTypeID
}
func (*UpdateNewAuthorization ) TypeName () string {
return "updateNewAuthorization"
}
func (u *UpdateNewAuthorization ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewAuthorization" ,
ID : UpdateNewAuthorizationTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Unconfirmed" ,
SchemaName : "unconfirmed" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Hash" ,
SchemaName : "hash" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Device" ,
SchemaName : "device" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Location" ,
SchemaName : "location" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateNewAuthorization ) SetFlags () {
if !(u .Unconfirmed == false ) {
u .Flags .Set (0 )
}
if !(u .Date == 0 ) {
u .Flags .Set (0 )
}
if !(u .Device == "" ) {
u .Flags .Set (0 )
}
if !(u .Location == "" ) {
u .Flags .Set (0 )
}
}
func (u *UpdateNewAuthorization ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewAuthorization#8951abef as nil" )
}
b .PutID (UpdateNewAuthorizationTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewAuthorization ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewAuthorization#8951abef as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewAuthorization#8951abef: field flags: %w" , err )
}
b .PutLong (u .Hash )
if u .Flags .Has (0 ) {
b .PutInt (u .Date )
}
if u .Flags .Has (0 ) {
b .PutString (u .Device )
}
if u .Flags .Has (0 ) {
b .PutString (u .Location )
}
return nil
}
func (u *UpdateNewAuthorization ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewAuthorization#8951abef to nil" )
}
if err := b .ConsumeID (UpdateNewAuthorizationTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewAuthorization ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewAuthorization#8951abef to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: field flags: %w" , err )
}
}
u .Unconfirmed = u .Flags .Has (0 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: field hash: %w" , err )
}
u .Hash = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: field date: %w" , err )
}
u .Date = value
}
if u .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: field device: %w" , err )
}
u .Device = value
}
if u .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewAuthorization#8951abef: field location: %w" , err )
}
u .Location = value
}
return nil
}
func (u *UpdateNewAuthorization ) SetUnconfirmed (value bool ) {
if value {
u .Flags .Set (0 )
u .Unconfirmed = true
} else {
u .Flags .Unset (0 )
u .Unconfirmed = false
}
}
func (u *UpdateNewAuthorization ) GetUnconfirmed () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateNewAuthorization ) GetHash () (value int64 ) {
if u == nil {
return
}
return u .Hash
}
func (u *UpdateNewAuthorization ) SetDate (value int ) {
u .Flags .Set (0 )
u .Date = value
}
func (u *UpdateNewAuthorization ) GetDate () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Date , true
}
func (u *UpdateNewAuthorization ) SetDevice (value string ) {
u .Flags .Set (0 )
u .Device = value
}
func (u *UpdateNewAuthorization ) GetDevice () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Device , true
}
func (u *UpdateNewAuthorization ) SetLocation (value string ) {
u .Flags .Set (0 )
u .Location = value
}
func (u *UpdateNewAuthorization ) GetLocation () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Location , true
}
type UpdateNewEncryptedMessage struct {
Message EncryptedMessageClass
Qts int
}
const UpdateNewEncryptedMessageTypeID = 0x12bcbd9a
func (u UpdateNewEncryptedMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewEncryptedMessage {}
_ bin .Decoder = &UpdateNewEncryptedMessage {}
_ bin .BareEncoder = &UpdateNewEncryptedMessage {}
_ bin .BareDecoder = &UpdateNewEncryptedMessage {}
_ UpdateClass = &UpdateNewEncryptedMessage {}
)
func (u *UpdateNewEncryptedMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateNewEncryptedMessage ) String () string {
if u == nil {
return "UpdateNewEncryptedMessage(nil)"
}
type Alias UpdateNewEncryptedMessage
return fmt .Sprintf ("UpdateNewEncryptedMessage%+v" , Alias (*u ))
}
func (u *UpdateNewEncryptedMessage ) FillFrom (from interface {
GetMessage () (value EncryptedMessageClass )
GetQts () (value int )
}) {
u .Message = from .GetMessage ()
u .Qts = from .GetQts ()
}
func (*UpdateNewEncryptedMessage ) TypeID () uint32 {
return UpdateNewEncryptedMessageTypeID
}
func (*UpdateNewEncryptedMessage ) TypeName () string {
return "updateNewEncryptedMessage"
}
func (u *UpdateNewEncryptedMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewEncryptedMessage" ,
ID : UpdateNewEncryptedMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateNewEncryptedMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewEncryptedMessage#12bcbd9a as nil" )
}
b .PutID (UpdateNewEncryptedMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewEncryptedMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewEncryptedMessage#12bcbd9a as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewEncryptedMessage#12bcbd9a: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewEncryptedMessage#12bcbd9a: field message: %w" , err )
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateNewEncryptedMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewEncryptedMessage#12bcbd9a to nil" )
}
if err := b .ConsumeID (UpdateNewEncryptedMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewEncryptedMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewEncryptedMessage#12bcbd9a to nil" )
}
{
value , err := DecodeEncryptedMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewEncryptedMessage#12bcbd9a: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateNewEncryptedMessage ) GetMessage () (value EncryptedMessageClass ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateNewEncryptedMessage ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateEncryptedChatTyping struct {
ChatID int
}
const UpdateEncryptedChatTypingTypeID = 0x1710f156
func (u UpdateEncryptedChatTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryptedChatTyping {}
_ bin .Decoder = &UpdateEncryptedChatTyping {}
_ bin .BareEncoder = &UpdateEncryptedChatTyping {}
_ bin .BareDecoder = &UpdateEncryptedChatTyping {}
_ UpdateClass = &UpdateEncryptedChatTyping {}
)
func (u *UpdateEncryptedChatTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
return true
}
func (u *UpdateEncryptedChatTyping ) String () string {
if u == nil {
return "UpdateEncryptedChatTyping(nil)"
}
type Alias UpdateEncryptedChatTyping
return fmt .Sprintf ("UpdateEncryptedChatTyping%+v" , Alias (*u ))
}
func (u *UpdateEncryptedChatTyping ) FillFrom (from interface {
GetChatID () (value int )
}) {
u .ChatID = from .GetChatID ()
}
func (*UpdateEncryptedChatTyping ) TypeID () uint32 {
return UpdateEncryptedChatTypingTypeID
}
func (*UpdateEncryptedChatTyping ) TypeName () string {
return "updateEncryptedChatTyping"
}
func (u *UpdateEncryptedChatTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryptedChatTyping" ,
ID : UpdateEncryptedChatTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (u *UpdateEncryptedChatTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedChatTyping#1710f156 as nil" )
}
b .PutID (UpdateEncryptedChatTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryptedChatTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedChatTyping#1710f156 as nil" )
}
b .PutInt (u .ChatID )
return nil
}
func (u *UpdateEncryptedChatTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedChatTyping#1710f156 to nil" )
}
if err := b .ConsumeID (UpdateEncryptedChatTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryptedChatTyping#1710f156: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryptedChatTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedChatTyping#1710f156 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedChatTyping#1710f156: field chat_id: %w" , err )
}
u .ChatID = value
}
return nil
}
func (u *UpdateEncryptedChatTyping ) GetChatID () (value int ) {
if u == nil {
return
}
return u .ChatID
}
type UpdateEncryption struct {
Chat EncryptedChatClass
Date int
}
const UpdateEncryptionTypeID = 0xb4a2e88d
func (u UpdateEncryption ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryption {}
_ bin .Decoder = &UpdateEncryption {}
_ bin .BareEncoder = &UpdateEncryption {}
_ bin .BareDecoder = &UpdateEncryption {}
_ UpdateClass = &UpdateEncryption {}
)
func (u *UpdateEncryption ) Zero () bool {
if u == nil {
return true
}
if !(u .Chat == nil ) {
return false
}
if !(u .Date == 0 ) {
return false
}
return true
}
func (u *UpdateEncryption ) String () string {
if u == nil {
return "UpdateEncryption(nil)"
}
type Alias UpdateEncryption
return fmt .Sprintf ("UpdateEncryption%+v" , Alias (*u ))
}
func (u *UpdateEncryption ) FillFrom (from interface {
GetChat () (value EncryptedChatClass )
GetDate () (value int )
}) {
u .Chat = from .GetChat ()
u .Date = from .GetDate ()
}
func (*UpdateEncryption ) TypeID () uint32 {
return UpdateEncryptionTypeID
}
func (*UpdateEncryption ) TypeName () string {
return "updateEncryption"
}
func (u *UpdateEncryption ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryption" ,
ID : UpdateEncryptionTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chat" ,
SchemaName : "chat" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (u *UpdateEncryption ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryption#b4a2e88d as nil" )
}
b .PutID (UpdateEncryptionTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryption ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryption#b4a2e88d as nil" )
}
if u .Chat == nil {
return fmt .Errorf ("unable to encode updateEncryption#b4a2e88d: field chat is nil" )
}
if err := u .Chat .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEncryption#b4a2e88d: field chat: %w" , err )
}
b .PutInt (u .Date )
return nil
}
func (u *UpdateEncryption ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryption#b4a2e88d to nil" )
}
if err := b .ConsumeID (UpdateEncryptionTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryption ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryption#b4a2e88d to nil" )
}
{
value , err := DecodeEncryptedChat (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: field chat: %w" , err )
}
u .Chat = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryption#b4a2e88d: field date: %w" , err )
}
u .Date = value
}
return nil
}
func (u *UpdateEncryption ) GetChat () (value EncryptedChatClass ) {
if u == nil {
return
}
return u .Chat
}
func (u *UpdateEncryption ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
type UpdateEncryptedMessagesRead struct {
ChatID int
MaxDate int
Date int
}
const UpdateEncryptedMessagesReadTypeID = 0x38fe25b7
func (u UpdateEncryptedMessagesRead ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEncryptedMessagesRead {}
_ bin .Decoder = &UpdateEncryptedMessagesRead {}
_ bin .BareEncoder = &UpdateEncryptedMessagesRead {}
_ bin .BareDecoder = &UpdateEncryptedMessagesRead {}
_ UpdateClass = &UpdateEncryptedMessagesRead {}
)
func (u *UpdateEncryptedMessagesRead ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .MaxDate == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
return true
}
func (u *UpdateEncryptedMessagesRead ) String () string {
if u == nil {
return "UpdateEncryptedMessagesRead(nil)"
}
type Alias UpdateEncryptedMessagesRead
return fmt .Sprintf ("UpdateEncryptedMessagesRead%+v" , Alias (*u ))
}
func (u *UpdateEncryptedMessagesRead ) FillFrom (from interface {
GetChatID () (value int )
GetMaxDate () (value int )
GetDate () (value int )
}) {
u .ChatID = from .GetChatID ()
u .MaxDate = from .GetMaxDate ()
u .Date = from .GetDate ()
}
func (*UpdateEncryptedMessagesRead ) TypeID () uint32 {
return UpdateEncryptedMessagesReadTypeID
}
func (*UpdateEncryptedMessagesRead ) TypeName () string {
return "updateEncryptedMessagesRead"
}
func (u *UpdateEncryptedMessagesRead ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEncryptedMessagesRead" ,
ID : UpdateEncryptedMessagesReadTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "MaxDate" ,
SchemaName : "max_date" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (u *UpdateEncryptedMessagesRead ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedMessagesRead#38fe25b7 as nil" )
}
b .PutID (UpdateEncryptedMessagesReadTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEncryptedMessagesRead ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEncryptedMessagesRead#38fe25b7 as nil" )
}
b .PutInt (u .ChatID )
b .PutInt (u .MaxDate )
b .PutInt (u .Date )
return nil
}
func (u *UpdateEncryptedMessagesRead ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedMessagesRead#38fe25b7 to nil" )
}
if err := b .ConsumeID (UpdateEncryptedMessagesReadTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEncryptedMessagesRead ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEncryptedMessagesRead#38fe25b7 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field max_date: %w" , err )
}
u .MaxDate = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEncryptedMessagesRead#38fe25b7: field date: %w" , err )
}
u .Date = value
}
return nil
}
func (u *UpdateEncryptedMessagesRead ) GetChatID () (value int ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateEncryptedMessagesRead ) GetMaxDate () (value int ) {
if u == nil {
return
}
return u .MaxDate
}
func (u *UpdateEncryptedMessagesRead ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
type UpdateChatParticipantAdd struct {
ChatID int64
UserID int64
InviterID int64
Date int
Version int
}
const UpdateChatParticipantAddTypeID = 0x3dda5451
func (u UpdateChatParticipantAdd ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantAdd {}
_ bin .Decoder = &UpdateChatParticipantAdd {}
_ bin .BareEncoder = &UpdateChatParticipantAdd {}
_ bin .BareDecoder = &UpdateChatParticipantAdd {}
_ UpdateClass = &UpdateChatParticipantAdd {}
)
func (u *UpdateChatParticipantAdd ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .InviterID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantAdd ) String () string {
if u == nil {
return "UpdateChatParticipantAdd(nil)"
}
type Alias UpdateChatParticipantAdd
return fmt .Sprintf ("UpdateChatParticipantAdd%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantAdd ) FillFrom (from interface {
GetChatID () (value int64 )
GetUserID () (value int64 )
GetInviterID () (value int64 )
GetDate () (value int )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .InviterID = from .GetInviterID ()
u .Date = from .GetDate ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantAdd ) TypeID () uint32 {
return UpdateChatParticipantAddTypeID
}
func (*UpdateChatParticipantAdd ) TypeName () string {
return "updateChatParticipantAdd"
}
func (u *UpdateChatParticipantAdd ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantAdd" ,
ID : UpdateChatParticipantAddTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "InviterID" ,
SchemaName : "inviter_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantAdd ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdd#3dda5451 as nil" )
}
b .PutID (UpdateChatParticipantAddTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantAdd ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdd#3dda5451 as nil" )
}
b .PutLong (u .ChatID )
b .PutLong (u .UserID )
b .PutLong (u .InviterID )
b .PutInt (u .Date )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantAdd ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdd#3dda5451 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantAddTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantAdd ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdd#3dda5451 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: field inviter_id: %w" , err )
}
u .InviterID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdd#3dda5451: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u *UpdateChatParticipantAdd ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateChatParticipantAdd ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateChatParticipantAdd ) GetInviterID () (value int64 ) {
if u == nil {
return
}
return u .InviterID
}
func (u *UpdateChatParticipantAdd ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateChatParticipantAdd ) GetVersion () (value int ) {
if u == nil {
return
}
return u .Version
}
type UpdateChatParticipantDelete struct {
ChatID int64
UserID int64
Version int
}
const UpdateChatParticipantDeleteTypeID = 0xe32f3d77
func (u UpdateChatParticipantDelete ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantDelete {}
_ bin .Decoder = &UpdateChatParticipantDelete {}
_ bin .BareEncoder = &UpdateChatParticipantDelete {}
_ bin .BareDecoder = &UpdateChatParticipantDelete {}
_ UpdateClass = &UpdateChatParticipantDelete {}
)
func (u *UpdateChatParticipantDelete ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantDelete ) String () string {
if u == nil {
return "UpdateChatParticipantDelete(nil)"
}
type Alias UpdateChatParticipantDelete
return fmt .Sprintf ("UpdateChatParticipantDelete%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantDelete ) FillFrom (from interface {
GetChatID () (value int64 )
GetUserID () (value int64 )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantDelete ) TypeID () uint32 {
return UpdateChatParticipantDeleteTypeID
}
func (*UpdateChatParticipantDelete ) TypeName () string {
return "updateChatParticipantDelete"
}
func (u *UpdateChatParticipantDelete ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantDelete" ,
ID : UpdateChatParticipantDeleteTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantDelete ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantDelete#e32f3d77 as nil" )
}
b .PutID (UpdateChatParticipantDeleteTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantDelete ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantDelete#e32f3d77 as nil" )
}
b .PutLong (u .ChatID )
b .PutLong (u .UserID )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantDelete ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantDelete#e32f3d77 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantDeleteTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#e32f3d77: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantDelete ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantDelete#e32f3d77 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#e32f3d77: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#e32f3d77: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantDelete#e32f3d77: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u *UpdateChatParticipantDelete ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateChatParticipantDelete ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateChatParticipantDelete ) GetVersion () (value int ) {
if u == nil {
return
}
return u .Version
}
type UpdateDCOptions struct {
DCOptions []DCOption
}
const UpdateDCOptionsTypeID = 0x8e5e9873
func (u UpdateDCOptions ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDCOptions {}
_ bin .Decoder = &UpdateDCOptions {}
_ bin .BareEncoder = &UpdateDCOptions {}
_ bin .BareDecoder = &UpdateDCOptions {}
_ UpdateClass = &UpdateDCOptions {}
)
func (u *UpdateDCOptions ) Zero () bool {
if u == nil {
return true
}
if !(u .DCOptions == nil ) {
return false
}
return true
}
func (u *UpdateDCOptions ) String () string {
if u == nil {
return "UpdateDCOptions(nil)"
}
type Alias UpdateDCOptions
return fmt .Sprintf ("UpdateDCOptions%+v" , Alias (*u ))
}
func (u *UpdateDCOptions ) FillFrom (from interface {
GetDCOptions () (value []DCOption )
}) {
u .DCOptions = from .GetDCOptions ()
}
func (*UpdateDCOptions ) TypeID () uint32 {
return UpdateDCOptionsTypeID
}
func (*UpdateDCOptions ) TypeName () string {
return "updateDcOptions"
}
func (u *UpdateDCOptions ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDcOptions" ,
ID : UpdateDCOptionsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DCOptions" ,
SchemaName : "dc_options" ,
},
}
return typ
}
func (u *UpdateDCOptions ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDcOptions#8e5e9873 as nil" )
}
b .PutID (UpdateDCOptionsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDCOptions ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDcOptions#8e5e9873 as nil" )
}
b .PutVectorHeader (len (u .DCOptions ))
for idx , v := range u .DCOptions {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDcOptions#8e5e9873: field dc_options element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateDCOptions ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDcOptions#8e5e9873 to nil" )
}
if err := b .ConsumeID (UpdateDCOptionsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDCOptions ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDcOptions#8e5e9873 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: field dc_options: %w" , err )
}
if headerLen > 0 {
u .DCOptions = make ([]DCOption , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value DCOption
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDcOptions#8e5e9873: field dc_options: %w" , err )
}
u .DCOptions = append (u .DCOptions , value )
}
}
return nil
}
func (u *UpdateDCOptions ) GetDCOptions () (value []DCOption ) {
if u == nil {
return
}
return u .DCOptions
}
type UpdateNotifySettings struct {
Peer NotifyPeerClass
NotifySettings PeerNotifySettings
}
const UpdateNotifySettingsTypeID = 0xbec268ef
func (u UpdateNotifySettings ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNotifySettings {}
_ bin .Decoder = &UpdateNotifySettings {}
_ bin .BareEncoder = &UpdateNotifySettings {}
_ bin .BareDecoder = &UpdateNotifySettings {}
_ UpdateClass = &UpdateNotifySettings {}
)
func (u *UpdateNotifySettings ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .NotifySettings .Zero ()) {
return false
}
return true
}
func (u *UpdateNotifySettings ) String () string {
if u == nil {
return "UpdateNotifySettings(nil)"
}
type Alias UpdateNotifySettings
return fmt .Sprintf ("UpdateNotifySettings%+v" , Alias (*u ))
}
func (u *UpdateNotifySettings ) FillFrom (from interface {
GetPeer () (value NotifyPeerClass )
GetNotifySettings () (value PeerNotifySettings )
}) {
u .Peer = from .GetPeer ()
u .NotifySettings = from .GetNotifySettings ()
}
func (*UpdateNotifySettings ) TypeID () uint32 {
return UpdateNotifySettingsTypeID
}
func (*UpdateNotifySettings ) TypeName () string {
return "updateNotifySettings"
}
func (u *UpdateNotifySettings ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNotifySettings" ,
ID : UpdateNotifySettingsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "NotifySettings" ,
SchemaName : "notify_settings" ,
},
}
return typ
}
func (u *UpdateNotifySettings ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNotifySettings#bec268ef as nil" )
}
b .PutID (UpdateNotifySettingsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNotifySettings ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNotifySettings#bec268ef as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field peer: %w" , err )
}
if err := u .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNotifySettings#bec268ef: field notify_settings: %w" , err )
}
return nil
}
func (u *UpdateNotifySettings ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNotifySettings#bec268ef to nil" )
}
if err := b .ConsumeID (UpdateNotifySettingsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNotifySettings ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNotifySettings#bec268ef to nil" )
}
{
value , err := DecodeNotifyPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateNotifySettings#bec268ef: field notify_settings: %w" , err )
}
}
return nil
}
func (u *UpdateNotifySettings ) GetPeer () (value NotifyPeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateNotifySettings ) GetNotifySettings () (value PeerNotifySettings ) {
if u == nil {
return
}
return u .NotifySettings
}
type UpdateServiceNotification struct {
Flags bin .Fields
Popup bool
InvertMedia bool
InboxDate int
Type string
Message string
Media MessageMediaClass
Entities []MessageEntityClass
}
const UpdateServiceNotificationTypeID = 0xebe46819
func (u UpdateServiceNotification ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateServiceNotification {}
_ bin .Decoder = &UpdateServiceNotification {}
_ bin .BareEncoder = &UpdateServiceNotification {}
_ bin .BareDecoder = &UpdateServiceNotification {}
_ UpdateClass = &UpdateServiceNotification {}
)
func (u *UpdateServiceNotification ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Popup == false ) {
return false
}
if !(u .InvertMedia == false ) {
return false
}
if !(u .InboxDate == 0 ) {
return false
}
if !(u .Type == "" ) {
return false
}
if !(u .Message == "" ) {
return false
}
if !(u .Media == nil ) {
return false
}
if !(u .Entities == nil ) {
return false
}
return true
}
func (u *UpdateServiceNotification ) String () string {
if u == nil {
return "UpdateServiceNotification(nil)"
}
type Alias UpdateServiceNotification
return fmt .Sprintf ("UpdateServiceNotification%+v" , Alias (*u ))
}
func (u *UpdateServiceNotification ) FillFrom (from interface {
GetPopup () (value bool )
GetInvertMedia () (value bool )
GetInboxDate () (value int , ok bool )
GetType () (value string )
GetMessage () (value string )
GetMedia () (value MessageMediaClass )
GetEntities () (value []MessageEntityClass )
}) {
u .Popup = from .GetPopup ()
u .InvertMedia = from .GetInvertMedia ()
if val , ok := from .GetInboxDate (); ok {
u .InboxDate = val
}
u .Type = from .GetType ()
u .Message = from .GetMessage ()
u .Media = from .GetMedia ()
u .Entities = from .GetEntities ()
}
func (*UpdateServiceNotification ) TypeID () uint32 {
return UpdateServiceNotificationTypeID
}
func (*UpdateServiceNotification ) TypeName () string {
return "updateServiceNotification"
}
func (u *UpdateServiceNotification ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateServiceNotification" ,
ID : UpdateServiceNotificationTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Popup" ,
SchemaName : "popup" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "InvertMedia" ,
SchemaName : "invert_media" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "InboxDate" ,
SchemaName : "inbox_date" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Media" ,
SchemaName : "media" ,
},
{
Name : "Entities" ,
SchemaName : "entities" ,
},
}
return typ
}
func (u *UpdateServiceNotification ) SetFlags () {
if !(u .Popup == false ) {
u .Flags .Set (0 )
}
if !(u .InvertMedia == false ) {
u .Flags .Set (2 )
}
if !(u .InboxDate == 0 ) {
u .Flags .Set (1 )
}
}
func (u *UpdateServiceNotification ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateServiceNotification#ebe46819 as nil" )
}
b .PutID (UpdateServiceNotificationTypeID )
return u .EncodeBare (b )
}
func (u *UpdateServiceNotification ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateServiceNotification#ebe46819 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .InboxDate )
}
b .PutString (u .Type )
b .PutString (u .Message )
if u .Media == nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field media is nil" )
}
if err := u .Media .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field media: %w" , err )
}
b .PutVectorHeader (len (u .Entities ))
for idx , v := range u .Entities {
if v == nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field entities element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateServiceNotification#ebe46819: field entities element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateServiceNotification ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateServiceNotification#ebe46819 to nil" )
}
if err := b .ConsumeID (UpdateServiceNotificationTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateServiceNotification ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateServiceNotification#ebe46819 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field flags: %w" , err )
}
}
u .Popup = u .Flags .Has (0 )
u .InvertMedia = u .Flags .Has (2 )
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field inbox_date: %w" , err )
}
u .InboxDate = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field type: %w" , err )
}
u .Type = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field message: %w" , err )
}
u .Message = value
}
{
value , err := DecodeMessageMedia (b )
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field media: %w" , err )
}
u .Media = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field entities: %w" , err )
}
if headerLen > 0 {
u .Entities = make ([]MessageEntityClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeMessageEntity (b )
if err != nil {
return fmt .Errorf ("unable to decode updateServiceNotification#ebe46819: field entities: %w" , err )
}
u .Entities = append (u .Entities , value )
}
}
return nil
}
func (u *UpdateServiceNotification ) SetPopup (value bool ) {
if value {
u .Flags .Set (0 )
u .Popup = true
} else {
u .Flags .Unset (0 )
u .Popup = false
}
}
func (u *UpdateServiceNotification ) GetPopup () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateServiceNotification ) SetInvertMedia (value bool ) {
if value {
u .Flags .Set (2 )
u .InvertMedia = true
} else {
u .Flags .Unset (2 )
u .InvertMedia = false
}
}
func (u *UpdateServiceNotification ) GetInvertMedia () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (2 )
}
func (u *UpdateServiceNotification ) SetInboxDate (value int ) {
u .Flags .Set (1 )
u .InboxDate = value
}
func (u *UpdateServiceNotification ) GetInboxDate () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .InboxDate , true
}
func (u *UpdateServiceNotification ) GetType () (value string ) {
if u == nil {
return
}
return u .Type
}
func (u *UpdateServiceNotification ) GetMessage () (value string ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateServiceNotification ) GetMedia () (value MessageMediaClass ) {
if u == nil {
return
}
return u .Media
}
func (u *UpdateServiceNotification ) GetEntities () (value []MessageEntityClass ) {
if u == nil {
return
}
return u .Entities
}
func (u *UpdateServiceNotification ) MapEntities () (value MessageEntityClassArray ) {
return MessageEntityClassArray (u .Entities )
}
type UpdatePrivacy struct {
Key PrivacyKeyClass
Rules []PrivacyRuleClass
}
const UpdatePrivacyTypeID = 0xee3b272a
func (u UpdatePrivacy ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePrivacy {}
_ bin .Decoder = &UpdatePrivacy {}
_ bin .BareEncoder = &UpdatePrivacy {}
_ bin .BareDecoder = &UpdatePrivacy {}
_ UpdateClass = &UpdatePrivacy {}
)
func (u *UpdatePrivacy ) Zero () bool {
if u == nil {
return true
}
if !(u .Key == nil ) {
return false
}
if !(u .Rules == nil ) {
return false
}
return true
}
func (u *UpdatePrivacy ) String () string {
if u == nil {
return "UpdatePrivacy(nil)"
}
type Alias UpdatePrivacy
return fmt .Sprintf ("UpdatePrivacy%+v" , Alias (*u ))
}
func (u *UpdatePrivacy ) FillFrom (from interface {
GetKey () (value PrivacyKeyClass )
GetRules () (value []PrivacyRuleClass )
}) {
u .Key = from .GetKey ()
u .Rules = from .GetRules ()
}
func (*UpdatePrivacy ) TypeID () uint32 {
return UpdatePrivacyTypeID
}
func (*UpdatePrivacy ) TypeName () string {
return "updatePrivacy"
}
func (u *UpdatePrivacy ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePrivacy" ,
ID : UpdatePrivacyTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Key" ,
SchemaName : "key" ,
},
{
Name : "Rules" ,
SchemaName : "rules" ,
},
}
return typ
}
func (u *UpdatePrivacy ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePrivacy#ee3b272a as nil" )
}
b .PutID (UpdatePrivacyTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePrivacy ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePrivacy#ee3b272a as nil" )
}
if u .Key == nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field key is nil" )
}
if err := u .Key .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field key: %w" , err )
}
b .PutVectorHeader (len (u .Rules ))
for idx , v := range u .Rules {
if v == nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field rules element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePrivacy#ee3b272a: field rules element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdatePrivacy ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePrivacy#ee3b272a to nil" )
}
if err := b .ConsumeID (UpdatePrivacyTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePrivacy ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePrivacy#ee3b272a to nil" )
}
{
value , err := DecodePrivacyKey (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field key: %w" , err )
}
u .Key = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field rules: %w" , err )
}
if headerLen > 0 {
u .Rules = make ([]PrivacyRuleClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePrivacyRule (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePrivacy#ee3b272a: field rules: %w" , err )
}
u .Rules = append (u .Rules , value )
}
}
return nil
}
func (u *UpdatePrivacy ) GetKey () (value PrivacyKeyClass ) {
if u == nil {
return
}
return u .Key
}
func (u *UpdatePrivacy ) GetRules () (value []PrivacyRuleClass ) {
if u == nil {
return
}
return u .Rules
}
func (u *UpdatePrivacy ) MapRules () (value PrivacyRuleClassArray ) {
return PrivacyRuleClassArray (u .Rules )
}
type UpdateUserPhone struct {
UserID int64
Phone string
}
const UpdateUserPhoneTypeID = 0x5492a13
func (u UpdateUserPhone ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserPhone {}
_ bin .Decoder = &UpdateUserPhone {}
_ bin .BareEncoder = &UpdateUserPhone {}
_ bin .BareDecoder = &UpdateUserPhone {}
_ UpdateClass = &UpdateUserPhone {}
)
func (u *UpdateUserPhone ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Phone == "" ) {
return false
}
return true
}
func (u *UpdateUserPhone ) String () string {
if u == nil {
return "UpdateUserPhone(nil)"
}
type Alias UpdateUserPhone
return fmt .Sprintf ("UpdateUserPhone%+v" , Alias (*u ))
}
func (u *UpdateUserPhone ) FillFrom (from interface {
GetUserID () (value int64 )
GetPhone () (value string )
}) {
u .UserID = from .GetUserID ()
u .Phone = from .GetPhone ()
}
func (*UpdateUserPhone ) TypeID () uint32 {
return UpdateUserPhoneTypeID
}
func (*UpdateUserPhone ) TypeName () string {
return "updateUserPhone"
}
func (u *UpdateUserPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserPhone" ,
ID : UpdateUserPhoneTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Phone" ,
SchemaName : "phone" ,
},
}
return typ
}
func (u *UpdateUserPhone ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhone#5492a13 as nil" )
}
b .PutID (UpdateUserPhoneTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserPhone ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserPhone#5492a13 as nil" )
}
b .PutLong (u .UserID )
b .PutString (u .Phone )
return nil
}
func (u *UpdateUserPhone ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhone#5492a13 to nil" )
}
if err := b .ConsumeID (UpdateUserPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#5492a13: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserPhone ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserPhone#5492a13 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#5492a13: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserPhone#5492a13: field phone: %w" , err )
}
u .Phone = value
}
return nil
}
func (u *UpdateUserPhone ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateUserPhone ) GetPhone () (value string ) {
if u == nil {
return
}
return u .Phone
}
type UpdateReadHistoryInbox struct {
Flags bin .Fields
FolderID int
Peer PeerClass
MaxID int
StillUnreadCount int
Pts int
PtsCount int
}
const UpdateReadHistoryInboxTypeID = 0x9c974fdf
func (u UpdateReadHistoryInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadHistoryInbox {}
_ bin .Decoder = &UpdateReadHistoryInbox {}
_ bin .BareEncoder = &UpdateReadHistoryInbox {}
_ bin .BareDecoder = &UpdateReadHistoryInbox {}
_ UpdateClass = &UpdateReadHistoryInbox {}
)
func (u *UpdateReadHistoryInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .StillUnreadCount == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateReadHistoryInbox ) String () string {
if u == nil {
return "UpdateReadHistoryInbox(nil)"
}
type Alias UpdateReadHistoryInbox
return fmt .Sprintf ("UpdateReadHistoryInbox%+v" , Alias (*u ))
}
func (u *UpdateReadHistoryInbox ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetPeer () (value PeerClass )
GetMaxID () (value int )
GetStillUnreadCount () (value int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .Peer = from .GetPeer ()
u .MaxID = from .GetMaxID ()
u .StillUnreadCount = from .GetStillUnreadCount ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateReadHistoryInbox ) TypeID () uint32 {
return UpdateReadHistoryInboxTypeID
}
func (*UpdateReadHistoryInbox ) TypeName () string {
return "updateReadHistoryInbox"
}
func (u *UpdateReadHistoryInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadHistoryInbox" ,
ID : UpdateReadHistoryInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "StillUnreadCount" ,
SchemaName : "still_unread_count" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateReadHistoryInbox ) SetFlags () {
if !(u .FolderID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateReadHistoryInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryInbox#9c974fdf as nil" )
}
b .PutID (UpdateReadHistoryInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadHistoryInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryInbox#9c974fdf as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field flags: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .FolderID )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryInbox#9c974fdf: field peer: %w" , err )
}
b .PutInt (u .MaxID )
b .PutInt (u .StillUnreadCount )
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateReadHistoryInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryInbox#9c974fdf to nil" )
}
if err := b .ConsumeID (UpdateReadHistoryInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadHistoryInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryInbox#9c974fdf to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field flags: %w" , err )
}
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field still_unread_count: %w" , err )
}
u .StillUnreadCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryInbox#9c974fdf: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateReadHistoryInbox ) SetFolderID (value int ) {
u .Flags .Set (0 )
u .FolderID = value
}
func (u *UpdateReadHistoryInbox ) GetFolderID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateReadHistoryInbox ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateReadHistoryInbox ) GetMaxID () (value int ) {
if u == nil {
return
}
return u .MaxID
}
func (u *UpdateReadHistoryInbox ) GetStillUnreadCount () (value int ) {
if u == nil {
return
}
return u .StillUnreadCount
}
func (u *UpdateReadHistoryInbox ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateReadHistoryInbox ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateReadHistoryOutbox struct {
Peer PeerClass
MaxID int
Pts int
PtsCount int
}
const UpdateReadHistoryOutboxTypeID = 0x2f2f21bf
func (u UpdateReadHistoryOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadHistoryOutbox {}
_ bin .Decoder = &UpdateReadHistoryOutbox {}
_ bin .BareEncoder = &UpdateReadHistoryOutbox {}
_ bin .BareDecoder = &UpdateReadHistoryOutbox {}
_ UpdateClass = &UpdateReadHistoryOutbox {}
)
func (u *UpdateReadHistoryOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateReadHistoryOutbox ) String () string {
if u == nil {
return "UpdateReadHistoryOutbox(nil)"
}
type Alias UpdateReadHistoryOutbox
return fmt .Sprintf ("UpdateReadHistoryOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadHistoryOutbox ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMaxID () (value int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Peer = from .GetPeer ()
u .MaxID = from .GetMaxID ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateReadHistoryOutbox ) TypeID () uint32 {
return UpdateReadHistoryOutboxTypeID
}
func (*UpdateReadHistoryOutbox ) TypeName () string {
return "updateReadHistoryOutbox"
}
func (u *UpdateReadHistoryOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadHistoryOutbox" ,
ID : UpdateReadHistoryOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateReadHistoryOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryOutbox#2f2f21bf as nil" )
}
b .PutID (UpdateReadHistoryOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadHistoryOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadHistoryOutbox#2f2f21bf as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadHistoryOutbox#2f2f21bf: field peer: %w" , err )
}
b .PutInt (u .MaxID )
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateReadHistoryOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryOutbox#2f2f21bf to nil" )
}
if err := b .ConsumeID (UpdateReadHistoryOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadHistoryOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadHistoryOutbox#2f2f21bf to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadHistoryOutbox#2f2f21bf: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateReadHistoryOutbox ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateReadHistoryOutbox ) GetMaxID () (value int ) {
if u == nil {
return
}
return u .MaxID
}
func (u *UpdateReadHistoryOutbox ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateReadHistoryOutbox ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateWebPage struct {
Webpage WebPageClass
Pts int
PtsCount int
}
const UpdateWebPageTypeID = 0x7f891213
func (u UpdateWebPage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateWebPage {}
_ bin .Decoder = &UpdateWebPage {}
_ bin .BareEncoder = &UpdateWebPage {}
_ bin .BareDecoder = &UpdateWebPage {}
_ UpdateClass = &UpdateWebPage {}
)
func (u *UpdateWebPage ) Zero () bool {
if u == nil {
return true
}
if !(u .Webpage == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateWebPage ) String () string {
if u == nil {
return "UpdateWebPage(nil)"
}
type Alias UpdateWebPage
return fmt .Sprintf ("UpdateWebPage%+v" , Alias (*u ))
}
func (u *UpdateWebPage ) FillFrom (from interface {
GetWebpage () (value WebPageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Webpage = from .GetWebpage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateWebPage ) TypeID () uint32 {
return UpdateWebPageTypeID
}
func (*UpdateWebPage ) TypeName () string {
return "updateWebPage"
}
func (u *UpdateWebPage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateWebPage" ,
ID : UpdateWebPageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Webpage" ,
SchemaName : "webpage" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateWebPage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebPage#7f891213 as nil" )
}
b .PutID (UpdateWebPageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateWebPage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebPage#7f891213 as nil" )
}
if u .Webpage == nil {
return fmt .Errorf ("unable to encode updateWebPage#7f891213: field webpage is nil" )
}
if err := u .Webpage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateWebPage#7f891213: field webpage: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateWebPage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebPage#7f891213 to nil" )
}
if err := b .ConsumeID (UpdateWebPageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateWebPage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebPage#7f891213 to nil" )
}
{
value , err := DecodeWebPage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field webpage: %w" , err )
}
u .Webpage = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateWebPage#7f891213: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateWebPage ) GetWebpage () (value WebPageClass ) {
if u == nil {
return
}
return u .Webpage
}
func (u *UpdateWebPage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateWebPage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateReadMessagesContents struct {
Flags bin .Fields
Messages []int
Pts int
PtsCount int
Date int
}
const UpdateReadMessagesContentsTypeID = 0xf8227181
func (u UpdateReadMessagesContents ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadMessagesContents {}
_ bin .Decoder = &UpdateReadMessagesContents {}
_ bin .BareEncoder = &UpdateReadMessagesContents {}
_ bin .BareDecoder = &UpdateReadMessagesContents {}
_ UpdateClass = &UpdateReadMessagesContents {}
)
func (u *UpdateReadMessagesContents ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
return true
}
func (u *UpdateReadMessagesContents ) String () string {
if u == nil {
return "UpdateReadMessagesContents(nil)"
}
type Alias UpdateReadMessagesContents
return fmt .Sprintf ("UpdateReadMessagesContents%+v" , Alias (*u ))
}
func (u *UpdateReadMessagesContents ) FillFrom (from interface {
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
GetDate () (value int , ok bool )
}) {
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
if val , ok := from .GetDate (); ok {
u .Date = val
}
}
func (*UpdateReadMessagesContents ) TypeID () uint32 {
return UpdateReadMessagesContentsTypeID
}
func (*UpdateReadMessagesContents ) TypeName () string {
return "updateReadMessagesContents"
}
func (u *UpdateReadMessagesContents ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadMessagesContents" ,
ID : UpdateReadMessagesContentsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateReadMessagesContents ) SetFlags () {
if !(u .Date == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateReadMessagesContents ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadMessagesContents#f8227181 as nil" )
}
b .PutID (UpdateReadMessagesContentsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadMessagesContents ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadMessagesContents#f8227181 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadMessagesContents#f8227181: field flags: %w" , err )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
if u .Flags .Has (0 ) {
b .PutInt (u .Date )
}
return nil
}
func (u *UpdateReadMessagesContents ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadMessagesContents#f8227181 to nil" )
}
if err := b .ConsumeID (UpdateReadMessagesContentsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadMessagesContents ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadMessagesContents#f8227181 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field flags: %w" , err )
}
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field pts_count: %w" , err )
}
u .PtsCount = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadMessagesContents#f8227181: field date: %w" , err )
}
u .Date = value
}
return nil
}
func (u *UpdateReadMessagesContents ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
func (u *UpdateReadMessagesContents ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateReadMessagesContents ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
func (u *UpdateReadMessagesContents ) SetDate (value int ) {
u .Flags .Set (0 )
u .Date = value
}
func (u *UpdateReadMessagesContents ) GetDate () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Date , true
}
type UpdateChannelTooLong struct {
Flags bin .Fields
ChannelID int64
Pts int
}
const UpdateChannelTooLongTypeID = 0x108d941f
func (u UpdateChannelTooLong ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelTooLong {}
_ bin .Decoder = &UpdateChannelTooLong {}
_ bin .BareEncoder = &UpdateChannelTooLong {}
_ bin .BareDecoder = &UpdateChannelTooLong {}
_ UpdateClass = &UpdateChannelTooLong {}
)
func (u *UpdateChannelTooLong ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
return true
}
func (u *UpdateChannelTooLong ) String () string {
if u == nil {
return "UpdateChannelTooLong(nil)"
}
type Alias UpdateChannelTooLong
return fmt .Sprintf ("UpdateChannelTooLong%+v" , Alias (*u ))
}
func (u *UpdateChannelTooLong ) FillFrom (from interface {
GetChannelID () (value int64 )
GetPts () (value int , ok bool )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetPts (); ok {
u .Pts = val
}
}
func (*UpdateChannelTooLong ) TypeID () uint32 {
return UpdateChannelTooLongTypeID
}
func (*UpdateChannelTooLong ) TypeName () string {
return "updateChannelTooLong"
}
func (u *UpdateChannelTooLong ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelTooLong" ,
ID : UpdateChannelTooLongTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateChannelTooLong ) SetFlags () {
if !(u .Pts == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateChannelTooLong ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelTooLong#108d941f as nil" )
}
b .PutID (UpdateChannelTooLongTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelTooLong ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelTooLong#108d941f as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelTooLong#108d941f: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutInt (u .Pts )
}
return nil
}
func (u *UpdateChannelTooLong ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelTooLong#108d941f to nil" )
}
if err := b .ConsumeID (UpdateChannelTooLongTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#108d941f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelTooLong ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelTooLong#108d941f to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#108d941f: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#108d941f: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelTooLong#108d941f: field pts: %w" , err )
}
u .Pts = value
}
return nil
}
func (u *UpdateChannelTooLong ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelTooLong ) SetPts (value int ) {
u .Flags .Set (0 )
u .Pts = value
}
func (u *UpdateChannelTooLong ) GetPts () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Pts , true
}
type UpdateChannel struct {
ChannelID int64
}
const UpdateChannelTypeID = 0x635b4c09
func (u UpdateChannel ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannel {}
_ bin .Decoder = &UpdateChannel {}
_ bin .BareEncoder = &UpdateChannel {}
_ bin .BareDecoder = &UpdateChannel {}
_ UpdateClass = &UpdateChannel {}
)
func (u *UpdateChannel ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
return true
}
func (u *UpdateChannel ) String () string {
if u == nil {
return "UpdateChannel(nil)"
}
type Alias UpdateChannel
return fmt .Sprintf ("UpdateChannel%+v" , Alias (*u ))
}
func (u *UpdateChannel ) FillFrom (from interface {
GetChannelID () (value int64 )
}) {
u .ChannelID = from .GetChannelID ()
}
func (*UpdateChannel ) TypeID () uint32 {
return UpdateChannelTypeID
}
func (*UpdateChannel ) TypeName () string {
return "updateChannel"
}
func (u *UpdateChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannel" ,
ID : UpdateChannelTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
}
return typ
}
func (u *UpdateChannel ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannel#635b4c09 as nil" )
}
b .PutID (UpdateChannelTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannel ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannel#635b4c09 as nil" )
}
b .PutLong (u .ChannelID )
return nil
}
func (u *UpdateChannel ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannel#635b4c09 to nil" )
}
if err := b .ConsumeID (UpdateChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannel#635b4c09: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannel ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannel#635b4c09 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannel#635b4c09: field channel_id: %w" , err )
}
u .ChannelID = value
}
return nil
}
func (u *UpdateChannel ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
type UpdateNewChannelMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateNewChannelMessageTypeID = 0x62ba04d9
func (u UpdateNewChannelMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewChannelMessage {}
_ bin .Decoder = &UpdateNewChannelMessage {}
_ bin .BareEncoder = &UpdateNewChannelMessage {}
_ bin .BareDecoder = &UpdateNewChannelMessage {}
_ UpdateClass = &UpdateNewChannelMessage {}
)
func (u *UpdateNewChannelMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateNewChannelMessage ) String () string {
if u == nil {
return "UpdateNewChannelMessage(nil)"
}
type Alias UpdateNewChannelMessage
return fmt .Sprintf ("UpdateNewChannelMessage%+v" , Alias (*u ))
}
func (u *UpdateNewChannelMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateNewChannelMessage ) TypeID () uint32 {
return UpdateNewChannelMessageTypeID
}
func (*UpdateNewChannelMessage ) TypeName () string {
return "updateNewChannelMessage"
}
func (u *UpdateNewChannelMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewChannelMessage" ,
ID : UpdateNewChannelMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateNewChannelMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewChannelMessage#62ba04d9 as nil" )
}
b .PutID (UpdateNewChannelMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewChannelMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewChannelMessage#62ba04d9 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewChannelMessage#62ba04d9: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewChannelMessage#62ba04d9: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateNewChannelMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewChannelMessage#62ba04d9 to nil" )
}
if err := b .ConsumeID (UpdateNewChannelMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewChannelMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewChannelMessage#62ba04d9 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateNewChannelMessage#62ba04d9: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateNewChannelMessage ) GetMessage () (value MessageClass ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateNewChannelMessage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateNewChannelMessage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateReadChannelInbox struct {
Flags bin .Fields
FolderID int
ChannelID int64
MaxID int
StillUnreadCount int
Pts int
}
const UpdateReadChannelInboxTypeID = 0x922e6e10
func (u UpdateReadChannelInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelInbox {}
_ bin .Decoder = &UpdateReadChannelInbox {}
_ bin .BareEncoder = &UpdateReadChannelInbox {}
_ bin .BareDecoder = &UpdateReadChannelInbox {}
_ UpdateClass = &UpdateReadChannelInbox {}
)
func (u *UpdateReadChannelInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
if !(u .StillUnreadCount == 0 ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelInbox ) String () string {
if u == nil {
return "UpdateReadChannelInbox(nil)"
}
type Alias UpdateReadChannelInbox
return fmt .Sprintf ("UpdateReadChannelInbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelInbox ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetChannelID () (value int64 )
GetMaxID () (value int )
GetStillUnreadCount () (value int )
GetPts () (value int )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .ChannelID = from .GetChannelID ()
u .MaxID = from .GetMaxID ()
u .StillUnreadCount = from .GetStillUnreadCount ()
u .Pts = from .GetPts ()
}
func (*UpdateReadChannelInbox ) TypeID () uint32 {
return UpdateReadChannelInboxTypeID
}
func (*UpdateReadChannelInbox ) TypeName () string {
return "updateReadChannelInbox"
}
func (u *UpdateReadChannelInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelInbox" ,
ID : UpdateReadChannelInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
{
Name : "StillUnreadCount" ,
SchemaName : "still_unread_count" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
}
return typ
}
func (u *UpdateReadChannelInbox ) SetFlags () {
if !(u .FolderID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateReadChannelInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelInbox#922e6e10 as nil" )
}
b .PutID (UpdateReadChannelInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelInbox#922e6e10 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadChannelInbox#922e6e10: field flags: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .FolderID )
}
b .PutLong (u .ChannelID )
b .PutInt (u .MaxID )
b .PutInt (u .StillUnreadCount )
b .PutInt (u .Pts )
return nil
}
func (u *UpdateReadChannelInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelInbox#922e6e10 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelInbox#922e6e10 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field flags: %w" , err )
}
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field max_id: %w" , err )
}
u .MaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field still_unread_count: %w" , err )
}
u .StillUnreadCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelInbox#922e6e10: field pts: %w" , err )
}
u .Pts = value
}
return nil
}
func (u *UpdateReadChannelInbox ) SetFolderID (value int ) {
u .Flags .Set (0 )
u .FolderID = value
}
func (u *UpdateReadChannelInbox ) GetFolderID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateReadChannelInbox ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateReadChannelInbox ) GetMaxID () (value int ) {
if u == nil {
return
}
return u .MaxID
}
func (u *UpdateReadChannelInbox ) GetStillUnreadCount () (value int ) {
if u == nil {
return
}
return u .StillUnreadCount
}
func (u *UpdateReadChannelInbox ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
type UpdateDeleteChannelMessages struct {
ChannelID int64
Messages []int
Pts int
PtsCount int
}
const UpdateDeleteChannelMessagesTypeID = 0xc32d5b12
func (u UpdateDeleteChannelMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteChannelMessages {}
_ bin .Decoder = &UpdateDeleteChannelMessages {}
_ bin .BareEncoder = &UpdateDeleteChannelMessages {}
_ bin .BareDecoder = &UpdateDeleteChannelMessages {}
_ UpdateClass = &UpdateDeleteChannelMessages {}
)
func (u *UpdateDeleteChannelMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateDeleteChannelMessages ) String () string {
if u == nil {
return "UpdateDeleteChannelMessages(nil)"
}
type Alias UpdateDeleteChannelMessages
return fmt .Sprintf ("UpdateDeleteChannelMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteChannelMessages ) FillFrom (from interface {
GetChannelID () (value int64 )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateDeleteChannelMessages ) TypeID () uint32 {
return UpdateDeleteChannelMessagesTypeID
}
func (*UpdateDeleteChannelMessages ) TypeName () string {
return "updateDeleteChannelMessages"
}
func (u *UpdateDeleteChannelMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteChannelMessages" ,
ID : UpdateDeleteChannelMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateDeleteChannelMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteChannelMessages#c32d5b12 as nil" )
}
b .PutID (UpdateDeleteChannelMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteChannelMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteChannelMessages#c32d5b12 as nil" )
}
b .PutLong (u .ChannelID )
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateDeleteChannelMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteChannelMessages#c32d5b12 to nil" )
}
if err := b .ConsumeID (UpdateDeleteChannelMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteChannelMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteChannelMessages#c32d5b12 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteChannelMessages#c32d5b12: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateDeleteChannelMessages ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateDeleteChannelMessages ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
func (u *UpdateDeleteChannelMessages ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateDeleteChannelMessages ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateChannelMessageViews struct {
ChannelID int64
ID int
Views int
}
const UpdateChannelMessageViewsTypeID = 0xf226ac08
func (u UpdateChannelMessageViews ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelMessageViews {}
_ bin .Decoder = &UpdateChannelMessageViews {}
_ bin .BareEncoder = &UpdateChannelMessageViews {}
_ bin .BareDecoder = &UpdateChannelMessageViews {}
_ UpdateClass = &UpdateChannelMessageViews {}
)
func (u *UpdateChannelMessageViews ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Views == 0 ) {
return false
}
return true
}
func (u *UpdateChannelMessageViews ) String () string {
if u == nil {
return "UpdateChannelMessageViews(nil)"
}
type Alias UpdateChannelMessageViews
return fmt .Sprintf ("UpdateChannelMessageViews%+v" , Alias (*u ))
}
func (u *UpdateChannelMessageViews ) FillFrom (from interface {
GetChannelID () (value int64 )
GetID () (value int )
GetViews () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .ID = from .GetID ()
u .Views = from .GetViews ()
}
func (*UpdateChannelMessageViews ) TypeID () uint32 {
return UpdateChannelMessageViewsTypeID
}
func (*UpdateChannelMessageViews ) TypeName () string {
return "updateChannelMessageViews"
}
func (u *UpdateChannelMessageViews ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelMessageViews" ,
ID : UpdateChannelMessageViewsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Views" ,
SchemaName : "views" ,
},
}
return typ
}
func (u *UpdateChannelMessageViews ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageViews#f226ac08 as nil" )
}
b .PutID (UpdateChannelMessageViewsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelMessageViews ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageViews#f226ac08 as nil" )
}
b .PutLong (u .ChannelID )
b .PutInt (u .ID )
b .PutInt (u .Views )
return nil
}
func (u *UpdateChannelMessageViews ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageViews#f226ac08 to nil" )
}
if err := b .ConsumeID (UpdateChannelMessageViewsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#f226ac08: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelMessageViews ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageViews#f226ac08 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#f226ac08: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#f226ac08: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageViews#f226ac08: field views: %w" , err )
}
u .Views = value
}
return nil
}
func (u *UpdateChannelMessageViews ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelMessageViews ) GetID () (value int ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateChannelMessageViews ) GetViews () (value int ) {
if u == nil {
return
}
return u .Views
}
type UpdateChatParticipantAdmin struct {
ChatID int64
UserID int64
IsAdmin bool
Version int
}
const UpdateChatParticipantAdminTypeID = 0xd7ca61a2
func (u UpdateChatParticipantAdmin ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipantAdmin {}
_ bin .Decoder = &UpdateChatParticipantAdmin {}
_ bin .BareEncoder = &UpdateChatParticipantAdmin {}
_ bin .BareDecoder = &UpdateChatParticipantAdmin {}
_ UpdateClass = &UpdateChatParticipantAdmin {}
)
func (u *UpdateChatParticipantAdmin ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .IsAdmin == false ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipantAdmin ) String () string {
if u == nil {
return "UpdateChatParticipantAdmin(nil)"
}
type Alias UpdateChatParticipantAdmin
return fmt .Sprintf ("UpdateChatParticipantAdmin%+v" , Alias (*u ))
}
func (u *UpdateChatParticipantAdmin ) FillFrom (from interface {
GetChatID () (value int64 )
GetUserID () (value int64 )
GetIsAdmin () (value bool )
GetVersion () (value int )
}) {
u .ChatID = from .GetChatID ()
u .UserID = from .GetUserID ()
u .IsAdmin = from .GetIsAdmin ()
u .Version = from .GetVersion ()
}
func (*UpdateChatParticipantAdmin ) TypeID () uint32 {
return UpdateChatParticipantAdminTypeID
}
func (*UpdateChatParticipantAdmin ) TypeName () string {
return "updateChatParticipantAdmin"
}
func (u *UpdateChatParticipantAdmin ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipantAdmin" ,
ID : UpdateChatParticipantAdminTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "IsAdmin" ,
SchemaName : "is_admin" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatParticipantAdmin ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdmin#d7ca61a2 as nil" )
}
b .PutID (UpdateChatParticipantAdminTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipantAdmin ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipantAdmin#d7ca61a2 as nil" )
}
b .PutLong (u .ChatID )
b .PutLong (u .UserID )
b .PutBool (u .IsAdmin )
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatParticipantAdmin ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdmin#d7ca61a2 to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantAdminTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#d7ca61a2: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipantAdmin ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipantAdmin#d7ca61a2 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#d7ca61a2: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#d7ca61a2: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#d7ca61a2: field is_admin: %w" , err )
}
u .IsAdmin = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipantAdmin#d7ca61a2: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u *UpdateChatParticipantAdmin ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateChatParticipantAdmin ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateChatParticipantAdmin ) GetIsAdmin () (value bool ) {
if u == nil {
return
}
return u .IsAdmin
}
func (u *UpdateChatParticipantAdmin ) GetVersion () (value int ) {
if u == nil {
return
}
return u .Version
}
type UpdateNewStickerSet struct {
Stickerset MessagesStickerSetClass
}
const UpdateNewStickerSetTypeID = 0x688a30aa
func (u UpdateNewStickerSet ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewStickerSet {}
_ bin .Decoder = &UpdateNewStickerSet {}
_ bin .BareEncoder = &UpdateNewStickerSet {}
_ bin .BareDecoder = &UpdateNewStickerSet {}
_ UpdateClass = &UpdateNewStickerSet {}
)
func (u *UpdateNewStickerSet ) Zero () bool {
if u == nil {
return true
}
if !(u .Stickerset == nil ) {
return false
}
return true
}
func (u *UpdateNewStickerSet ) String () string {
if u == nil {
return "UpdateNewStickerSet(nil)"
}
type Alias UpdateNewStickerSet
return fmt .Sprintf ("UpdateNewStickerSet%+v" , Alias (*u ))
}
func (u *UpdateNewStickerSet ) FillFrom (from interface {
GetStickerset () (value MessagesStickerSetClass )
}) {
u .Stickerset = from .GetStickerset ()
}
func (*UpdateNewStickerSet ) TypeID () uint32 {
return UpdateNewStickerSetTypeID
}
func (*UpdateNewStickerSet ) TypeName () string {
return "updateNewStickerSet"
}
func (u *UpdateNewStickerSet ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewStickerSet" ,
ID : UpdateNewStickerSetTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
}
return typ
}
func (u *UpdateNewStickerSet ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewStickerSet#688a30aa as nil" )
}
b .PutID (UpdateNewStickerSetTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewStickerSet ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewStickerSet#688a30aa as nil" )
}
if u .Stickerset == nil {
return fmt .Errorf ("unable to encode updateNewStickerSet#688a30aa: field stickerset is nil" )
}
if err := u .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewStickerSet#688a30aa: field stickerset: %w" , err )
}
return nil
}
func (u *UpdateNewStickerSet ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewStickerSet#688a30aa to nil" )
}
if err := b .ConsumeID (UpdateNewStickerSetTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewStickerSet#688a30aa: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewStickerSet ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewStickerSet#688a30aa to nil" )
}
{
value , err := DecodeMessagesStickerSet (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewStickerSet#688a30aa: field stickerset: %w" , err )
}
u .Stickerset = value
}
return nil
}
func (u *UpdateNewStickerSet ) GetStickerset () (value MessagesStickerSetClass ) {
if u == nil {
return
}
return u .Stickerset
}
type UpdateStickerSetsOrder struct {
Flags bin .Fields
Masks bool
Emojis bool
Order []int64
}
const UpdateStickerSetsOrderTypeID = 0xbb2d201
func (u UpdateStickerSetsOrder ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStickerSetsOrder {}
_ bin .Decoder = &UpdateStickerSetsOrder {}
_ bin .BareEncoder = &UpdateStickerSetsOrder {}
_ bin .BareDecoder = &UpdateStickerSetsOrder {}
_ UpdateClass = &UpdateStickerSetsOrder {}
)
func (u *UpdateStickerSetsOrder ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Masks == false ) {
return false
}
if !(u .Emojis == false ) {
return false
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdateStickerSetsOrder ) String () string {
if u == nil {
return "UpdateStickerSetsOrder(nil)"
}
type Alias UpdateStickerSetsOrder
return fmt .Sprintf ("UpdateStickerSetsOrder%+v" , Alias (*u ))
}
func (u *UpdateStickerSetsOrder ) FillFrom (from interface {
GetMasks () (value bool )
GetEmojis () (value bool )
GetOrder () (value []int64 )
}) {
u .Masks = from .GetMasks ()
u .Emojis = from .GetEmojis ()
u .Order = from .GetOrder ()
}
func (*UpdateStickerSetsOrder ) TypeID () uint32 {
return UpdateStickerSetsOrderTypeID
}
func (*UpdateStickerSetsOrder ) TypeName () string {
return "updateStickerSetsOrder"
}
func (u *UpdateStickerSetsOrder ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStickerSetsOrder" ,
ID : UpdateStickerSetsOrderTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Masks" ,
SchemaName : "masks" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Emojis" ,
SchemaName : "emojis" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Order" ,
SchemaName : "order" ,
},
}
return typ
}
func (u *UpdateStickerSetsOrder ) SetFlags () {
if !(u .Masks == false ) {
u .Flags .Set (0 )
}
if !(u .Emojis == false ) {
u .Flags .Set (1 )
}
}
func (u *UpdateStickerSetsOrder ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSetsOrder#bb2d201 as nil" )
}
b .PutID (UpdateStickerSetsOrderTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStickerSetsOrder ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSetsOrder#bb2d201 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStickerSetsOrder#bb2d201: field flags: %w" , err )
}
b .PutVectorHeader (len (u .Order ))
for _ , v := range u .Order {
b .PutLong (v )
}
return nil
}
func (u *UpdateStickerSetsOrder ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSetsOrder#bb2d201 to nil" )
}
if err := b .ConsumeID (UpdateStickerSetsOrderTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStickerSetsOrder ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSetsOrder#bb2d201 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field flags: %w" , err )
}
}
u .Masks = u .Flags .Has (0 )
u .Emojis = u .Flags .Has (1 )
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field order: %w" , err )
}
if headerLen > 0 {
u .Order = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateStickerSetsOrder#bb2d201: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u *UpdateStickerSetsOrder ) SetMasks (value bool ) {
if value {
u .Flags .Set (0 )
u .Masks = true
} else {
u .Flags .Unset (0 )
u .Masks = false
}
}
func (u *UpdateStickerSetsOrder ) GetMasks () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateStickerSetsOrder ) SetEmojis (value bool ) {
if value {
u .Flags .Set (1 )
u .Emojis = true
} else {
u .Flags .Unset (1 )
u .Emojis = false
}
}
func (u *UpdateStickerSetsOrder ) GetEmojis () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (1 )
}
func (u *UpdateStickerSetsOrder ) GetOrder () (value []int64 ) {
if u == nil {
return
}
return u .Order
}
type UpdateStickerSets struct {
Flags bin .Fields
Masks bool
Emojis bool
}
const UpdateStickerSetsTypeID = 0x31c24808
func (u UpdateStickerSets ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStickerSets {}
_ bin .Decoder = &UpdateStickerSets {}
_ bin .BareEncoder = &UpdateStickerSets {}
_ bin .BareDecoder = &UpdateStickerSets {}
_ UpdateClass = &UpdateStickerSets {}
)
func (u *UpdateStickerSets ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Masks == false ) {
return false
}
if !(u .Emojis == false ) {
return false
}
return true
}
func (u *UpdateStickerSets ) String () string {
if u == nil {
return "UpdateStickerSets(nil)"
}
type Alias UpdateStickerSets
return fmt .Sprintf ("UpdateStickerSets%+v" , Alias (*u ))
}
func (u *UpdateStickerSets ) FillFrom (from interface {
GetMasks () (value bool )
GetEmojis () (value bool )
}) {
u .Masks = from .GetMasks ()
u .Emojis = from .GetEmojis ()
}
func (*UpdateStickerSets ) TypeID () uint32 {
return UpdateStickerSetsTypeID
}
func (*UpdateStickerSets ) TypeName () string {
return "updateStickerSets"
}
func (u *UpdateStickerSets ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStickerSets" ,
ID : UpdateStickerSetsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Masks" ,
SchemaName : "masks" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Emojis" ,
SchemaName : "emojis" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateStickerSets ) SetFlags () {
if !(u .Masks == false ) {
u .Flags .Set (0 )
}
if !(u .Emojis == false ) {
u .Flags .Set (1 )
}
}
func (u *UpdateStickerSets ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSets#31c24808 as nil" )
}
b .PutID (UpdateStickerSetsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStickerSets ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStickerSets#31c24808 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStickerSets#31c24808: field flags: %w" , err )
}
return nil
}
func (u *UpdateStickerSets ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSets#31c24808 to nil" )
}
if err := b .ConsumeID (UpdateStickerSetsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSets#31c24808: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStickerSets ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStickerSets#31c24808 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateStickerSets#31c24808: field flags: %w" , err )
}
}
u .Masks = u .Flags .Has (0 )
u .Emojis = u .Flags .Has (1 )
return nil
}
func (u *UpdateStickerSets ) SetMasks (value bool ) {
if value {
u .Flags .Set (0 )
u .Masks = true
} else {
u .Flags .Unset (0 )
u .Masks = false
}
}
func (u *UpdateStickerSets ) GetMasks () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateStickerSets ) SetEmojis (value bool ) {
if value {
u .Flags .Set (1 )
u .Emojis = true
} else {
u .Flags .Unset (1 )
u .Emojis = false
}
}
func (u *UpdateStickerSets ) GetEmojis () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (1 )
}
type UpdateSavedGifs struct {
}
const UpdateSavedGifsTypeID = 0x9375341e
func (u UpdateSavedGifs ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateSavedGifs {}
_ bin .Decoder = &UpdateSavedGifs {}
_ bin .BareEncoder = &UpdateSavedGifs {}
_ bin .BareDecoder = &UpdateSavedGifs {}
_ UpdateClass = &UpdateSavedGifs {}
)
func (u *UpdateSavedGifs ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateSavedGifs ) String () string {
if u == nil {
return "UpdateSavedGifs(nil)"
}
type Alias UpdateSavedGifs
return fmt .Sprintf ("UpdateSavedGifs%+v" , Alias (*u ))
}
func (*UpdateSavedGifs ) TypeID () uint32 {
return UpdateSavedGifsTypeID
}
func (*UpdateSavedGifs ) TypeName () string {
return "updateSavedGifs"
}
func (u *UpdateSavedGifs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateSavedGifs" ,
ID : UpdateSavedGifsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateSavedGifs ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedGifs#9375341e as nil" )
}
b .PutID (UpdateSavedGifsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateSavedGifs ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedGifs#9375341e as nil" )
}
return nil
}
func (u *UpdateSavedGifs ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedGifs#9375341e to nil" )
}
if err := b .ConsumeID (UpdateSavedGifsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateSavedGifs#9375341e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateSavedGifs ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedGifs#9375341e to nil" )
}
return nil
}
type UpdateBotInlineQuery struct {
Flags bin .Fields
QueryID int64
UserID int64
Query string
Geo GeoPointClass
PeerType InlineQueryPeerTypeClass
Offset string
}
const UpdateBotInlineQueryTypeID = 0x496f379c
func (u UpdateBotInlineQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotInlineQuery {}
_ bin .Decoder = &UpdateBotInlineQuery {}
_ bin .BareEncoder = &UpdateBotInlineQuery {}
_ bin .BareDecoder = &UpdateBotInlineQuery {}
_ UpdateClass = &UpdateBotInlineQuery {}
)
func (u *UpdateBotInlineQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Query == "" ) {
return false
}
if !(u .Geo == nil ) {
return false
}
if !(u .PeerType == nil ) {
return false
}
if !(u .Offset == "" ) {
return false
}
return true
}
func (u *UpdateBotInlineQuery ) String () string {
if u == nil {
return "UpdateBotInlineQuery(nil)"
}
type Alias UpdateBotInlineQuery
return fmt .Sprintf ("UpdateBotInlineQuery%+v" , Alias (*u ))
}
func (u *UpdateBotInlineQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int64 )
GetQuery () (value string )
GetGeo () (value GeoPointClass , ok bool )
GetPeerType () (value InlineQueryPeerTypeClass , ok bool )
GetOffset () (value string )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Query = from .GetQuery ()
if val , ok := from .GetGeo (); ok {
u .Geo = val
}
if val , ok := from .GetPeerType (); ok {
u .PeerType = val
}
u .Offset = from .GetOffset ()
}
func (*UpdateBotInlineQuery ) TypeID () uint32 {
return UpdateBotInlineQueryTypeID
}
func (*UpdateBotInlineQuery ) TypeName () string {
return "updateBotInlineQuery"
}
func (u *UpdateBotInlineQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotInlineQuery" ,
ID : UpdateBotInlineQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
{
Name : "Geo" ,
SchemaName : "geo" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "PeerType" ,
SchemaName : "peer_type" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Offset" ,
SchemaName : "offset" ,
},
}
return typ
}
func (u *UpdateBotInlineQuery ) SetFlags () {
if !(u .Geo == nil ) {
u .Flags .Set (0 )
}
if !(u .PeerType == nil ) {
u .Flags .Set (1 )
}
}
func (u *UpdateBotInlineQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineQuery#496f379c as nil" )
}
b .PutID (UpdateBotInlineQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotInlineQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineQuery#496f379c as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#496f379c: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutLong (u .UserID )
b .PutString (u .Query )
if u .Flags .Has (0 ) {
if u .Geo == nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#496f379c: field geo is nil" )
}
if err := u .Geo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#496f379c: field geo: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .PeerType == nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#496f379c: field peer_type is nil" )
}
if err := u .PeerType .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineQuery#496f379c: field peer_type: %w" , err )
}
}
b .PutString (u .Offset )
return nil
}
func (u *UpdateBotInlineQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineQuery#496f379c to nil" )
}
if err := b .ConsumeID (UpdateBotInlineQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotInlineQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineQuery#496f379c to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field query: %w" , err )
}
u .Query = value
}
if u .Flags .Has (0 ) {
value , err := DecodeGeoPoint (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field geo: %w" , err )
}
u .Geo = value
}
if u .Flags .Has (1 ) {
value , err := DecodeInlineQueryPeerType (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field peer_type: %w" , err )
}
u .PeerType = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineQuery#496f379c: field offset: %w" , err )
}
u .Offset = value
}
return nil
}
func (u *UpdateBotInlineQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateBotInlineQuery ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotInlineQuery ) GetQuery () (value string ) {
if u == nil {
return
}
return u .Query
}
func (u *UpdateBotInlineQuery ) SetGeo (value GeoPointClass ) {
u .Flags .Set (0 )
u .Geo = value
}
func (u *UpdateBotInlineQuery ) GetGeo () (value GeoPointClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Geo , true
}
func (u *UpdateBotInlineQuery ) SetPeerType (value InlineQueryPeerTypeClass ) {
u .Flags .Set (1 )
u .PeerType = value
}
func (u *UpdateBotInlineQuery ) GetPeerType () (value InlineQueryPeerTypeClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .PeerType , true
}
func (u *UpdateBotInlineQuery ) GetOffset () (value string ) {
if u == nil {
return
}
return u .Offset
}
type UpdateBotInlineSend struct {
Flags bin .Fields
UserID int64
Query string
Geo GeoPointClass
ID string
MsgID InputBotInlineMessageIDClass
}
const UpdateBotInlineSendTypeID = 0x12f12a07
func (u UpdateBotInlineSend ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotInlineSend {}
_ bin .Decoder = &UpdateBotInlineSend {}
_ bin .BareEncoder = &UpdateBotInlineSend {}
_ bin .BareDecoder = &UpdateBotInlineSend {}
_ UpdateClass = &UpdateBotInlineSend {}
)
func (u *UpdateBotInlineSend ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Query == "" ) {
return false
}
if !(u .Geo == nil ) {
return false
}
if !(u .ID == "" ) {
return false
}
if !(u .MsgID == nil ) {
return false
}
return true
}
func (u *UpdateBotInlineSend ) String () string {
if u == nil {
return "UpdateBotInlineSend(nil)"
}
type Alias UpdateBotInlineSend
return fmt .Sprintf ("UpdateBotInlineSend%+v" , Alias (*u ))
}
func (u *UpdateBotInlineSend ) FillFrom (from interface {
GetUserID () (value int64 )
GetQuery () (value string )
GetGeo () (value GeoPointClass , ok bool )
GetID () (value string )
GetMsgID () (value InputBotInlineMessageIDClass , ok bool )
}) {
u .UserID = from .GetUserID ()
u .Query = from .GetQuery ()
if val , ok := from .GetGeo (); ok {
u .Geo = val
}
u .ID = from .GetID ()
if val , ok := from .GetMsgID (); ok {
u .MsgID = val
}
}
func (*UpdateBotInlineSend ) TypeID () uint32 {
return UpdateBotInlineSendTypeID
}
func (*UpdateBotInlineSend ) TypeName () string {
return "updateBotInlineSend"
}
func (u *UpdateBotInlineSend ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotInlineSend" ,
ID : UpdateBotInlineSendTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
{
Name : "Geo" ,
SchemaName : "geo" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateBotInlineSend ) SetFlags () {
if !(u .Geo == nil ) {
u .Flags .Set (0 )
}
if !(u .MsgID == nil ) {
u .Flags .Set (1 )
}
}
func (u *UpdateBotInlineSend ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineSend#12f12a07 as nil" )
}
b .PutID (UpdateBotInlineSendTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotInlineSend ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotInlineSend#12f12a07 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#12f12a07: field flags: %w" , err )
}
b .PutLong (u .UserID )
b .PutString (u .Query )
if u .Flags .Has (0 ) {
if u .Geo == nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#12f12a07: field geo is nil" )
}
if err := u .Geo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#12f12a07: field geo: %w" , err )
}
}
b .PutString (u .ID )
if u .Flags .Has (1 ) {
if u .MsgID == nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#12f12a07: field msg_id is nil" )
}
if err := u .MsgID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotInlineSend#12f12a07: field msg_id: %w" , err )
}
}
return nil
}
func (u *UpdateBotInlineSend ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineSend#12f12a07 to nil" )
}
if err := b .ConsumeID (UpdateBotInlineSendTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotInlineSend ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotInlineSend#12f12a07 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field query: %w" , err )
}
u .Query = value
}
if u .Flags .Has (0 ) {
value , err := DecodeGeoPoint (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field geo: %w" , err )
}
u .Geo = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field id: %w" , err )
}
u .ID = value
}
if u .Flags .Has (1 ) {
value , err := DecodeInputBotInlineMessageID (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotInlineSend#12f12a07: field msg_id: %w" , err )
}
u .MsgID = value
}
return nil
}
func (u *UpdateBotInlineSend ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotInlineSend ) GetQuery () (value string ) {
if u == nil {
return
}
return u .Query
}
func (u *UpdateBotInlineSend ) SetGeo (value GeoPointClass ) {
u .Flags .Set (0 )
u .Geo = value
}
func (u *UpdateBotInlineSend ) GetGeo () (value GeoPointClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Geo , true
}
func (u *UpdateBotInlineSend ) GetID () (value string ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateBotInlineSend ) SetMsgID (value InputBotInlineMessageIDClass ) {
u .Flags .Set (1 )
u .MsgID = value
}
func (u *UpdateBotInlineSend ) GetMsgID () (value InputBotInlineMessageIDClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .MsgID , true
}
type UpdateEditChannelMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateEditChannelMessageTypeID = 0x1b3f4df7
func (u UpdateEditChannelMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEditChannelMessage {}
_ bin .Decoder = &UpdateEditChannelMessage {}
_ bin .BareEncoder = &UpdateEditChannelMessage {}
_ bin .BareDecoder = &UpdateEditChannelMessage {}
_ UpdateClass = &UpdateEditChannelMessage {}
)
func (u *UpdateEditChannelMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateEditChannelMessage ) String () string {
if u == nil {
return "UpdateEditChannelMessage(nil)"
}
type Alias UpdateEditChannelMessage
return fmt .Sprintf ("UpdateEditChannelMessage%+v" , Alias (*u ))
}
func (u *UpdateEditChannelMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateEditChannelMessage ) TypeID () uint32 {
return UpdateEditChannelMessageTypeID
}
func (*UpdateEditChannelMessage ) TypeName () string {
return "updateEditChannelMessage"
}
func (u *UpdateEditChannelMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEditChannelMessage" ,
ID : UpdateEditChannelMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateEditChannelMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditChannelMessage#1b3f4df7 as nil" )
}
b .PutID (UpdateEditChannelMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEditChannelMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditChannelMessage#1b3f4df7 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateEditChannelMessage#1b3f4df7: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEditChannelMessage#1b3f4df7: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateEditChannelMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditChannelMessage#1b3f4df7 to nil" )
}
if err := b .ConsumeID (UpdateEditChannelMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEditChannelMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditChannelMessage#1b3f4df7 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditChannelMessage#1b3f4df7: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateEditChannelMessage ) GetMessage () (value MessageClass ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateEditChannelMessage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateEditChannelMessage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateBotCallbackQuery struct {
Flags bin .Fields
QueryID int64
UserID int64
Peer PeerClass
MsgID int
ChatInstance int64
Data []byte
GameShortName string
}
const UpdateBotCallbackQueryTypeID = 0xb9cfc48d
func (u UpdateBotCallbackQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotCallbackQuery {}
_ bin .Decoder = &UpdateBotCallbackQuery {}
_ bin .BareEncoder = &UpdateBotCallbackQuery {}
_ bin .BareDecoder = &UpdateBotCallbackQuery {}
_ UpdateClass = &UpdateBotCallbackQuery {}
)
func (u *UpdateBotCallbackQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .ChatInstance == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
if !(u .GameShortName == "" ) {
return false
}
return true
}
func (u *UpdateBotCallbackQuery ) String () string {
if u == nil {
return "UpdateBotCallbackQuery(nil)"
}
type Alias UpdateBotCallbackQuery
return fmt .Sprintf ("UpdateBotCallbackQuery%+v" , Alias (*u ))
}
func (u *UpdateBotCallbackQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int64 )
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetChatInstance () (value int64 )
GetData () (value []byte , ok bool )
GetGameShortName () (value string , ok bool )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .ChatInstance = from .GetChatInstance ()
if val , ok := from .GetData (); ok {
u .Data = val
}
if val , ok := from .GetGameShortName (); ok {
u .GameShortName = val
}
}
func (*UpdateBotCallbackQuery ) TypeID () uint32 {
return UpdateBotCallbackQueryTypeID
}
func (*UpdateBotCallbackQuery ) TypeName () string {
return "updateBotCallbackQuery"
}
func (u *UpdateBotCallbackQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotCallbackQuery" ,
ID : UpdateBotCallbackQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ChatInstance" ,
SchemaName : "chat_instance" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "GameShortName" ,
SchemaName : "game_short_name" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateBotCallbackQuery ) SetFlags () {
if !(u .Data == nil ) {
u .Flags .Set (0 )
}
if !(u .GameShortName == "" ) {
u .Flags .Set (1 )
}
}
func (u *UpdateBotCallbackQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCallbackQuery#b9cfc48d as nil" )
}
b .PutID (UpdateBotCallbackQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotCallbackQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCallbackQuery#b9cfc48d as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#b9cfc48d: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutLong (u .UserID )
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#b9cfc48d: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCallbackQuery#b9cfc48d: field peer: %w" , err )
}
b .PutInt (u .MsgID )
b .PutLong (u .ChatInstance )
if u .Flags .Has (0 ) {
b .PutBytes (u .Data )
}
if u .Flags .Has (1 ) {
b .PutString (u .GameShortName )
}
return nil
}
func (u *UpdateBotCallbackQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCallbackQuery#b9cfc48d to nil" )
}
if err := b .ConsumeID (UpdateBotCallbackQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotCallbackQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCallbackQuery#b9cfc48d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field chat_instance: %w" , err )
}
u .ChatInstance = value
}
if u .Flags .Has (0 ) {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field data: %w" , err )
}
u .Data = value
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCallbackQuery#b9cfc48d: field game_short_name: %w" , err )
}
u .GameShortName = value
}
return nil
}
func (u *UpdateBotCallbackQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateBotCallbackQuery ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotCallbackQuery ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotCallbackQuery ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateBotCallbackQuery ) GetChatInstance () (value int64 ) {
if u == nil {
return
}
return u .ChatInstance
}
func (u *UpdateBotCallbackQuery ) SetData (value []byte ) {
u .Flags .Set (0 )
u .Data = value
}
func (u *UpdateBotCallbackQuery ) GetData () (value []byte , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Data , true
}
func (u *UpdateBotCallbackQuery ) SetGameShortName (value string ) {
u .Flags .Set (1 )
u .GameShortName = value
}
func (u *UpdateBotCallbackQuery ) GetGameShortName () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .GameShortName , true
}
type UpdateEditMessage struct {
Message MessageClass
Pts int
PtsCount int
}
const UpdateEditMessageTypeID = 0xe40370a3
func (u UpdateEditMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateEditMessage {}
_ bin .Decoder = &UpdateEditMessage {}
_ bin .BareEncoder = &UpdateEditMessage {}
_ bin .BareDecoder = &UpdateEditMessage {}
_ UpdateClass = &UpdateEditMessage {}
)
func (u *UpdateEditMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateEditMessage ) String () string {
if u == nil {
return "UpdateEditMessage(nil)"
}
type Alias UpdateEditMessage
return fmt .Sprintf ("UpdateEditMessage%+v" , Alias (*u ))
}
func (u *UpdateEditMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Message = from .GetMessage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateEditMessage ) TypeID () uint32 {
return UpdateEditMessageTypeID
}
func (*UpdateEditMessage ) TypeName () string {
return "updateEditMessage"
}
func (u *UpdateEditMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateEditMessage" ,
ID : UpdateEditMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateEditMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditMessage#e40370a3 as nil" )
}
b .PutID (UpdateEditMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateEditMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateEditMessage#e40370a3 as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateEditMessage#e40370a3: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateEditMessage#e40370a3: field message: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateEditMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditMessage#e40370a3 to nil" )
}
if err := b .ConsumeID (UpdateEditMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateEditMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateEditMessage#e40370a3 to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field message: %w" , err )
}
u .Message = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateEditMessage#e40370a3: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateEditMessage ) GetMessage () (value MessageClass ) {
if u == nil {
return
}
return u .Message
}
func (u *UpdateEditMessage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateEditMessage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateInlineBotCallbackQuery struct {
Flags bin .Fields
QueryID int64
UserID int64
MsgID InputBotInlineMessageIDClass
ChatInstance int64
Data []byte
GameShortName string
}
const UpdateInlineBotCallbackQueryTypeID = 0x691e9052
func (u UpdateInlineBotCallbackQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateInlineBotCallbackQuery {}
_ bin .Decoder = &UpdateInlineBotCallbackQuery {}
_ bin .BareEncoder = &UpdateInlineBotCallbackQuery {}
_ bin .BareDecoder = &UpdateInlineBotCallbackQuery {}
_ UpdateClass = &UpdateInlineBotCallbackQuery {}
)
func (u *UpdateInlineBotCallbackQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .MsgID == nil ) {
return false
}
if !(u .ChatInstance == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
if !(u .GameShortName == "" ) {
return false
}
return true
}
func (u *UpdateInlineBotCallbackQuery ) String () string {
if u == nil {
return "UpdateInlineBotCallbackQuery(nil)"
}
type Alias UpdateInlineBotCallbackQuery
return fmt .Sprintf ("UpdateInlineBotCallbackQuery%+v" , Alias (*u ))
}
func (u *UpdateInlineBotCallbackQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int64 )
GetMsgID () (value InputBotInlineMessageIDClass )
GetChatInstance () (value int64 )
GetData () (value []byte , ok bool )
GetGameShortName () (value string , ok bool )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .MsgID = from .GetMsgID ()
u .ChatInstance = from .GetChatInstance ()
if val , ok := from .GetData (); ok {
u .Data = val
}
if val , ok := from .GetGameShortName (); ok {
u .GameShortName = val
}
}
func (*UpdateInlineBotCallbackQuery ) TypeID () uint32 {
return UpdateInlineBotCallbackQueryTypeID
}
func (*UpdateInlineBotCallbackQuery ) TypeName () string {
return "updateInlineBotCallbackQuery"
}
func (u *UpdateInlineBotCallbackQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateInlineBotCallbackQuery" ,
ID : UpdateInlineBotCallbackQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ChatInstance" ,
SchemaName : "chat_instance" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "GameShortName" ,
SchemaName : "game_short_name" ,
Null : !u .Flags .Has (1 ),
},
}
return typ
}
func (u *UpdateInlineBotCallbackQuery ) SetFlags () {
if !(u .Data == nil ) {
u .Flags .Set (0 )
}
if !(u .GameShortName == "" ) {
u .Flags .Set (1 )
}
}
func (u *UpdateInlineBotCallbackQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateInlineBotCallbackQuery#691e9052 as nil" )
}
b .PutID (UpdateInlineBotCallbackQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateInlineBotCallbackQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateInlineBotCallbackQuery#691e9052 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateInlineBotCallbackQuery#691e9052: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutLong (u .UserID )
if u .MsgID == nil {
return fmt .Errorf ("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id is nil" )
}
if err := u .MsgID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateInlineBotCallbackQuery#691e9052: field msg_id: %w" , err )
}
b .PutLong (u .ChatInstance )
if u .Flags .Has (0 ) {
b .PutBytes (u .Data )
}
if u .Flags .Has (1 ) {
b .PutString (u .GameShortName )
}
return nil
}
func (u *UpdateInlineBotCallbackQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateInlineBotCallbackQuery#691e9052 to nil" )
}
if err := b .ConsumeID (UpdateInlineBotCallbackQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateInlineBotCallbackQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateInlineBotCallbackQuery#691e9052 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeInputBotInlineMessageID (b )
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field chat_instance: %w" , err )
}
u .ChatInstance = value
}
if u .Flags .Has (0 ) {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field data: %w" , err )
}
u .Data = value
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateInlineBotCallbackQuery#691e9052: field game_short_name: %w" , err )
}
u .GameShortName = value
}
return nil
}
func (u *UpdateInlineBotCallbackQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateInlineBotCallbackQuery ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateInlineBotCallbackQuery ) GetMsgID () (value InputBotInlineMessageIDClass ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateInlineBotCallbackQuery ) GetChatInstance () (value int64 ) {
if u == nil {
return
}
return u .ChatInstance
}
func (u *UpdateInlineBotCallbackQuery ) SetData (value []byte ) {
u .Flags .Set (0 )
u .Data = value
}
func (u *UpdateInlineBotCallbackQuery ) GetData () (value []byte , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Data , true
}
func (u *UpdateInlineBotCallbackQuery ) SetGameShortName (value string ) {
u .Flags .Set (1 )
u .GameShortName = value
}
func (u *UpdateInlineBotCallbackQuery ) GetGameShortName () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .GameShortName , true
}
type UpdateReadChannelOutbox struct {
ChannelID int64
MaxID int
}
const UpdateReadChannelOutboxTypeID = 0xb75f99a9
func (u UpdateReadChannelOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelOutbox {}
_ bin .Decoder = &UpdateReadChannelOutbox {}
_ bin .BareEncoder = &UpdateReadChannelOutbox {}
_ bin .BareDecoder = &UpdateReadChannelOutbox {}
_ UpdateClass = &UpdateReadChannelOutbox {}
)
func (u *UpdateReadChannelOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelOutbox ) String () string {
if u == nil {
return "UpdateReadChannelOutbox(nil)"
}
type Alias UpdateReadChannelOutbox
return fmt .Sprintf ("UpdateReadChannelOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelOutbox ) FillFrom (from interface {
GetChannelID () (value int64 )
GetMaxID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .MaxID = from .GetMaxID ()
}
func (*UpdateReadChannelOutbox ) TypeID () uint32 {
return UpdateReadChannelOutboxTypeID
}
func (*UpdateReadChannelOutbox ) TypeName () string {
return "updateReadChannelOutbox"
}
func (u *UpdateReadChannelOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelOutbox" ,
ID : UpdateReadChannelOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
}
return typ
}
func (u *UpdateReadChannelOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelOutbox#b75f99a9 as nil" )
}
b .PutID (UpdateReadChannelOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelOutbox#b75f99a9 as nil" )
}
b .PutLong (u .ChannelID )
b .PutInt (u .MaxID )
return nil
}
func (u *UpdateReadChannelOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelOutbox#b75f99a9 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#b75f99a9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelOutbox#b75f99a9 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#b75f99a9: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelOutbox#b75f99a9: field max_id: %w" , err )
}
u .MaxID = value
}
return nil
}
func (u *UpdateReadChannelOutbox ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateReadChannelOutbox ) GetMaxID () (value int ) {
if u == nil {
return
}
return u .MaxID
}
type UpdateDraftMessage struct {
Flags bin .Fields
Peer PeerClass
TopMsgID int
Draft DraftMessageClass
}
const UpdateDraftMessageTypeID = 0x1b49ec6d
func (u UpdateDraftMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDraftMessage {}
_ bin .Decoder = &UpdateDraftMessage {}
_ bin .BareEncoder = &UpdateDraftMessage {}
_ bin .BareDecoder = &UpdateDraftMessage {}
_ UpdateClass = &UpdateDraftMessage {}
)
func (u *UpdateDraftMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .Draft == nil ) {
return false
}
return true
}
func (u *UpdateDraftMessage ) String () string {
if u == nil {
return "UpdateDraftMessage(nil)"
}
type Alias UpdateDraftMessage
return fmt .Sprintf ("UpdateDraftMessage%+v" , Alias (*u ))
}
func (u *UpdateDraftMessage ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetTopMsgID () (value int , ok bool )
GetDraft () (value DraftMessageClass )
}) {
u .Peer = from .GetPeer ()
if val , ok := from .GetTopMsgID (); ok {
u .TopMsgID = val
}
u .Draft = from .GetDraft ()
}
func (*UpdateDraftMessage ) TypeID () uint32 {
return UpdateDraftMessageTypeID
}
func (*UpdateDraftMessage ) TypeName () string {
return "updateDraftMessage"
}
func (u *UpdateDraftMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDraftMessage" ,
ID : UpdateDraftMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Draft" ,
SchemaName : "draft" ,
},
}
return typ
}
func (u *UpdateDraftMessage ) SetFlags () {
if !(u .TopMsgID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateDraftMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDraftMessage#1b49ec6d as nil" )
}
b .PutID (UpdateDraftMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDraftMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDraftMessage#1b49ec6d as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDraftMessage#1b49ec6d: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDraftMessage#1b49ec6d: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDraftMessage#1b49ec6d: field peer: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .TopMsgID )
}
if u .Draft == nil {
return fmt .Errorf ("unable to encode updateDraftMessage#1b49ec6d: field draft is nil" )
}
if err := u .Draft .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDraftMessage#1b49ec6d: field draft: %w" , err )
}
return nil
}
func (u *UpdateDraftMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDraftMessage#1b49ec6d to nil" )
}
if err := b .ConsumeID (UpdateDraftMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#1b49ec6d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDraftMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDraftMessage#1b49ec6d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#1b49ec6d: field flags: %w" , err )
}
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#1b49ec6d: field peer: %w" , err )
}
u .Peer = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#1b49ec6d: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := DecodeDraftMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDraftMessage#1b49ec6d: field draft: %w" , err )
}
u .Draft = value
}
return nil
}
func (u *UpdateDraftMessage ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateDraftMessage ) SetTopMsgID (value int ) {
u .Flags .Set (0 )
u .TopMsgID = value
}
func (u *UpdateDraftMessage ) GetTopMsgID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .TopMsgID , true
}
func (u *UpdateDraftMessage ) GetDraft () (value DraftMessageClass ) {
if u == nil {
return
}
return u .Draft
}
type UpdateReadFeaturedStickers struct {
}
const UpdateReadFeaturedStickersTypeID = 0x571d2742
func (u UpdateReadFeaturedStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadFeaturedStickers {}
_ bin .Decoder = &UpdateReadFeaturedStickers {}
_ bin .BareEncoder = &UpdateReadFeaturedStickers {}
_ bin .BareDecoder = &UpdateReadFeaturedStickers {}
_ UpdateClass = &UpdateReadFeaturedStickers {}
)
func (u *UpdateReadFeaturedStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateReadFeaturedStickers ) String () string {
if u == nil {
return "UpdateReadFeaturedStickers(nil)"
}
type Alias UpdateReadFeaturedStickers
return fmt .Sprintf ("UpdateReadFeaturedStickers%+v" , Alias (*u ))
}
func (*UpdateReadFeaturedStickers ) TypeID () uint32 {
return UpdateReadFeaturedStickersTypeID
}
func (*UpdateReadFeaturedStickers ) TypeName () string {
return "updateReadFeaturedStickers"
}
func (u *UpdateReadFeaturedStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadFeaturedStickers" ,
ID : UpdateReadFeaturedStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateReadFeaturedStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedStickers#571d2742 as nil" )
}
b .PutID (UpdateReadFeaturedStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadFeaturedStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedStickers#571d2742 as nil" )
}
return nil
}
func (u *UpdateReadFeaturedStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedStickers#571d2742 to nil" )
}
if err := b .ConsumeID (UpdateReadFeaturedStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadFeaturedStickers#571d2742: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadFeaturedStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedStickers#571d2742 to nil" )
}
return nil
}
type UpdateRecentStickers struct {
}
const UpdateRecentStickersTypeID = 0x9a422c20
func (u UpdateRecentStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateRecentStickers {}
_ bin .Decoder = &UpdateRecentStickers {}
_ bin .BareEncoder = &UpdateRecentStickers {}
_ bin .BareDecoder = &UpdateRecentStickers {}
_ UpdateClass = &UpdateRecentStickers {}
)
func (u *UpdateRecentStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateRecentStickers ) String () string {
if u == nil {
return "UpdateRecentStickers(nil)"
}
type Alias UpdateRecentStickers
return fmt .Sprintf ("UpdateRecentStickers%+v" , Alias (*u ))
}
func (*UpdateRecentStickers ) TypeID () uint32 {
return UpdateRecentStickersTypeID
}
func (*UpdateRecentStickers ) TypeName () string {
return "updateRecentStickers"
}
func (u *UpdateRecentStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateRecentStickers" ,
ID : UpdateRecentStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateRecentStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentStickers#9a422c20 as nil" )
}
b .PutID (UpdateRecentStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateRecentStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentStickers#9a422c20 as nil" )
}
return nil
}
func (u *UpdateRecentStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentStickers#9a422c20 to nil" )
}
if err := b .ConsumeID (UpdateRecentStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateRecentStickers#9a422c20: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateRecentStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentStickers#9a422c20 to nil" )
}
return nil
}
type UpdateConfig struct {
}
const UpdateConfigTypeID = 0xa229dd06
func (u UpdateConfig ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateConfig {}
_ bin .Decoder = &UpdateConfig {}
_ bin .BareEncoder = &UpdateConfig {}
_ bin .BareDecoder = &UpdateConfig {}
_ UpdateClass = &UpdateConfig {}
)
func (u *UpdateConfig ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateConfig ) String () string {
if u == nil {
return "UpdateConfig(nil)"
}
type Alias UpdateConfig
return fmt .Sprintf ("UpdateConfig%+v" , Alias (*u ))
}
func (*UpdateConfig ) TypeID () uint32 {
return UpdateConfigTypeID
}
func (*UpdateConfig ) TypeName () string {
return "updateConfig"
}
func (u *UpdateConfig ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateConfig" ,
ID : UpdateConfigTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateConfig ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateConfig#a229dd06 as nil" )
}
b .PutID (UpdateConfigTypeID )
return u .EncodeBare (b )
}
func (u *UpdateConfig ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateConfig#a229dd06 as nil" )
}
return nil
}
func (u *UpdateConfig ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateConfig#a229dd06 to nil" )
}
if err := b .ConsumeID (UpdateConfigTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateConfig#a229dd06: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateConfig ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateConfig#a229dd06 to nil" )
}
return nil
}
type UpdatePtsChanged struct {
}
const UpdatePtsChangedTypeID = 0x3354678f
func (u UpdatePtsChanged ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePtsChanged {}
_ bin .Decoder = &UpdatePtsChanged {}
_ bin .BareEncoder = &UpdatePtsChanged {}
_ bin .BareDecoder = &UpdatePtsChanged {}
_ UpdateClass = &UpdatePtsChanged {}
)
func (u *UpdatePtsChanged ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdatePtsChanged ) String () string {
if u == nil {
return "UpdatePtsChanged(nil)"
}
type Alias UpdatePtsChanged
return fmt .Sprintf ("UpdatePtsChanged%+v" , Alias (*u ))
}
func (*UpdatePtsChanged ) TypeID () uint32 {
return UpdatePtsChangedTypeID
}
func (*UpdatePtsChanged ) TypeName () string {
return "updatePtsChanged"
}
func (u *UpdatePtsChanged ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePtsChanged" ,
ID : UpdatePtsChangedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdatePtsChanged ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePtsChanged#3354678f as nil" )
}
b .PutID (UpdatePtsChangedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePtsChanged ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePtsChanged#3354678f as nil" )
}
return nil
}
func (u *UpdatePtsChanged ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePtsChanged#3354678f to nil" )
}
if err := b .ConsumeID (UpdatePtsChangedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePtsChanged#3354678f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePtsChanged ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePtsChanged#3354678f to nil" )
}
return nil
}
type UpdateChannelWebPage struct {
ChannelID int64
Webpage WebPageClass
Pts int
PtsCount int
}
const UpdateChannelWebPageTypeID = 0x2f2ba99f
func (u UpdateChannelWebPage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelWebPage {}
_ bin .Decoder = &UpdateChannelWebPage {}
_ bin .BareEncoder = &UpdateChannelWebPage {}
_ bin .BareDecoder = &UpdateChannelWebPage {}
_ UpdateClass = &UpdateChannelWebPage {}
)
func (u *UpdateChannelWebPage ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Webpage == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateChannelWebPage ) String () string {
if u == nil {
return "UpdateChannelWebPage(nil)"
}
type Alias UpdateChannelWebPage
return fmt .Sprintf ("UpdateChannelWebPage%+v" , Alias (*u ))
}
func (u *UpdateChannelWebPage ) FillFrom (from interface {
GetChannelID () (value int64 )
GetWebpage () (value WebPageClass )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .Webpage = from .GetWebpage ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateChannelWebPage ) TypeID () uint32 {
return UpdateChannelWebPageTypeID
}
func (*UpdateChannelWebPage ) TypeName () string {
return "updateChannelWebPage"
}
func (u *UpdateChannelWebPage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelWebPage" ,
ID : UpdateChannelWebPageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Webpage" ,
SchemaName : "webpage" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateChannelWebPage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelWebPage#2f2ba99f as nil" )
}
b .PutID (UpdateChannelWebPageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelWebPage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelWebPage#2f2ba99f as nil" )
}
b .PutLong (u .ChannelID )
if u .Webpage == nil {
return fmt .Errorf ("unable to encode updateChannelWebPage#2f2ba99f: field webpage is nil" )
}
if err := u .Webpage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelWebPage#2f2ba99f: field webpage: %w" , err )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateChannelWebPage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelWebPage#2f2ba99f to nil" )
}
if err := b .ConsumeID (UpdateChannelWebPageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#2f2ba99f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelWebPage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelWebPage#2f2ba99f to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#2f2ba99f: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := DecodeWebPage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#2f2ba99f: field webpage: %w" , err )
}
u .Webpage = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#2f2ba99f: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelWebPage#2f2ba99f: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateChannelWebPage ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelWebPage ) GetWebpage () (value WebPageClass ) {
if u == nil {
return
}
return u .Webpage
}
func (u *UpdateChannelWebPage ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateChannelWebPage ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateDialogPinned struct {
Flags bin .Fields
Pinned bool
FolderID int
Peer DialogPeerClass
}
const UpdateDialogPinnedTypeID = 0x6e6fe51c
func (u UpdateDialogPinned ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogPinned {}
_ bin .Decoder = &UpdateDialogPinned {}
_ bin .BareEncoder = &UpdateDialogPinned {}
_ bin .BareDecoder = &UpdateDialogPinned {}
_ UpdateClass = &UpdateDialogPinned {}
)
func (u *UpdateDialogPinned ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
return true
}
func (u *UpdateDialogPinned ) String () string {
if u == nil {
return "UpdateDialogPinned(nil)"
}
type Alias UpdateDialogPinned
return fmt .Sprintf ("UpdateDialogPinned%+v" , Alias (*u ))
}
func (u *UpdateDialogPinned ) FillFrom (from interface {
GetPinned () (value bool )
GetFolderID () (value int , ok bool )
GetPeer () (value DialogPeerClass )
}) {
u .Pinned = from .GetPinned ()
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
u .Peer = from .GetPeer ()
}
func (*UpdateDialogPinned ) TypeID () uint32 {
return UpdateDialogPinnedTypeID
}
func (*UpdateDialogPinned ) TypeName () string {
return "updateDialogPinned"
}
func (u *UpdateDialogPinned ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogPinned" ,
ID : UpdateDialogPinnedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (u *UpdateDialogPinned ) SetFlags () {
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (1 )
}
}
func (u *UpdateDialogPinned ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogPinned#6e6fe51c as nil" )
}
b .PutID (UpdateDialogPinnedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogPinned ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogPinned#6e6fe51c as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .FolderID )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogPinned#6e6fe51c: field peer: %w" , err )
}
return nil
}
func (u *UpdateDialogPinned ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogPinned#6e6fe51c to nil" )
}
if err := b .ConsumeID (UpdateDialogPinnedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogPinned ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogPinned#6e6fe51c to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field folder_id: %w" , err )
}
u .FolderID = value
}
{
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDialogPinned#6e6fe51c: field peer: %w" , err )
}
u .Peer = value
}
return nil
}
func (u *UpdateDialogPinned ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdateDialogPinned ) GetPinned () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateDialogPinned ) SetFolderID (value int ) {
u .Flags .Set (1 )
u .FolderID = value
}
func (u *UpdateDialogPinned ) GetFolderID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdateDialogPinned ) GetPeer () (value DialogPeerClass ) {
if u == nil {
return
}
return u .Peer
}
type UpdatePinnedDialogs struct {
Flags bin .Fields
FolderID int
Order []DialogPeerClass
}
const UpdatePinnedDialogsTypeID = 0xfa0f3ca2
func (u UpdatePinnedDialogs ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedDialogs {}
_ bin .Decoder = &UpdatePinnedDialogs {}
_ bin .BareEncoder = &UpdatePinnedDialogs {}
_ bin .BareDecoder = &UpdatePinnedDialogs {}
_ UpdateClass = &UpdatePinnedDialogs {}
)
func (u *UpdatePinnedDialogs ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdatePinnedDialogs ) String () string {
if u == nil {
return "UpdatePinnedDialogs(nil)"
}
type Alias UpdatePinnedDialogs
return fmt .Sprintf ("UpdatePinnedDialogs%+v" , Alias (*u ))
}
func (u *UpdatePinnedDialogs ) FillFrom (from interface {
GetFolderID () (value int , ok bool )
GetOrder () (value []DialogPeerClass , ok bool )
}) {
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
if val , ok := from .GetOrder (); ok {
u .Order = val
}
}
func (*UpdatePinnedDialogs ) TypeID () uint32 {
return UpdatePinnedDialogsTypeID
}
func (*UpdatePinnedDialogs ) TypeName () string {
return "updatePinnedDialogs"
}
func (u *UpdatePinnedDialogs ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedDialogs" ,
ID : UpdatePinnedDialogsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Order" ,
SchemaName : "order" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdatePinnedDialogs ) SetFlags () {
if !(u .FolderID == 0 ) {
u .Flags .Set (1 )
}
if !(u .Order == nil ) {
u .Flags .Set (0 )
}
}
func (u *UpdatePinnedDialogs ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedDialogs#fa0f3ca2 as nil" )
}
b .PutID (UpdatePinnedDialogsTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedDialogs ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedDialogs#fa0f3ca2 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field flags: %w" , err )
}
if u .Flags .Has (1 ) {
b .PutInt (u .FolderID )
}
if u .Flags .Has (0 ) {
b .PutVectorHeader (len (u .Order ))
for idx , v := range u .Order {
if v == nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedDialogs#fa0f3ca2: field order element with index %d: %w" , idx , err )
}
}
}
return nil
}
func (u *UpdatePinnedDialogs ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedDialogs#fa0f3ca2 to nil" )
}
if err := b .ConsumeID (UpdatePinnedDialogsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedDialogs ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedDialogs#fa0f3ca2 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field flags: %w" , err )
}
}
if u .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field folder_id: %w" , err )
}
u .FolderID = value
}
if u .Flags .Has (0 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w" , err )
}
if headerLen > 0 {
u .Order = make ([]DialogPeerClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedDialogs#fa0f3ca2: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u *UpdatePinnedDialogs ) SetFolderID (value int ) {
u .Flags .Set (1 )
u .FolderID = value
}
func (u *UpdatePinnedDialogs ) GetFolderID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .FolderID , true
}
func (u *UpdatePinnedDialogs ) SetOrder (value []DialogPeerClass ) {
u .Flags .Set (0 )
u .Order = value
}
func (u *UpdatePinnedDialogs ) GetOrder () (value []DialogPeerClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Order , true
}
func (u *UpdatePinnedDialogs ) MapOrder () (value DialogPeerClassArray , ok bool ) {
if !u .Flags .Has (0 ) {
return value , false
}
return DialogPeerClassArray (u .Order ), true
}
type UpdateBotWebhookJSON struct {
Data DataJSON
}
const UpdateBotWebhookJSONTypeID = 0x8317c0c3
func (u UpdateBotWebhookJSON ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotWebhookJSON {}
_ bin .Decoder = &UpdateBotWebhookJSON {}
_ bin .BareEncoder = &UpdateBotWebhookJSON {}
_ bin .BareDecoder = &UpdateBotWebhookJSON {}
_ UpdateClass = &UpdateBotWebhookJSON {}
)
func (u *UpdateBotWebhookJSON ) Zero () bool {
if u == nil {
return true
}
if !(u .Data .Zero ()) {
return false
}
return true
}
func (u *UpdateBotWebhookJSON ) String () string {
if u == nil {
return "UpdateBotWebhookJSON(nil)"
}
type Alias UpdateBotWebhookJSON
return fmt .Sprintf ("UpdateBotWebhookJSON%+v" , Alias (*u ))
}
func (u *UpdateBotWebhookJSON ) FillFrom (from interface {
GetData () (value DataJSON )
}) {
u .Data = from .GetData ()
}
func (*UpdateBotWebhookJSON ) TypeID () uint32 {
return UpdateBotWebhookJSONTypeID
}
func (*UpdateBotWebhookJSON ) TypeName () string {
return "updateBotWebhookJSON"
}
func (u *UpdateBotWebhookJSON ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotWebhookJSON" ,
ID : UpdateBotWebhookJSONTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Data" ,
SchemaName : "data" ,
},
}
return typ
}
func (u *UpdateBotWebhookJSON ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSON#8317c0c3 as nil" )
}
b .PutID (UpdateBotWebhookJSONTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotWebhookJSON ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSON#8317c0c3 as nil" )
}
if err := u .Data .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotWebhookJSON#8317c0c3: field data: %w" , err )
}
return nil
}
func (u *UpdateBotWebhookJSON ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSON#8317c0c3 to nil" )
}
if err := b .ConsumeID (UpdateBotWebhookJSONTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSON#8317c0c3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotWebhookJSON ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSON#8317c0c3 to nil" )
}
{
if err := u .Data .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSON#8317c0c3: field data: %w" , err )
}
}
return nil
}
func (u *UpdateBotWebhookJSON ) GetData () (value DataJSON ) {
if u == nil {
return
}
return u .Data
}
type UpdateBotWebhookJSONQuery struct {
QueryID int64
Data DataJSON
Timeout int
}
const UpdateBotWebhookJSONQueryTypeID = 0x9b9240a6
func (u UpdateBotWebhookJSONQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotWebhookJSONQuery {}
_ bin .Decoder = &UpdateBotWebhookJSONQuery {}
_ bin .BareEncoder = &UpdateBotWebhookJSONQuery {}
_ bin .BareDecoder = &UpdateBotWebhookJSONQuery {}
_ UpdateClass = &UpdateBotWebhookJSONQuery {}
)
func (u *UpdateBotWebhookJSONQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .Data .Zero ()) {
return false
}
if !(u .Timeout == 0 ) {
return false
}
return true
}
func (u *UpdateBotWebhookJSONQuery ) String () string {
if u == nil {
return "UpdateBotWebhookJSONQuery(nil)"
}
type Alias UpdateBotWebhookJSONQuery
return fmt .Sprintf ("UpdateBotWebhookJSONQuery%+v" , Alias (*u ))
}
func (u *UpdateBotWebhookJSONQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetData () (value DataJSON )
GetTimeout () (value int )
}) {
u .QueryID = from .GetQueryID ()
u .Data = from .GetData ()
u .Timeout = from .GetTimeout ()
}
func (*UpdateBotWebhookJSONQuery ) TypeID () uint32 {
return UpdateBotWebhookJSONQueryTypeID
}
func (*UpdateBotWebhookJSONQuery ) TypeName () string {
return "updateBotWebhookJSONQuery"
}
func (u *UpdateBotWebhookJSONQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotWebhookJSONQuery" ,
ID : UpdateBotWebhookJSONQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
},
{
Name : "Timeout" ,
SchemaName : "timeout" ,
},
}
return typ
}
func (u *UpdateBotWebhookJSONQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil" )
}
b .PutID (UpdateBotWebhookJSONQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotWebhookJSONQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotWebhookJSONQuery#9b9240a6 as nil" )
}
b .PutLong (u .QueryID )
if err := u .Data .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotWebhookJSONQuery#9b9240a6: field data: %w" , err )
}
b .PutInt (u .Timeout )
return nil
}
func (u *UpdateBotWebhookJSONQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSONQuery#9b9240a6 to nil" )
}
if err := b .ConsumeID (UpdateBotWebhookJSONQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotWebhookJSONQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotWebhookJSONQuery#9b9240a6 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field query_id: %w" , err )
}
u .QueryID = value
}
{
if err := u .Data .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field data: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotWebhookJSONQuery#9b9240a6: field timeout: %w" , err )
}
u .Timeout = value
}
return nil
}
func (u *UpdateBotWebhookJSONQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateBotWebhookJSONQuery ) GetData () (value DataJSON ) {
if u == nil {
return
}
return u .Data
}
func (u *UpdateBotWebhookJSONQuery ) GetTimeout () (value int ) {
if u == nil {
return
}
return u .Timeout
}
type UpdateBotShippingQuery struct {
QueryID int64
UserID int64
Payload []byte
ShippingAddress PostAddress
}
const UpdateBotShippingQueryTypeID = 0xb5aefd7d
func (u UpdateBotShippingQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotShippingQuery {}
_ bin .Decoder = &UpdateBotShippingQuery {}
_ bin .BareEncoder = &UpdateBotShippingQuery {}
_ bin .BareDecoder = &UpdateBotShippingQuery {}
_ UpdateClass = &UpdateBotShippingQuery {}
)
func (u *UpdateBotShippingQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Payload == nil ) {
return false
}
if !(u .ShippingAddress .Zero ()) {
return false
}
return true
}
func (u *UpdateBotShippingQuery ) String () string {
if u == nil {
return "UpdateBotShippingQuery(nil)"
}
type Alias UpdateBotShippingQuery
return fmt .Sprintf ("UpdateBotShippingQuery%+v" , Alias (*u ))
}
func (u *UpdateBotShippingQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int64 )
GetPayload () (value []byte )
GetShippingAddress () (value PostAddress )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Payload = from .GetPayload ()
u .ShippingAddress = from .GetShippingAddress ()
}
func (*UpdateBotShippingQuery ) TypeID () uint32 {
return UpdateBotShippingQueryTypeID
}
func (*UpdateBotShippingQuery ) TypeName () string {
return "updateBotShippingQuery"
}
func (u *UpdateBotShippingQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotShippingQuery" ,
ID : UpdateBotShippingQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Payload" ,
SchemaName : "payload" ,
},
{
Name : "ShippingAddress" ,
SchemaName : "shipping_address" ,
},
}
return typ
}
func (u *UpdateBotShippingQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotShippingQuery#b5aefd7d as nil" )
}
b .PutID (UpdateBotShippingQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotShippingQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotShippingQuery#b5aefd7d as nil" )
}
b .PutLong (u .QueryID )
b .PutLong (u .UserID )
b .PutBytes (u .Payload )
if err := u .ShippingAddress .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotShippingQuery#b5aefd7d: field shipping_address: %w" , err )
}
return nil
}
func (u *UpdateBotShippingQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotShippingQuery#b5aefd7d to nil" )
}
if err := b .ConsumeID (UpdateBotShippingQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#b5aefd7d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotShippingQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotShippingQuery#b5aefd7d to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#b5aefd7d: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#b5aefd7d: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#b5aefd7d: field payload: %w" , err )
}
u .Payload = value
}
{
if err := u .ShippingAddress .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotShippingQuery#b5aefd7d: field shipping_address: %w" , err )
}
}
return nil
}
func (u *UpdateBotShippingQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateBotShippingQuery ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotShippingQuery ) GetPayload () (value []byte ) {
if u == nil {
return
}
return u .Payload
}
func (u *UpdateBotShippingQuery ) GetShippingAddress () (value PostAddress ) {
if u == nil {
return
}
return u .ShippingAddress
}
type UpdateBotPrecheckoutQuery struct {
Flags bin .Fields
QueryID int64
UserID int64
Payload []byte
Info PaymentRequestedInfo
ShippingOptionID string
Currency string
TotalAmount int64
}
const UpdateBotPrecheckoutQueryTypeID = 0x8caa9a96
func (u UpdateBotPrecheckoutQuery ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotPrecheckoutQuery {}
_ bin .Decoder = &UpdateBotPrecheckoutQuery {}
_ bin .BareEncoder = &UpdateBotPrecheckoutQuery {}
_ bin .BareDecoder = &UpdateBotPrecheckoutQuery {}
_ UpdateClass = &UpdateBotPrecheckoutQuery {}
)
func (u *UpdateBotPrecheckoutQuery ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .QueryID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Payload == nil ) {
return false
}
if !(u .Info .Zero ()) {
return false
}
if !(u .ShippingOptionID == "" ) {
return false
}
if !(u .Currency == "" ) {
return false
}
if !(u .TotalAmount == 0 ) {
return false
}
return true
}
func (u *UpdateBotPrecheckoutQuery ) String () string {
if u == nil {
return "UpdateBotPrecheckoutQuery(nil)"
}
type Alias UpdateBotPrecheckoutQuery
return fmt .Sprintf ("UpdateBotPrecheckoutQuery%+v" , Alias (*u ))
}
func (u *UpdateBotPrecheckoutQuery ) FillFrom (from interface {
GetQueryID () (value int64 )
GetUserID () (value int64 )
GetPayload () (value []byte )
GetInfo () (value PaymentRequestedInfo , ok bool )
GetShippingOptionID () (value string , ok bool )
GetCurrency () (value string )
GetTotalAmount () (value int64 )
}) {
u .QueryID = from .GetQueryID ()
u .UserID = from .GetUserID ()
u .Payload = from .GetPayload ()
if val , ok := from .GetInfo (); ok {
u .Info = val
}
if val , ok := from .GetShippingOptionID (); ok {
u .ShippingOptionID = val
}
u .Currency = from .GetCurrency ()
u .TotalAmount = from .GetTotalAmount ()
}
func (*UpdateBotPrecheckoutQuery ) TypeID () uint32 {
return UpdateBotPrecheckoutQueryTypeID
}
func (*UpdateBotPrecheckoutQuery ) TypeName () string {
return "updateBotPrecheckoutQuery"
}
func (u *UpdateBotPrecheckoutQuery ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotPrecheckoutQuery" ,
ID : UpdateBotPrecheckoutQueryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Payload" ,
SchemaName : "payload" ,
},
{
Name : "Info" ,
SchemaName : "info" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ShippingOptionID" ,
SchemaName : "shipping_option_id" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Currency" ,
SchemaName : "currency" ,
},
{
Name : "TotalAmount" ,
SchemaName : "total_amount" ,
},
}
return typ
}
func (u *UpdateBotPrecheckoutQuery ) SetFlags () {
if !(u .Info .Zero ()) {
u .Flags .Set (0 )
}
if !(u .ShippingOptionID == "" ) {
u .Flags .Set (1 )
}
}
func (u *UpdateBotPrecheckoutQuery ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil" )
}
b .PutID (UpdateBotPrecheckoutQueryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotPrecheckoutQuery ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotPrecheckoutQuery#8caa9a96 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotPrecheckoutQuery#8caa9a96: field flags: %w" , err )
}
b .PutLong (u .QueryID )
b .PutLong (u .UserID )
b .PutBytes (u .Payload )
if u .Flags .Has (0 ) {
if err := u .Info .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotPrecheckoutQuery#8caa9a96: field info: %w" , err )
}
}
if u .Flags .Has (1 ) {
b .PutString (u .ShippingOptionID )
}
b .PutString (u .Currency )
b .PutLong (u .TotalAmount )
return nil
}
func (u *UpdateBotPrecheckoutQuery ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotPrecheckoutQuery#8caa9a96 to nil" )
}
if err := b .ConsumeID (UpdateBotPrecheckoutQueryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotPrecheckoutQuery ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotPrecheckoutQuery#8caa9a96 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field query_id: %w" , err )
}
u .QueryID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field payload: %w" , err )
}
u .Payload = value
}
if u .Flags .Has (0 ) {
if err := u .Info .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field info: %w" , err )
}
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field shipping_option_id: %w" , err )
}
u .ShippingOptionID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field currency: %w" , err )
}
u .Currency = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotPrecheckoutQuery#8caa9a96: field total_amount: %w" , err )
}
u .TotalAmount = value
}
return nil
}
func (u *UpdateBotPrecheckoutQuery ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
func (u *UpdateBotPrecheckoutQuery ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotPrecheckoutQuery ) GetPayload () (value []byte ) {
if u == nil {
return
}
return u .Payload
}
func (u *UpdateBotPrecheckoutQuery ) SetInfo (value PaymentRequestedInfo ) {
u .Flags .Set (0 )
u .Info = value
}
func (u *UpdateBotPrecheckoutQuery ) GetInfo () (value PaymentRequestedInfo , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Info , true
}
func (u *UpdateBotPrecheckoutQuery ) SetShippingOptionID (value string ) {
u .Flags .Set (1 )
u .ShippingOptionID = value
}
func (u *UpdateBotPrecheckoutQuery ) GetShippingOptionID () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .ShippingOptionID , true
}
func (u *UpdateBotPrecheckoutQuery ) GetCurrency () (value string ) {
if u == nil {
return
}
return u .Currency
}
func (u *UpdateBotPrecheckoutQuery ) GetTotalAmount () (value int64 ) {
if u == nil {
return
}
return u .TotalAmount
}
type UpdatePhoneCall struct {
PhoneCall PhoneCallClass
}
const UpdatePhoneCallTypeID = 0xab0f6b1e
func (u UpdatePhoneCall ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePhoneCall {}
_ bin .Decoder = &UpdatePhoneCall {}
_ bin .BareEncoder = &UpdatePhoneCall {}
_ bin .BareDecoder = &UpdatePhoneCall {}
_ UpdateClass = &UpdatePhoneCall {}
)
func (u *UpdatePhoneCall ) Zero () bool {
if u == nil {
return true
}
if !(u .PhoneCall == nil ) {
return false
}
return true
}
func (u *UpdatePhoneCall ) String () string {
if u == nil {
return "UpdatePhoneCall(nil)"
}
type Alias UpdatePhoneCall
return fmt .Sprintf ("UpdatePhoneCall%+v" , Alias (*u ))
}
func (u *UpdatePhoneCall ) FillFrom (from interface {
GetPhoneCall () (value PhoneCallClass )
}) {
u .PhoneCall = from .GetPhoneCall ()
}
func (*UpdatePhoneCall ) TypeID () uint32 {
return UpdatePhoneCallTypeID
}
func (*UpdatePhoneCall ) TypeName () string {
return "updatePhoneCall"
}
func (u *UpdatePhoneCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePhoneCall" ,
ID : UpdatePhoneCallTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PhoneCall" ,
SchemaName : "phone_call" ,
},
}
return typ
}
func (u *UpdatePhoneCall ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCall#ab0f6b1e as nil" )
}
b .PutID (UpdatePhoneCallTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePhoneCall ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCall#ab0f6b1e as nil" )
}
if u .PhoneCall == nil {
return fmt .Errorf ("unable to encode updatePhoneCall#ab0f6b1e: field phone_call is nil" )
}
if err := u .PhoneCall .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePhoneCall#ab0f6b1e: field phone_call: %w" , err )
}
return nil
}
func (u *UpdatePhoneCall ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCall#ab0f6b1e to nil" )
}
if err := b .ConsumeID (UpdatePhoneCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePhoneCall#ab0f6b1e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePhoneCall ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCall#ab0f6b1e to nil" )
}
{
value , err := DecodePhoneCall (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCall#ab0f6b1e: field phone_call: %w" , err )
}
u .PhoneCall = value
}
return nil
}
func (u *UpdatePhoneCall ) GetPhoneCall () (value PhoneCallClass ) {
if u == nil {
return
}
return u .PhoneCall
}
type UpdateLangPackTooLong struct {
LangCode string
}
const UpdateLangPackTooLongTypeID = 0x46560264
func (u UpdateLangPackTooLong ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLangPackTooLong {}
_ bin .Decoder = &UpdateLangPackTooLong {}
_ bin .BareEncoder = &UpdateLangPackTooLong {}
_ bin .BareDecoder = &UpdateLangPackTooLong {}
_ UpdateClass = &UpdateLangPackTooLong {}
)
func (u *UpdateLangPackTooLong ) Zero () bool {
if u == nil {
return true
}
if !(u .LangCode == "" ) {
return false
}
return true
}
func (u *UpdateLangPackTooLong ) String () string {
if u == nil {
return "UpdateLangPackTooLong(nil)"
}
type Alias UpdateLangPackTooLong
return fmt .Sprintf ("UpdateLangPackTooLong%+v" , Alias (*u ))
}
func (u *UpdateLangPackTooLong ) FillFrom (from interface {
GetLangCode () (value string )
}) {
u .LangCode = from .GetLangCode ()
}
func (*UpdateLangPackTooLong ) TypeID () uint32 {
return UpdateLangPackTooLongTypeID
}
func (*UpdateLangPackTooLong ) TypeName () string {
return "updateLangPackTooLong"
}
func (u *UpdateLangPackTooLong ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLangPackTooLong" ,
ID : UpdateLangPackTooLongTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "LangCode" ,
SchemaName : "lang_code" ,
},
}
return typ
}
func (u *UpdateLangPackTooLong ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPackTooLong#46560264 as nil" )
}
b .PutID (UpdateLangPackTooLongTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLangPackTooLong ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPackTooLong#46560264 as nil" )
}
b .PutString (u .LangCode )
return nil
}
func (u *UpdateLangPackTooLong ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPackTooLong#46560264 to nil" )
}
if err := b .ConsumeID (UpdateLangPackTooLongTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLangPackTooLong#46560264: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLangPackTooLong ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPackTooLong#46560264 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateLangPackTooLong#46560264: field lang_code: %w" , err )
}
u .LangCode = value
}
return nil
}
func (u *UpdateLangPackTooLong ) GetLangCode () (value string ) {
if u == nil {
return
}
return u .LangCode
}
type UpdateLangPack struct {
Difference LangPackDifference
}
const UpdateLangPackTypeID = 0x56022f4d
func (u UpdateLangPack ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLangPack {}
_ bin .Decoder = &UpdateLangPack {}
_ bin .BareEncoder = &UpdateLangPack {}
_ bin .BareDecoder = &UpdateLangPack {}
_ UpdateClass = &UpdateLangPack {}
)
func (u *UpdateLangPack ) Zero () bool {
if u == nil {
return true
}
if !(u .Difference .Zero ()) {
return false
}
return true
}
func (u *UpdateLangPack ) String () string {
if u == nil {
return "UpdateLangPack(nil)"
}
type Alias UpdateLangPack
return fmt .Sprintf ("UpdateLangPack%+v" , Alias (*u ))
}
func (u *UpdateLangPack ) FillFrom (from interface {
GetDifference () (value LangPackDifference )
}) {
u .Difference = from .GetDifference ()
}
func (*UpdateLangPack ) TypeID () uint32 {
return UpdateLangPackTypeID
}
func (*UpdateLangPack ) TypeName () string {
return "updateLangPack"
}
func (u *UpdateLangPack ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLangPack" ,
ID : UpdateLangPackTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Difference" ,
SchemaName : "difference" ,
},
}
return typ
}
func (u *UpdateLangPack ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPack#56022f4d as nil" )
}
b .PutID (UpdateLangPackTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLangPack ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLangPack#56022f4d as nil" )
}
if err := u .Difference .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateLangPack#56022f4d: field difference: %w" , err )
}
return nil
}
func (u *UpdateLangPack ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPack#56022f4d to nil" )
}
if err := b .ConsumeID (UpdateLangPackTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLangPack#56022f4d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLangPack ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLangPack#56022f4d to nil" )
}
{
if err := u .Difference .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateLangPack#56022f4d: field difference: %w" , err )
}
}
return nil
}
func (u *UpdateLangPack ) GetDifference () (value LangPackDifference ) {
if u == nil {
return
}
return u .Difference
}
type UpdateFavedStickers struct {
}
const UpdateFavedStickersTypeID = 0xe511996d
func (u UpdateFavedStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateFavedStickers {}
_ bin .Decoder = &UpdateFavedStickers {}
_ bin .BareEncoder = &UpdateFavedStickers {}
_ bin .BareDecoder = &UpdateFavedStickers {}
_ UpdateClass = &UpdateFavedStickers {}
)
func (u *UpdateFavedStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateFavedStickers ) String () string {
if u == nil {
return "UpdateFavedStickers(nil)"
}
type Alias UpdateFavedStickers
return fmt .Sprintf ("UpdateFavedStickers%+v" , Alias (*u ))
}
func (*UpdateFavedStickers ) TypeID () uint32 {
return UpdateFavedStickersTypeID
}
func (*UpdateFavedStickers ) TypeName () string {
return "updateFavedStickers"
}
func (u *UpdateFavedStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateFavedStickers" ,
ID : UpdateFavedStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateFavedStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFavedStickers#e511996d as nil" )
}
b .PutID (UpdateFavedStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateFavedStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFavedStickers#e511996d as nil" )
}
return nil
}
func (u *UpdateFavedStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFavedStickers#e511996d to nil" )
}
if err := b .ConsumeID (UpdateFavedStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateFavedStickers#e511996d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateFavedStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFavedStickers#e511996d to nil" )
}
return nil
}
type UpdateChannelReadMessagesContents struct {
Flags bin .Fields
ChannelID int64
TopMsgID int
Messages []int
}
const UpdateChannelReadMessagesContentsTypeID = 0xea29055d
func (u UpdateChannelReadMessagesContents ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelReadMessagesContents {}
_ bin .Decoder = &UpdateChannelReadMessagesContents {}
_ bin .BareEncoder = &UpdateChannelReadMessagesContents {}
_ bin .BareDecoder = &UpdateChannelReadMessagesContents {}
_ UpdateClass = &UpdateChannelReadMessagesContents {}
)
func (u *UpdateChannelReadMessagesContents ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
return true
}
func (u *UpdateChannelReadMessagesContents ) String () string {
if u == nil {
return "UpdateChannelReadMessagesContents(nil)"
}
type Alias UpdateChannelReadMessagesContents
return fmt .Sprintf ("UpdateChannelReadMessagesContents%+v" , Alias (*u ))
}
func (u *UpdateChannelReadMessagesContents ) FillFrom (from interface {
GetChannelID () (value int64 )
GetTopMsgID () (value int , ok bool )
GetMessages () (value []int )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetTopMsgID (); ok {
u .TopMsgID = val
}
u .Messages = from .GetMessages ()
}
func (*UpdateChannelReadMessagesContents ) TypeID () uint32 {
return UpdateChannelReadMessagesContentsTypeID
}
func (*UpdateChannelReadMessagesContents ) TypeName () string {
return "updateChannelReadMessagesContents"
}
func (u *UpdateChannelReadMessagesContents ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelReadMessagesContents" ,
ID : UpdateChannelReadMessagesContentsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
}
return typ
}
func (u *UpdateChannelReadMessagesContents ) SetFlags () {
if !(u .TopMsgID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateChannelReadMessagesContents ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelReadMessagesContents#ea29055d as nil" )
}
b .PutID (UpdateChannelReadMessagesContentsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelReadMessagesContents ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelReadMessagesContents#ea29055d as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelReadMessagesContents#ea29055d: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutInt (u .TopMsgID )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
return nil
}
func (u *UpdateChannelReadMessagesContents ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelReadMessagesContents#ea29055d to nil" )
}
if err := b .ConsumeID (UpdateChannelReadMessagesContentsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelReadMessagesContents ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelReadMessagesContents#ea29055d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelReadMessagesContents#ea29055d: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
return nil
}
func (u *UpdateChannelReadMessagesContents ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelReadMessagesContents ) SetTopMsgID (value int ) {
u .Flags .Set (0 )
u .TopMsgID = value
}
func (u *UpdateChannelReadMessagesContents ) GetTopMsgID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .TopMsgID , true
}
func (u *UpdateChannelReadMessagesContents ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
type UpdateContactsReset struct {
}
const UpdateContactsResetTypeID = 0x7084a7be
func (u UpdateContactsReset ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateContactsReset {}
_ bin .Decoder = &UpdateContactsReset {}
_ bin .BareEncoder = &UpdateContactsReset {}
_ bin .BareDecoder = &UpdateContactsReset {}
_ UpdateClass = &UpdateContactsReset {}
)
func (u *UpdateContactsReset ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateContactsReset ) String () string {
if u == nil {
return "UpdateContactsReset(nil)"
}
type Alias UpdateContactsReset
return fmt .Sprintf ("UpdateContactsReset%+v" , Alias (*u ))
}
func (*UpdateContactsReset ) TypeID () uint32 {
return UpdateContactsResetTypeID
}
func (*UpdateContactsReset ) TypeName () string {
return "updateContactsReset"
}
func (u *UpdateContactsReset ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateContactsReset" ,
ID : UpdateContactsResetTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateContactsReset ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateContactsReset#7084a7be as nil" )
}
b .PutID (UpdateContactsResetTypeID )
return u .EncodeBare (b )
}
func (u *UpdateContactsReset ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateContactsReset#7084a7be as nil" )
}
return nil
}
func (u *UpdateContactsReset ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateContactsReset#7084a7be to nil" )
}
if err := b .ConsumeID (UpdateContactsResetTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateContactsReset#7084a7be: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateContactsReset ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateContactsReset#7084a7be to nil" )
}
return nil
}
type UpdateChannelAvailableMessages struct {
ChannelID int64
AvailableMinID int
}
const UpdateChannelAvailableMessagesTypeID = 0xb23fc698
func (u UpdateChannelAvailableMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelAvailableMessages {}
_ bin .Decoder = &UpdateChannelAvailableMessages {}
_ bin .BareEncoder = &UpdateChannelAvailableMessages {}
_ bin .BareDecoder = &UpdateChannelAvailableMessages {}
_ UpdateClass = &UpdateChannelAvailableMessages {}
)
func (u *UpdateChannelAvailableMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .AvailableMinID == 0 ) {
return false
}
return true
}
func (u *UpdateChannelAvailableMessages ) String () string {
if u == nil {
return "UpdateChannelAvailableMessages(nil)"
}
type Alias UpdateChannelAvailableMessages
return fmt .Sprintf ("UpdateChannelAvailableMessages%+v" , Alias (*u ))
}
func (u *UpdateChannelAvailableMessages ) FillFrom (from interface {
GetChannelID () (value int64 )
GetAvailableMinID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .AvailableMinID = from .GetAvailableMinID ()
}
func (*UpdateChannelAvailableMessages ) TypeID () uint32 {
return UpdateChannelAvailableMessagesTypeID
}
func (*UpdateChannelAvailableMessages ) TypeName () string {
return "updateChannelAvailableMessages"
}
func (u *UpdateChannelAvailableMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelAvailableMessages" ,
ID : UpdateChannelAvailableMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "AvailableMinID" ,
SchemaName : "available_min_id" ,
},
}
return typ
}
func (u *UpdateChannelAvailableMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelAvailableMessages#b23fc698 as nil" )
}
b .PutID (UpdateChannelAvailableMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelAvailableMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelAvailableMessages#b23fc698 as nil" )
}
b .PutLong (u .ChannelID )
b .PutInt (u .AvailableMinID )
return nil
}
func (u *UpdateChannelAvailableMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelAvailableMessages#b23fc698 to nil" )
}
if err := b .ConsumeID (UpdateChannelAvailableMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#b23fc698: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelAvailableMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelAvailableMessages#b23fc698 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#b23fc698: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelAvailableMessages#b23fc698: field available_min_id: %w" , err )
}
u .AvailableMinID = value
}
return nil
}
func (u *UpdateChannelAvailableMessages ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelAvailableMessages ) GetAvailableMinID () (value int ) {
if u == nil {
return
}
return u .AvailableMinID
}
type UpdateDialogUnreadMark struct {
Flags bin .Fields
Unread bool
Peer DialogPeerClass
}
const UpdateDialogUnreadMarkTypeID = 0xe16459c3
func (u UpdateDialogUnreadMark ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogUnreadMark {}
_ bin .Decoder = &UpdateDialogUnreadMark {}
_ bin .BareEncoder = &UpdateDialogUnreadMark {}
_ bin .BareDecoder = &UpdateDialogUnreadMark {}
_ UpdateClass = &UpdateDialogUnreadMark {}
)
func (u *UpdateDialogUnreadMark ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Unread == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
return true
}
func (u *UpdateDialogUnreadMark ) String () string {
if u == nil {
return "UpdateDialogUnreadMark(nil)"
}
type Alias UpdateDialogUnreadMark
return fmt .Sprintf ("UpdateDialogUnreadMark%+v" , Alias (*u ))
}
func (u *UpdateDialogUnreadMark ) FillFrom (from interface {
GetUnread () (value bool )
GetPeer () (value DialogPeerClass )
}) {
u .Unread = from .GetUnread ()
u .Peer = from .GetPeer ()
}
func (*UpdateDialogUnreadMark ) TypeID () uint32 {
return UpdateDialogUnreadMarkTypeID
}
func (*UpdateDialogUnreadMark ) TypeName () string {
return "updateDialogUnreadMark"
}
func (u *UpdateDialogUnreadMark ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogUnreadMark" ,
ID : UpdateDialogUnreadMarkTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Unread" ,
SchemaName : "unread" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (u *UpdateDialogUnreadMark ) SetFlags () {
if !(u .Unread == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdateDialogUnreadMark ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogUnreadMark#e16459c3 as nil" )
}
b .PutID (UpdateDialogUnreadMarkTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogUnreadMark ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogUnreadMark#e16459c3 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogUnreadMark#e16459c3: field peer: %w" , err )
}
return nil
}
func (u *UpdateDialogUnreadMark ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogUnreadMark#e16459c3 to nil" )
}
if err := b .ConsumeID (UpdateDialogUnreadMarkTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogUnreadMark ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogUnreadMark#e16459c3 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: field flags: %w" , err )
}
}
u .Unread = u .Flags .Has (0 )
{
value , err := DecodeDialogPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDialogUnreadMark#e16459c3: field peer: %w" , err )
}
u .Peer = value
}
return nil
}
func (u *UpdateDialogUnreadMark ) SetUnread (value bool ) {
if value {
u .Flags .Set (0 )
u .Unread = true
} else {
u .Flags .Unset (0 )
u .Unread = false
}
}
func (u *UpdateDialogUnreadMark ) GetUnread () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateDialogUnreadMark ) GetPeer () (value DialogPeerClass ) {
if u == nil {
return
}
return u .Peer
}
type UpdateMessagePoll struct {
Flags bin .Fields
PollID int64
Poll Poll
Results PollResults
}
const UpdateMessagePollTypeID = 0xaca1657b
func (u UpdateMessagePoll ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessagePoll {}
_ bin .Decoder = &UpdateMessagePoll {}
_ bin .BareEncoder = &UpdateMessagePoll {}
_ bin .BareDecoder = &UpdateMessagePoll {}
_ UpdateClass = &UpdateMessagePoll {}
)
func (u *UpdateMessagePoll ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .PollID == 0 ) {
return false
}
if !(u .Poll .Zero ()) {
return false
}
if !(u .Results .Zero ()) {
return false
}
return true
}
func (u *UpdateMessagePoll ) String () string {
if u == nil {
return "UpdateMessagePoll(nil)"
}
type Alias UpdateMessagePoll
return fmt .Sprintf ("UpdateMessagePoll%+v" , Alias (*u ))
}
func (u *UpdateMessagePoll ) FillFrom (from interface {
GetPollID () (value int64 )
GetPoll () (value Poll , ok bool )
GetResults () (value PollResults )
}) {
u .PollID = from .GetPollID ()
if val , ok := from .GetPoll (); ok {
u .Poll = val
}
u .Results = from .GetResults ()
}
func (*UpdateMessagePoll ) TypeID () uint32 {
return UpdateMessagePollTypeID
}
func (*UpdateMessagePoll ) TypeName () string {
return "updateMessagePoll"
}
func (u *UpdateMessagePoll ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessagePoll" ,
ID : UpdateMessagePollTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PollID" ,
SchemaName : "poll_id" ,
},
{
Name : "Poll" ,
SchemaName : "poll" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Results" ,
SchemaName : "results" ,
},
}
return typ
}
func (u *UpdateMessagePoll ) SetFlags () {
if !(u .Poll .Zero ()) {
u .Flags .Set (0 )
}
}
func (u *UpdateMessagePoll ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePoll#aca1657b as nil" )
}
b .PutID (UpdateMessagePollTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessagePoll ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePoll#aca1657b as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field flags: %w" , err )
}
b .PutLong (u .PollID )
if u .Flags .Has (0 ) {
if err := u .Poll .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field poll: %w" , err )
}
}
if err := u .Results .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePoll#aca1657b: field results: %w" , err )
}
return nil
}
func (u *UpdateMessagePoll ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePoll#aca1657b to nil" )
}
if err := b .ConsumeID (UpdateMessagePollTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessagePoll ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePoll#aca1657b to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field poll_id: %w" , err )
}
u .PollID = value
}
if u .Flags .Has (0 ) {
if err := u .Poll .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field poll: %w" , err )
}
}
{
if err := u .Results .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePoll#aca1657b: field results: %w" , err )
}
}
return nil
}
func (u *UpdateMessagePoll ) GetPollID () (value int64 ) {
if u == nil {
return
}
return u .PollID
}
func (u *UpdateMessagePoll ) SetPoll (value Poll ) {
u .Flags .Set (0 )
u .Poll = value
}
func (u *UpdateMessagePoll ) GetPoll () (value Poll , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Poll , true
}
func (u *UpdateMessagePoll ) GetResults () (value PollResults ) {
if u == nil {
return
}
return u .Results
}
type UpdateChatDefaultBannedRights struct {
Peer PeerClass
DefaultBannedRights ChatBannedRights
Version int
}
const UpdateChatDefaultBannedRightsTypeID = 0x54c01850
func (u UpdateChatDefaultBannedRights ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatDefaultBannedRights {}
_ bin .Decoder = &UpdateChatDefaultBannedRights {}
_ bin .BareEncoder = &UpdateChatDefaultBannedRights {}
_ bin .BareDecoder = &UpdateChatDefaultBannedRights {}
_ UpdateClass = &UpdateChatDefaultBannedRights {}
)
func (u *UpdateChatDefaultBannedRights ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .DefaultBannedRights .Zero ()) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateChatDefaultBannedRights ) String () string {
if u == nil {
return "UpdateChatDefaultBannedRights(nil)"
}
type Alias UpdateChatDefaultBannedRights
return fmt .Sprintf ("UpdateChatDefaultBannedRights%+v" , Alias (*u ))
}
func (u *UpdateChatDefaultBannedRights ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetDefaultBannedRights () (value ChatBannedRights )
GetVersion () (value int )
}) {
u .Peer = from .GetPeer ()
u .DefaultBannedRights = from .GetDefaultBannedRights ()
u .Version = from .GetVersion ()
}
func (*UpdateChatDefaultBannedRights ) TypeID () uint32 {
return UpdateChatDefaultBannedRightsTypeID
}
func (*UpdateChatDefaultBannedRights ) TypeName () string {
return "updateChatDefaultBannedRights"
}
func (u *UpdateChatDefaultBannedRights ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatDefaultBannedRights" ,
ID : UpdateChatDefaultBannedRightsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "DefaultBannedRights" ,
SchemaName : "default_banned_rights" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateChatDefaultBannedRights ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatDefaultBannedRights#54c01850 as nil" )
}
b .PutID (UpdateChatDefaultBannedRightsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatDefaultBannedRights ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatDefaultBannedRights#54c01850 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field peer: %w" , err )
}
if err := u .DefaultBannedRights .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w" , err )
}
b .PutInt (u .Version )
return nil
}
func (u *UpdateChatDefaultBannedRights ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatDefaultBannedRights#54c01850 to nil" )
}
if err := b .ConsumeID (UpdateChatDefaultBannedRightsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatDefaultBannedRights ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatDefaultBannedRights#54c01850 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .DefaultBannedRights .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field default_banned_rights: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatDefaultBannedRights#54c01850: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u *UpdateChatDefaultBannedRights ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateChatDefaultBannedRights ) GetDefaultBannedRights () (value ChatBannedRights ) {
if u == nil {
return
}
return u .DefaultBannedRights
}
func (u *UpdateChatDefaultBannedRights ) GetVersion () (value int ) {
if u == nil {
return
}
return u .Version
}
type UpdateFolderPeers struct {
FolderPeers []FolderPeer
Pts int
PtsCount int
}
const UpdateFolderPeersTypeID = 0x19360dc0
func (u UpdateFolderPeers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateFolderPeers {}
_ bin .Decoder = &UpdateFolderPeers {}
_ bin .BareEncoder = &UpdateFolderPeers {}
_ bin .BareDecoder = &UpdateFolderPeers {}
_ UpdateClass = &UpdateFolderPeers {}
)
func (u *UpdateFolderPeers ) Zero () bool {
if u == nil {
return true
}
if !(u .FolderPeers == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdateFolderPeers ) String () string {
if u == nil {
return "UpdateFolderPeers(nil)"
}
type Alias UpdateFolderPeers
return fmt .Sprintf ("UpdateFolderPeers%+v" , Alias (*u ))
}
func (u *UpdateFolderPeers ) FillFrom (from interface {
GetFolderPeers () (value []FolderPeer )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .FolderPeers = from .GetFolderPeers ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdateFolderPeers ) TypeID () uint32 {
return UpdateFolderPeersTypeID
}
func (*UpdateFolderPeers ) TypeName () string {
return "updateFolderPeers"
}
func (u *UpdateFolderPeers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateFolderPeers" ,
ID : UpdateFolderPeersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FolderPeers" ,
SchemaName : "folder_peers" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdateFolderPeers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFolderPeers#19360dc0 as nil" )
}
b .PutID (UpdateFolderPeersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateFolderPeers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateFolderPeers#19360dc0 as nil" )
}
b .PutVectorHeader (len (u .FolderPeers ))
for idx , v := range u .FolderPeers {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateFolderPeers#19360dc0: field folder_peers element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdateFolderPeers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFolderPeers#19360dc0 to nil" )
}
if err := b .ConsumeID (UpdateFolderPeersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateFolderPeers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateFolderPeers#19360dc0 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w" , err )
}
if headerLen > 0 {
u .FolderPeers = make ([]FolderPeer , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value FolderPeer
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field folder_peers: %w" , err )
}
u .FolderPeers = append (u .FolderPeers , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateFolderPeers#19360dc0: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdateFolderPeers ) GetFolderPeers () (value []FolderPeer ) {
if u == nil {
return
}
return u .FolderPeers
}
func (u *UpdateFolderPeers ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdateFolderPeers ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdatePeerSettings struct {
Peer PeerClass
Settings PeerSettings
}
const UpdatePeerSettingsTypeID = 0x6a7e7366
func (u UpdatePeerSettings ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerSettings {}
_ bin .Decoder = &UpdatePeerSettings {}
_ bin .BareEncoder = &UpdatePeerSettings {}
_ bin .BareDecoder = &UpdatePeerSettings {}
_ UpdateClass = &UpdatePeerSettings {}
)
func (u *UpdatePeerSettings ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Settings .Zero ()) {
return false
}
return true
}
func (u *UpdatePeerSettings ) String () string {
if u == nil {
return "UpdatePeerSettings(nil)"
}
type Alias UpdatePeerSettings
return fmt .Sprintf ("UpdatePeerSettings%+v" , Alias (*u ))
}
func (u *UpdatePeerSettings ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetSettings () (value PeerSettings )
}) {
u .Peer = from .GetPeer ()
u .Settings = from .GetSettings ()
}
func (*UpdatePeerSettings ) TypeID () uint32 {
return UpdatePeerSettingsTypeID
}
func (*UpdatePeerSettings ) TypeName () string {
return "updatePeerSettings"
}
func (u *UpdatePeerSettings ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerSettings" ,
ID : UpdatePeerSettingsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Settings" ,
SchemaName : "settings" ,
},
}
return typ
}
func (u *UpdatePeerSettings ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerSettings#6a7e7366 as nil" )
}
b .PutID (UpdatePeerSettingsTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerSettings ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerSettings#6a7e7366 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field peer: %w" , err )
}
if err := u .Settings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerSettings#6a7e7366: field settings: %w" , err )
}
return nil
}
func (u *UpdatePeerSettings ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerSettings#6a7e7366 to nil" )
}
if err := b .ConsumeID (UpdatePeerSettingsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerSettings ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerSettings#6a7e7366 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .Settings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerSettings#6a7e7366: field settings: %w" , err )
}
}
return nil
}
func (u *UpdatePeerSettings ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdatePeerSettings ) GetSettings () (value PeerSettings ) {
if u == nil {
return
}
return u .Settings
}
type UpdatePeerLocated struct {
Peers []PeerLocatedClass
}
const UpdatePeerLocatedTypeID = 0xb4afcfb0
func (u UpdatePeerLocated ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerLocated {}
_ bin .Decoder = &UpdatePeerLocated {}
_ bin .BareEncoder = &UpdatePeerLocated {}
_ bin .BareDecoder = &UpdatePeerLocated {}
_ UpdateClass = &UpdatePeerLocated {}
)
func (u *UpdatePeerLocated ) Zero () bool {
if u == nil {
return true
}
if !(u .Peers == nil ) {
return false
}
return true
}
func (u *UpdatePeerLocated ) String () string {
if u == nil {
return "UpdatePeerLocated(nil)"
}
type Alias UpdatePeerLocated
return fmt .Sprintf ("UpdatePeerLocated%+v" , Alias (*u ))
}
func (u *UpdatePeerLocated ) FillFrom (from interface {
GetPeers () (value []PeerLocatedClass )
}) {
u .Peers = from .GetPeers ()
}
func (*UpdatePeerLocated ) TypeID () uint32 {
return UpdatePeerLocatedTypeID
}
func (*UpdatePeerLocated ) TypeName () string {
return "updatePeerLocated"
}
func (u *UpdatePeerLocated ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerLocated" ,
ID : UpdatePeerLocatedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peers" ,
SchemaName : "peers" ,
},
}
return typ
}
func (u *UpdatePeerLocated ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerLocated#b4afcfb0 as nil" )
}
b .PutID (UpdatePeerLocatedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerLocated ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerLocated#b4afcfb0 as nil" )
}
b .PutVectorHeader (len (u .Peers ))
for idx , v := range u .Peers {
if v == nil {
return fmt .Errorf ("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerLocated#b4afcfb0: field peers element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdatePeerLocated ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerLocated#b4afcfb0 to nil" )
}
if err := b .ConsumeID (UpdatePeerLocatedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerLocated ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerLocated#b4afcfb0 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: field peers: %w" , err )
}
if headerLen > 0 {
u .Peers = make ([]PeerLocatedClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePeerLocated (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerLocated#b4afcfb0: field peers: %w" , err )
}
u .Peers = append (u .Peers , value )
}
}
return nil
}
func (u *UpdatePeerLocated ) GetPeers () (value []PeerLocatedClass ) {
if u == nil {
return
}
return u .Peers
}
func (u *UpdatePeerLocated ) MapPeers () (value PeerLocatedClassArray ) {
return PeerLocatedClassArray (u .Peers )
}
type UpdateNewScheduledMessage struct {
Message MessageClass
}
const UpdateNewScheduledMessageTypeID = 0x39a51dfb
func (u UpdateNewScheduledMessage ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateNewScheduledMessage {}
_ bin .Decoder = &UpdateNewScheduledMessage {}
_ bin .BareEncoder = &UpdateNewScheduledMessage {}
_ bin .BareDecoder = &UpdateNewScheduledMessage {}
_ UpdateClass = &UpdateNewScheduledMessage {}
)
func (u *UpdateNewScheduledMessage ) Zero () bool {
if u == nil {
return true
}
if !(u .Message == nil ) {
return false
}
return true
}
func (u *UpdateNewScheduledMessage ) String () string {
if u == nil {
return "UpdateNewScheduledMessage(nil)"
}
type Alias UpdateNewScheduledMessage
return fmt .Sprintf ("UpdateNewScheduledMessage%+v" , Alias (*u ))
}
func (u *UpdateNewScheduledMessage ) FillFrom (from interface {
GetMessage () (value MessageClass )
}) {
u .Message = from .GetMessage ()
}
func (*UpdateNewScheduledMessage ) TypeID () uint32 {
return UpdateNewScheduledMessageTypeID
}
func (*UpdateNewScheduledMessage ) TypeName () string {
return "updateNewScheduledMessage"
}
func (u *UpdateNewScheduledMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateNewScheduledMessage" ,
ID : UpdateNewScheduledMessageTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
}
return typ
}
func (u *UpdateNewScheduledMessage ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewScheduledMessage#39a51dfb as nil" )
}
b .PutID (UpdateNewScheduledMessageTypeID )
return u .EncodeBare (b )
}
func (u *UpdateNewScheduledMessage ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateNewScheduledMessage#39a51dfb as nil" )
}
if u .Message == nil {
return fmt .Errorf ("unable to encode updateNewScheduledMessage#39a51dfb: field message is nil" )
}
if err := u .Message .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateNewScheduledMessage#39a51dfb: field message: %w" , err )
}
return nil
}
func (u *UpdateNewScheduledMessage ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewScheduledMessage#39a51dfb to nil" )
}
if err := b .ConsumeID (UpdateNewScheduledMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateNewScheduledMessage#39a51dfb: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateNewScheduledMessage ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateNewScheduledMessage#39a51dfb to nil" )
}
{
value , err := DecodeMessage (b )
if err != nil {
return fmt .Errorf ("unable to decode updateNewScheduledMessage#39a51dfb: field message: %w" , err )
}
u .Message = value
}
return nil
}
func (u *UpdateNewScheduledMessage ) GetMessage () (value MessageClass ) {
if u == nil {
return
}
return u .Message
}
type UpdateDeleteScheduledMessages struct {
Peer PeerClass
Messages []int
}
const UpdateDeleteScheduledMessagesTypeID = 0x90866cee
func (u UpdateDeleteScheduledMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDeleteScheduledMessages {}
_ bin .Decoder = &UpdateDeleteScheduledMessages {}
_ bin .BareEncoder = &UpdateDeleteScheduledMessages {}
_ bin .BareDecoder = &UpdateDeleteScheduledMessages {}
_ UpdateClass = &UpdateDeleteScheduledMessages {}
)
func (u *UpdateDeleteScheduledMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Messages == nil ) {
return false
}
return true
}
func (u *UpdateDeleteScheduledMessages ) String () string {
if u == nil {
return "UpdateDeleteScheduledMessages(nil)"
}
type Alias UpdateDeleteScheduledMessages
return fmt .Sprintf ("UpdateDeleteScheduledMessages%+v" , Alias (*u ))
}
func (u *UpdateDeleteScheduledMessages ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMessages () (value []int )
}) {
u .Peer = from .GetPeer ()
u .Messages = from .GetMessages ()
}
func (*UpdateDeleteScheduledMessages ) TypeID () uint32 {
return UpdateDeleteScheduledMessagesTypeID
}
func (*UpdateDeleteScheduledMessages ) TypeName () string {
return "updateDeleteScheduledMessages"
}
func (u *UpdateDeleteScheduledMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDeleteScheduledMessages" ,
ID : UpdateDeleteScheduledMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
}
return typ
}
func (u *UpdateDeleteScheduledMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteScheduledMessages#90866cee as nil" )
}
b .PutID (UpdateDeleteScheduledMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDeleteScheduledMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDeleteScheduledMessages#90866cee as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateDeleteScheduledMessages#90866cee: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDeleteScheduledMessages#90866cee: field peer: %w" , err )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
return nil
}
func (u *UpdateDeleteScheduledMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteScheduledMessages#90866cee to nil" )
}
if err := b .ConsumeID (UpdateDeleteScheduledMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDeleteScheduledMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDeleteScheduledMessages#90866cee to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field peer: %w" , err )
}
u .Peer = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDeleteScheduledMessages#90866cee: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
return nil
}
func (u *UpdateDeleteScheduledMessages ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateDeleteScheduledMessages ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
type UpdateTheme struct {
Theme Theme
}
const UpdateThemeTypeID = 0x8216fba3
func (u UpdateTheme ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateTheme {}
_ bin .Decoder = &UpdateTheme {}
_ bin .BareEncoder = &UpdateTheme {}
_ bin .BareDecoder = &UpdateTheme {}
_ UpdateClass = &UpdateTheme {}
)
func (u *UpdateTheme ) Zero () bool {
if u == nil {
return true
}
if !(u .Theme .Zero ()) {
return false
}
return true
}
func (u *UpdateTheme ) String () string {
if u == nil {
return "UpdateTheme(nil)"
}
type Alias UpdateTheme
return fmt .Sprintf ("UpdateTheme%+v" , Alias (*u ))
}
func (u *UpdateTheme ) FillFrom (from interface {
GetTheme () (value Theme )
}) {
u .Theme = from .GetTheme ()
}
func (*UpdateTheme ) TypeID () uint32 {
return UpdateThemeTypeID
}
func (*UpdateTheme ) TypeName () string {
return "updateTheme"
}
func (u *UpdateTheme ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateTheme" ,
ID : UpdateThemeTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Theme" ,
SchemaName : "theme" ,
},
}
return typ
}
func (u *UpdateTheme ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTheme#8216fba3 as nil" )
}
b .PutID (UpdateThemeTypeID )
return u .EncodeBare (b )
}
func (u *UpdateTheme ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTheme#8216fba3 as nil" )
}
if err := u .Theme .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateTheme#8216fba3: field theme: %w" , err )
}
return nil
}
func (u *UpdateTheme ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTheme#8216fba3 to nil" )
}
if err := b .ConsumeID (UpdateThemeTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateTheme#8216fba3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateTheme ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTheme#8216fba3 to nil" )
}
{
if err := u .Theme .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateTheme#8216fba3: field theme: %w" , err )
}
}
return nil
}
func (u *UpdateTheme ) GetTheme () (value Theme ) {
if u == nil {
return
}
return u .Theme
}
type UpdateGeoLiveViewed struct {
Peer PeerClass
MsgID int
}
const UpdateGeoLiveViewedTypeID = 0x871fb939
func (u UpdateGeoLiveViewed ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGeoLiveViewed {}
_ bin .Decoder = &UpdateGeoLiveViewed {}
_ bin .BareEncoder = &UpdateGeoLiveViewed {}
_ bin .BareDecoder = &UpdateGeoLiveViewed {}
_ UpdateClass = &UpdateGeoLiveViewed {}
)
func (u *UpdateGeoLiveViewed ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
return true
}
func (u *UpdateGeoLiveViewed ) String () string {
if u == nil {
return "UpdateGeoLiveViewed(nil)"
}
type Alias UpdateGeoLiveViewed
return fmt .Sprintf ("UpdateGeoLiveViewed%+v" , Alias (*u ))
}
func (u *UpdateGeoLiveViewed ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
}
func (*UpdateGeoLiveViewed ) TypeID () uint32 {
return UpdateGeoLiveViewedTypeID
}
func (*UpdateGeoLiveViewed ) TypeName () string {
return "updateGeoLiveViewed"
}
func (u *UpdateGeoLiveViewed ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGeoLiveViewed" ,
ID : UpdateGeoLiveViewedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
}
return typ
}
func (u *UpdateGeoLiveViewed ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGeoLiveViewed#871fb939 as nil" )
}
b .PutID (UpdateGeoLiveViewedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGeoLiveViewed ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGeoLiveViewed#871fb939 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateGeoLiveViewed#871fb939: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGeoLiveViewed#871fb939: field peer: %w" , err )
}
b .PutInt (u .MsgID )
return nil
}
func (u *UpdateGeoLiveViewed ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGeoLiveViewed#871fb939 to nil" )
}
if err := b .ConsumeID (UpdateGeoLiveViewedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGeoLiveViewed ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGeoLiveViewed#871fb939 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateGeoLiveViewed#871fb939: field msg_id: %w" , err )
}
u .MsgID = value
}
return nil
}
func (u *UpdateGeoLiveViewed ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateGeoLiveViewed ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
type UpdateLoginToken struct {
}
const UpdateLoginTokenTypeID = 0x564fe691
func (u UpdateLoginToken ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateLoginToken {}
_ bin .Decoder = &UpdateLoginToken {}
_ bin .BareEncoder = &UpdateLoginToken {}
_ bin .BareDecoder = &UpdateLoginToken {}
_ UpdateClass = &UpdateLoginToken {}
)
func (u *UpdateLoginToken ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateLoginToken ) String () string {
if u == nil {
return "UpdateLoginToken(nil)"
}
type Alias UpdateLoginToken
return fmt .Sprintf ("UpdateLoginToken%+v" , Alias (*u ))
}
func (*UpdateLoginToken ) TypeID () uint32 {
return UpdateLoginTokenTypeID
}
func (*UpdateLoginToken ) TypeName () string {
return "updateLoginToken"
}
func (u *UpdateLoginToken ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateLoginToken" ,
ID : UpdateLoginTokenTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateLoginToken ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLoginToken#564fe691 as nil" )
}
b .PutID (UpdateLoginTokenTypeID )
return u .EncodeBare (b )
}
func (u *UpdateLoginToken ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateLoginToken#564fe691 as nil" )
}
return nil
}
func (u *UpdateLoginToken ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLoginToken#564fe691 to nil" )
}
if err := b .ConsumeID (UpdateLoginTokenTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateLoginToken#564fe691: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateLoginToken ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateLoginToken#564fe691 to nil" )
}
return nil
}
type UpdateMessagePollVote struct {
PollID int64
Peer PeerClass
Options [][]byte
Qts int
}
const UpdateMessagePollVoteTypeID = 0x24f40e77
func (u UpdateMessagePollVote ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessagePollVote {}
_ bin .Decoder = &UpdateMessagePollVote {}
_ bin .BareEncoder = &UpdateMessagePollVote {}
_ bin .BareDecoder = &UpdateMessagePollVote {}
_ UpdateClass = &UpdateMessagePollVote {}
)
func (u *UpdateMessagePollVote ) Zero () bool {
if u == nil {
return true
}
if !(u .PollID == 0 ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .Options == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateMessagePollVote ) String () string {
if u == nil {
return "UpdateMessagePollVote(nil)"
}
type Alias UpdateMessagePollVote
return fmt .Sprintf ("UpdateMessagePollVote%+v" , Alias (*u ))
}
func (u *UpdateMessagePollVote ) FillFrom (from interface {
GetPollID () (value int64 )
GetPeer () (value PeerClass )
GetOptions () (value [][]byte )
GetQts () (value int )
}) {
u .PollID = from .GetPollID ()
u .Peer = from .GetPeer ()
u .Options = from .GetOptions ()
u .Qts = from .GetQts ()
}
func (*UpdateMessagePollVote ) TypeID () uint32 {
return UpdateMessagePollVoteTypeID
}
func (*UpdateMessagePollVote ) TypeName () string {
return "updateMessagePollVote"
}
func (u *UpdateMessagePollVote ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessagePollVote" ,
ID : UpdateMessagePollVoteTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PollID" ,
SchemaName : "poll_id" ,
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Options" ,
SchemaName : "options" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateMessagePollVote ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePollVote#24f40e77 as nil" )
}
b .PutID (UpdateMessagePollVoteTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessagePollVote ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessagePollVote#24f40e77 as nil" )
}
b .PutLong (u .PollID )
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateMessagePollVote#24f40e77: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessagePollVote#24f40e77: field peer: %w" , err )
}
b .PutVectorHeader (len (u .Options ))
for _ , v := range u .Options {
b .PutBytes (v )
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateMessagePollVote ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePollVote#24f40e77 to nil" )
}
if err := b .ConsumeID (UpdateMessagePollVoteTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessagePollVote ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessagePollVote#24f40e77 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: field poll_id: %w" , err )
}
u .PollID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: field peer: %w" , err )
}
u .Peer = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: field options: %w" , err )
}
if headerLen > 0 {
u .Options = make ([][]byte , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: field options: %w" , err )
}
u .Options = append (u .Options , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessagePollVote#24f40e77: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateMessagePollVote ) GetPollID () (value int64 ) {
if u == nil {
return
}
return u .PollID
}
func (u *UpdateMessagePollVote ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateMessagePollVote ) GetOptions () (value [][]byte ) {
if u == nil {
return
}
return u .Options
}
func (u *UpdateMessagePollVote ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateDialogFilter struct {
Flags bin .Fields
ID int
Filter DialogFilterClass
}
const UpdateDialogFilterTypeID = 0x26ffde7d
func (u UpdateDialogFilter ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilter {}
_ bin .Decoder = &UpdateDialogFilter {}
_ bin .BareEncoder = &UpdateDialogFilter {}
_ bin .BareDecoder = &UpdateDialogFilter {}
_ UpdateClass = &UpdateDialogFilter {}
)
func (u *UpdateDialogFilter ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Filter == nil ) {
return false
}
return true
}
func (u *UpdateDialogFilter ) String () string {
if u == nil {
return "UpdateDialogFilter(nil)"
}
type Alias UpdateDialogFilter
return fmt .Sprintf ("UpdateDialogFilter%+v" , Alias (*u ))
}
func (u *UpdateDialogFilter ) FillFrom (from interface {
GetID () (value int )
GetFilter () (value DialogFilterClass , ok bool )
}) {
u .ID = from .GetID ()
if val , ok := from .GetFilter (); ok {
u .Filter = val
}
}
func (*UpdateDialogFilter ) TypeID () uint32 {
return UpdateDialogFilterTypeID
}
func (*UpdateDialogFilter ) TypeName () string {
return "updateDialogFilter"
}
func (u *UpdateDialogFilter ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilter" ,
ID : UpdateDialogFilterTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Filter" ,
SchemaName : "filter" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateDialogFilter ) SetFlags () {
if !(u .Filter == nil ) {
u .Flags .Set (0 )
}
}
func (u *UpdateDialogFilter ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilter#26ffde7d as nil" )
}
b .PutID (UpdateDialogFilterTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilter ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilter#26ffde7d as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogFilter#26ffde7d: field flags: %w" , err )
}
b .PutInt (u .ID )
if u .Flags .Has (0 ) {
if u .Filter == nil {
return fmt .Errorf ("unable to encode updateDialogFilter#26ffde7d: field filter is nil" )
}
if err := u .Filter .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateDialogFilter#26ffde7d: field filter: %w" , err )
}
}
return nil
}
func (u *UpdateDialogFilter ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilter#26ffde7d to nil" )
}
if err := b .ConsumeID (UpdateDialogFilterTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilter ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilter#26ffde7d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field id: %w" , err )
}
u .ID = value
}
if u .Flags .Has (0 ) {
value , err := DecodeDialogFilter (b )
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilter#26ffde7d: field filter: %w" , err )
}
u .Filter = value
}
return nil
}
func (u *UpdateDialogFilter ) GetID () (value int ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateDialogFilter ) SetFilter (value DialogFilterClass ) {
u .Flags .Set (0 )
u .Filter = value
}
func (u *UpdateDialogFilter ) GetFilter () (value DialogFilterClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Filter , true
}
type UpdateDialogFilterOrder struct {
Order []int
}
const UpdateDialogFilterOrderTypeID = 0xa5d72105
func (u UpdateDialogFilterOrder ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilterOrder {}
_ bin .Decoder = &UpdateDialogFilterOrder {}
_ bin .BareEncoder = &UpdateDialogFilterOrder {}
_ bin .BareDecoder = &UpdateDialogFilterOrder {}
_ UpdateClass = &UpdateDialogFilterOrder {}
)
func (u *UpdateDialogFilterOrder ) Zero () bool {
if u == nil {
return true
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdateDialogFilterOrder ) String () string {
if u == nil {
return "UpdateDialogFilterOrder(nil)"
}
type Alias UpdateDialogFilterOrder
return fmt .Sprintf ("UpdateDialogFilterOrder%+v" , Alias (*u ))
}
func (u *UpdateDialogFilterOrder ) FillFrom (from interface {
GetOrder () (value []int )
}) {
u .Order = from .GetOrder ()
}
func (*UpdateDialogFilterOrder ) TypeID () uint32 {
return UpdateDialogFilterOrderTypeID
}
func (*UpdateDialogFilterOrder ) TypeName () string {
return "updateDialogFilterOrder"
}
func (u *UpdateDialogFilterOrder ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilterOrder" ,
ID : UpdateDialogFilterOrderTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Order" ,
SchemaName : "order" ,
},
}
return typ
}
func (u *UpdateDialogFilterOrder ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilterOrder#a5d72105 as nil" )
}
b .PutID (UpdateDialogFilterOrderTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilterOrder ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilterOrder#a5d72105 as nil" )
}
b .PutVectorHeader (len (u .Order ))
for _ , v := range u .Order {
b .PutInt (v )
}
return nil
}
func (u *UpdateDialogFilterOrder ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilterOrder#a5d72105 to nil" )
}
if err := b .ConsumeID (UpdateDialogFilterOrderTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilterOrder ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilterOrder#a5d72105 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: field order: %w" , err )
}
if headerLen > 0 {
u .Order = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateDialogFilterOrder#a5d72105: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u *UpdateDialogFilterOrder ) GetOrder () (value []int ) {
if u == nil {
return
}
return u .Order
}
type UpdateDialogFilters struct {
}
const UpdateDialogFiltersTypeID = 0x3504914f
func (u UpdateDialogFilters ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateDialogFilters {}
_ bin .Decoder = &UpdateDialogFilters {}
_ bin .BareEncoder = &UpdateDialogFilters {}
_ bin .BareDecoder = &UpdateDialogFilters {}
_ UpdateClass = &UpdateDialogFilters {}
)
func (u *UpdateDialogFilters ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateDialogFilters ) String () string {
if u == nil {
return "UpdateDialogFilters(nil)"
}
type Alias UpdateDialogFilters
return fmt .Sprintf ("UpdateDialogFilters%+v" , Alias (*u ))
}
func (*UpdateDialogFilters ) TypeID () uint32 {
return UpdateDialogFiltersTypeID
}
func (*UpdateDialogFilters ) TypeName () string {
return "updateDialogFilters"
}
func (u *UpdateDialogFilters ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateDialogFilters" ,
ID : UpdateDialogFiltersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateDialogFilters ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilters#3504914f as nil" )
}
b .PutID (UpdateDialogFiltersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateDialogFilters ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateDialogFilters#3504914f as nil" )
}
return nil
}
func (u *UpdateDialogFilters ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilters#3504914f to nil" )
}
if err := b .ConsumeID (UpdateDialogFiltersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateDialogFilters#3504914f: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateDialogFilters ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateDialogFilters#3504914f to nil" )
}
return nil
}
type UpdatePhoneCallSignalingData struct {
PhoneCallID int64
Data []byte
}
const UpdatePhoneCallSignalingDataTypeID = 0x2661bf09
func (u UpdatePhoneCallSignalingData ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePhoneCallSignalingData {}
_ bin .Decoder = &UpdatePhoneCallSignalingData {}
_ bin .BareEncoder = &UpdatePhoneCallSignalingData {}
_ bin .BareDecoder = &UpdatePhoneCallSignalingData {}
_ UpdateClass = &UpdatePhoneCallSignalingData {}
)
func (u *UpdatePhoneCallSignalingData ) Zero () bool {
if u == nil {
return true
}
if !(u .PhoneCallID == 0 ) {
return false
}
if !(u .Data == nil ) {
return false
}
return true
}
func (u *UpdatePhoneCallSignalingData ) String () string {
if u == nil {
return "UpdatePhoneCallSignalingData(nil)"
}
type Alias UpdatePhoneCallSignalingData
return fmt .Sprintf ("UpdatePhoneCallSignalingData%+v" , Alias (*u ))
}
func (u *UpdatePhoneCallSignalingData ) FillFrom (from interface {
GetPhoneCallID () (value int64 )
GetData () (value []byte )
}) {
u .PhoneCallID = from .GetPhoneCallID ()
u .Data = from .GetData ()
}
func (*UpdatePhoneCallSignalingData ) TypeID () uint32 {
return UpdatePhoneCallSignalingDataTypeID
}
func (*UpdatePhoneCallSignalingData ) TypeName () string {
return "updatePhoneCallSignalingData"
}
func (u *UpdatePhoneCallSignalingData ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePhoneCallSignalingData" ,
ID : UpdatePhoneCallSignalingDataTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PhoneCallID" ,
SchemaName : "phone_call_id" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
},
}
return typ
}
func (u *UpdatePhoneCallSignalingData ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCallSignalingData#2661bf09 as nil" )
}
b .PutID (UpdatePhoneCallSignalingDataTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePhoneCallSignalingData ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePhoneCallSignalingData#2661bf09 as nil" )
}
b .PutLong (u .PhoneCallID )
b .PutBytes (u .Data )
return nil
}
func (u *UpdatePhoneCallSignalingData ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCallSignalingData#2661bf09 to nil" )
}
if err := b .ConsumeID (UpdatePhoneCallSignalingDataTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePhoneCallSignalingData ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePhoneCallSignalingData#2661bf09 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: field phone_call_id: %w" , err )
}
u .PhoneCallID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode updatePhoneCallSignalingData#2661bf09: field data: %w" , err )
}
u .Data = value
}
return nil
}
func (u *UpdatePhoneCallSignalingData ) GetPhoneCallID () (value int64 ) {
if u == nil {
return
}
return u .PhoneCallID
}
func (u *UpdatePhoneCallSignalingData ) GetData () (value []byte ) {
if u == nil {
return
}
return u .Data
}
type UpdateChannelMessageForwards struct {
ChannelID int64
ID int
Forwards int
}
const UpdateChannelMessageForwardsTypeID = 0xd29a27f4
func (u UpdateChannelMessageForwards ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelMessageForwards {}
_ bin .Decoder = &UpdateChannelMessageForwards {}
_ bin .BareEncoder = &UpdateChannelMessageForwards {}
_ bin .BareDecoder = &UpdateChannelMessageForwards {}
_ UpdateClass = &UpdateChannelMessageForwards {}
)
func (u *UpdateChannelMessageForwards ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .Forwards == 0 ) {
return false
}
return true
}
func (u *UpdateChannelMessageForwards ) String () string {
if u == nil {
return "UpdateChannelMessageForwards(nil)"
}
type Alias UpdateChannelMessageForwards
return fmt .Sprintf ("UpdateChannelMessageForwards%+v" , Alias (*u ))
}
func (u *UpdateChannelMessageForwards ) FillFrom (from interface {
GetChannelID () (value int64 )
GetID () (value int )
GetForwards () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .ID = from .GetID ()
u .Forwards = from .GetForwards ()
}
func (*UpdateChannelMessageForwards ) TypeID () uint32 {
return UpdateChannelMessageForwardsTypeID
}
func (*UpdateChannelMessageForwards ) TypeName () string {
return "updateChannelMessageForwards"
}
func (u *UpdateChannelMessageForwards ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelMessageForwards" ,
ID : UpdateChannelMessageForwardsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Forwards" ,
SchemaName : "forwards" ,
},
}
return typ
}
func (u *UpdateChannelMessageForwards ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageForwards#d29a27f4 as nil" )
}
b .PutID (UpdateChannelMessageForwardsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelMessageForwards ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelMessageForwards#d29a27f4 as nil" )
}
b .PutLong (u .ChannelID )
b .PutInt (u .ID )
b .PutInt (u .Forwards )
return nil
}
func (u *UpdateChannelMessageForwards ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageForwards#d29a27f4 to nil" )
}
if err := b .ConsumeID (UpdateChannelMessageForwardsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#d29a27f4: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelMessageForwards ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelMessageForwards#d29a27f4 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#d29a27f4: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#d29a27f4: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelMessageForwards#d29a27f4: field forwards: %w" , err )
}
u .Forwards = value
}
return nil
}
func (u *UpdateChannelMessageForwards ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelMessageForwards ) GetID () (value int ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateChannelMessageForwards ) GetForwards () (value int ) {
if u == nil {
return
}
return u .Forwards
}
type UpdateReadChannelDiscussionInbox struct {
Flags bin .Fields
ChannelID int64
TopMsgID int
ReadMaxID int
BroadcastID int64
BroadcastPost int
}
const UpdateReadChannelDiscussionInboxTypeID = 0xd6b19546
func (u UpdateReadChannelDiscussionInbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelDiscussionInbox {}
_ bin .Decoder = &UpdateReadChannelDiscussionInbox {}
_ bin .BareEncoder = &UpdateReadChannelDiscussionInbox {}
_ bin .BareDecoder = &UpdateReadChannelDiscussionInbox {}
_ UpdateClass = &UpdateReadChannelDiscussionInbox {}
)
func (u *UpdateReadChannelDiscussionInbox ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .ReadMaxID == 0 ) {
return false
}
if !(u .BroadcastID == 0 ) {
return false
}
if !(u .BroadcastPost == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelDiscussionInbox ) String () string {
if u == nil {
return "UpdateReadChannelDiscussionInbox(nil)"
}
type Alias UpdateReadChannelDiscussionInbox
return fmt .Sprintf ("UpdateReadChannelDiscussionInbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelDiscussionInbox ) FillFrom (from interface {
GetChannelID () (value int64 )
GetTopMsgID () (value int )
GetReadMaxID () (value int )
GetBroadcastID () (value int64 , ok bool )
GetBroadcastPost () (value int , ok bool )
}) {
u .ChannelID = from .GetChannelID ()
u .TopMsgID = from .GetTopMsgID ()
u .ReadMaxID = from .GetReadMaxID ()
if val , ok := from .GetBroadcastID (); ok {
u .BroadcastID = val
}
if val , ok := from .GetBroadcastPost (); ok {
u .BroadcastPost = val
}
}
func (*UpdateReadChannelDiscussionInbox ) TypeID () uint32 {
return UpdateReadChannelDiscussionInboxTypeID
}
func (*UpdateReadChannelDiscussionInbox ) TypeName () string {
return "updateReadChannelDiscussionInbox"
}
func (u *UpdateReadChannelDiscussionInbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelDiscussionInbox" ,
ID : UpdateReadChannelDiscussionInboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
},
{
Name : "ReadMaxID" ,
SchemaName : "read_max_id" ,
},
{
Name : "BroadcastID" ,
SchemaName : "broadcast_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "BroadcastPost" ,
SchemaName : "broadcast_post" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateReadChannelDiscussionInbox ) SetFlags () {
if !(u .BroadcastID == 0 ) {
u .Flags .Set (0 )
}
if !(u .BroadcastPost == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateReadChannelDiscussionInbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil" )
}
b .PutID (UpdateReadChannelDiscussionInboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelDiscussionInbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionInbox#d6b19546 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadChannelDiscussionInbox#d6b19546: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
b .PutInt (u .TopMsgID )
b .PutInt (u .ReadMaxID )
if u .Flags .Has (0 ) {
b .PutLong (u .BroadcastID )
}
if u .Flags .Has (0 ) {
b .PutInt (u .BroadcastPost )
}
return nil
}
func (u *UpdateReadChannelDiscussionInbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionInbox#d6b19546 to nil" )
}
if err := b .ConsumeID (UpdateReadChannelDiscussionInboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelDiscussionInbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionInbox#d6b19546 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field read_max_id: %w" , err )
}
u .ReadMaxID = value
}
if u .Flags .Has (0 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_id: %w" , err )
}
u .BroadcastID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionInbox#d6b19546: field broadcast_post: %w" , err )
}
u .BroadcastPost = value
}
return nil
}
func (u *UpdateReadChannelDiscussionInbox ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateReadChannelDiscussionInbox ) GetTopMsgID () (value int ) {
if u == nil {
return
}
return u .TopMsgID
}
func (u *UpdateReadChannelDiscussionInbox ) GetReadMaxID () (value int ) {
if u == nil {
return
}
return u .ReadMaxID
}
func (u *UpdateReadChannelDiscussionInbox ) SetBroadcastID (value int64 ) {
u .Flags .Set (0 )
u .BroadcastID = value
}
func (u *UpdateReadChannelDiscussionInbox ) GetBroadcastID () (value int64 , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .BroadcastID , true
}
func (u *UpdateReadChannelDiscussionInbox ) SetBroadcastPost (value int ) {
u .Flags .Set (0 )
u .BroadcastPost = value
}
func (u *UpdateReadChannelDiscussionInbox ) GetBroadcastPost () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .BroadcastPost , true
}
type UpdateReadChannelDiscussionOutbox struct {
ChannelID int64
TopMsgID int
ReadMaxID int
}
const UpdateReadChannelDiscussionOutboxTypeID = 0x695c9e7c
func (u UpdateReadChannelDiscussionOutbox ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .Decoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .BareEncoder = &UpdateReadChannelDiscussionOutbox {}
_ bin .BareDecoder = &UpdateReadChannelDiscussionOutbox {}
_ UpdateClass = &UpdateReadChannelDiscussionOutbox {}
)
func (u *UpdateReadChannelDiscussionOutbox ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .ReadMaxID == 0 ) {
return false
}
return true
}
func (u *UpdateReadChannelDiscussionOutbox ) String () string {
if u == nil {
return "UpdateReadChannelDiscussionOutbox(nil)"
}
type Alias UpdateReadChannelDiscussionOutbox
return fmt .Sprintf ("UpdateReadChannelDiscussionOutbox%+v" , Alias (*u ))
}
func (u *UpdateReadChannelDiscussionOutbox ) FillFrom (from interface {
GetChannelID () (value int64 )
GetTopMsgID () (value int )
GetReadMaxID () (value int )
}) {
u .ChannelID = from .GetChannelID ()
u .TopMsgID = from .GetTopMsgID ()
u .ReadMaxID = from .GetReadMaxID ()
}
func (*UpdateReadChannelDiscussionOutbox ) TypeID () uint32 {
return UpdateReadChannelDiscussionOutboxTypeID
}
func (*UpdateReadChannelDiscussionOutbox ) TypeName () string {
return "updateReadChannelDiscussionOutbox"
}
func (u *UpdateReadChannelDiscussionOutbox ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadChannelDiscussionOutbox" ,
ID : UpdateReadChannelDiscussionOutboxTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
},
{
Name : "ReadMaxID" ,
SchemaName : "read_max_id" ,
},
}
return typ
}
func (u *UpdateReadChannelDiscussionOutbox ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil" )
}
b .PutID (UpdateReadChannelDiscussionOutboxTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadChannelDiscussionOutbox ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadChannelDiscussionOutbox#695c9e7c as nil" )
}
b .PutLong (u .ChannelID )
b .PutInt (u .TopMsgID )
b .PutInt (u .ReadMaxID )
return nil
}
func (u *UpdateReadChannelDiscussionOutbox ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionOutbox#695c9e7c to nil" )
}
if err := b .ConsumeID (UpdateReadChannelDiscussionOutboxTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadChannelDiscussionOutbox ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadChannelDiscussionOutbox#695c9e7c to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadChannelDiscussionOutbox#695c9e7c: field read_max_id: %w" , err )
}
u .ReadMaxID = value
}
return nil
}
func (u *UpdateReadChannelDiscussionOutbox ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateReadChannelDiscussionOutbox ) GetTopMsgID () (value int ) {
if u == nil {
return
}
return u .TopMsgID
}
func (u *UpdateReadChannelDiscussionOutbox ) GetReadMaxID () (value int ) {
if u == nil {
return
}
return u .ReadMaxID
}
type UpdatePeerBlocked struct {
Flags bin .Fields
Blocked bool
BlockedMyStoriesFrom bool
PeerID PeerClass
}
const UpdatePeerBlockedTypeID = 0xebe07752
func (u UpdatePeerBlocked ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerBlocked {}
_ bin .Decoder = &UpdatePeerBlocked {}
_ bin .BareEncoder = &UpdatePeerBlocked {}
_ bin .BareDecoder = &UpdatePeerBlocked {}
_ UpdateClass = &UpdatePeerBlocked {}
)
func (u *UpdatePeerBlocked ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Blocked == false ) {
return false
}
if !(u .BlockedMyStoriesFrom == false ) {
return false
}
if !(u .PeerID == nil ) {
return false
}
return true
}
func (u *UpdatePeerBlocked ) String () string {
if u == nil {
return "UpdatePeerBlocked(nil)"
}
type Alias UpdatePeerBlocked
return fmt .Sprintf ("UpdatePeerBlocked%+v" , Alias (*u ))
}
func (u *UpdatePeerBlocked ) FillFrom (from interface {
GetBlocked () (value bool )
GetBlockedMyStoriesFrom () (value bool )
GetPeerID () (value PeerClass )
}) {
u .Blocked = from .GetBlocked ()
u .BlockedMyStoriesFrom = from .GetBlockedMyStoriesFrom ()
u .PeerID = from .GetPeerID ()
}
func (*UpdatePeerBlocked ) TypeID () uint32 {
return UpdatePeerBlockedTypeID
}
func (*UpdatePeerBlocked ) TypeName () string {
return "updatePeerBlocked"
}
func (u *UpdatePeerBlocked ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerBlocked" ,
ID : UpdatePeerBlockedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Blocked" ,
SchemaName : "blocked" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "BlockedMyStoriesFrom" ,
SchemaName : "blocked_my_stories_from" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "PeerID" ,
SchemaName : "peer_id" ,
},
}
return typ
}
func (u *UpdatePeerBlocked ) SetFlags () {
if !(u .Blocked == false ) {
u .Flags .Set (0 )
}
if !(u .BlockedMyStoriesFrom == false ) {
u .Flags .Set (1 )
}
}
func (u *UpdatePeerBlocked ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerBlocked#ebe07752 as nil" )
}
b .PutID (UpdatePeerBlockedTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerBlocked ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerBlocked#ebe07752 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerBlocked#ebe07752: field flags: %w" , err )
}
if u .PeerID == nil {
return fmt .Errorf ("unable to encode updatePeerBlocked#ebe07752: field peer_id is nil" )
}
if err := u .PeerID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerBlocked#ebe07752: field peer_id: %w" , err )
}
return nil
}
func (u *UpdatePeerBlocked ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerBlocked#ebe07752 to nil" )
}
if err := b .ConsumeID (UpdatePeerBlockedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#ebe07752: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerBlocked ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerBlocked#ebe07752 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#ebe07752: field flags: %w" , err )
}
}
u .Blocked = u .Flags .Has (0 )
u .BlockedMyStoriesFrom = u .Flags .Has (1 )
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerBlocked#ebe07752: field peer_id: %w" , err )
}
u .PeerID = value
}
return nil
}
func (u *UpdatePeerBlocked ) SetBlocked (value bool ) {
if value {
u .Flags .Set (0 )
u .Blocked = true
} else {
u .Flags .Unset (0 )
u .Blocked = false
}
}
func (u *UpdatePeerBlocked ) GetBlocked () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdatePeerBlocked ) SetBlockedMyStoriesFrom (value bool ) {
if value {
u .Flags .Set (1 )
u .BlockedMyStoriesFrom = true
} else {
u .Flags .Unset (1 )
u .BlockedMyStoriesFrom = false
}
}
func (u *UpdatePeerBlocked ) GetBlockedMyStoriesFrom () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (1 )
}
func (u *UpdatePeerBlocked ) GetPeerID () (value PeerClass ) {
if u == nil {
return
}
return u .PeerID
}
type UpdateChannelUserTyping struct {
Flags bin .Fields
ChannelID int64
TopMsgID int
FromID PeerClass
Action SendMessageActionClass
}
const UpdateChannelUserTypingTypeID = 0x8c88c923
func (u UpdateChannelUserTyping ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelUserTyping {}
_ bin .Decoder = &UpdateChannelUserTyping {}
_ bin .BareEncoder = &UpdateChannelUserTyping {}
_ bin .BareDecoder = &UpdateChannelUserTyping {}
_ UpdateClass = &UpdateChannelUserTyping {}
)
func (u *UpdateChannelUserTyping ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .FromID == nil ) {
return false
}
if !(u .Action == nil ) {
return false
}
return true
}
func (u *UpdateChannelUserTyping ) String () string {
if u == nil {
return "UpdateChannelUserTyping(nil)"
}
type Alias UpdateChannelUserTyping
return fmt .Sprintf ("UpdateChannelUserTyping%+v" , Alias (*u ))
}
func (u *UpdateChannelUserTyping ) FillFrom (from interface {
GetChannelID () (value int64 )
GetTopMsgID () (value int , ok bool )
GetFromID () (value PeerClass )
GetAction () (value SendMessageActionClass )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetTopMsgID (); ok {
u .TopMsgID = val
}
u .FromID = from .GetFromID ()
u .Action = from .GetAction ()
}
func (*UpdateChannelUserTyping ) TypeID () uint32 {
return UpdateChannelUserTypingTypeID
}
func (*UpdateChannelUserTyping ) TypeName () string {
return "updateChannelUserTyping"
}
func (u *UpdateChannelUserTyping ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelUserTyping" ,
ID : UpdateChannelUserTypingTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "FromID" ,
SchemaName : "from_id" ,
},
{
Name : "Action" ,
SchemaName : "action" ,
},
}
return typ
}
func (u *UpdateChannelUserTyping ) SetFlags () {
if !(u .TopMsgID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateChannelUserTyping ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelUserTyping#8c88c923 as nil" )
}
b .PutID (UpdateChannelUserTypingTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelUserTyping ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelUserTyping#8c88c923 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#8c88c923: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutInt (u .TopMsgID )
}
if u .FromID == nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#8c88c923: field from_id is nil" )
}
if err := u .FromID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#8c88c923: field from_id: %w" , err )
}
if u .Action == nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#8c88c923: field action is nil" )
}
if err := u .Action .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelUserTyping#8c88c923: field action: %w" , err )
}
return nil
}
func (u *UpdateChannelUserTyping ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelUserTyping#8c88c923 to nil" )
}
if err := b .ConsumeID (UpdateChannelUserTypingTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelUserTyping ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelUserTyping#8c88c923 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: field from_id: %w" , err )
}
u .FromID = value
}
{
value , err := DecodeSendMessageAction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelUserTyping#8c88c923: field action: %w" , err )
}
u .Action = value
}
return nil
}
func (u *UpdateChannelUserTyping ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelUserTyping ) SetTopMsgID (value int ) {
u .Flags .Set (0 )
u .TopMsgID = value
}
func (u *UpdateChannelUserTyping ) GetTopMsgID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .TopMsgID , true
}
func (u *UpdateChannelUserTyping ) GetFromID () (value PeerClass ) {
if u == nil {
return
}
return u .FromID
}
func (u *UpdateChannelUserTyping ) GetAction () (value SendMessageActionClass ) {
if u == nil {
return
}
return u .Action
}
type UpdatePinnedMessages struct {
Flags bin .Fields
Pinned bool
Peer PeerClass
Messages []int
Pts int
PtsCount int
}
const UpdatePinnedMessagesTypeID = 0xed85eab5
func (u UpdatePinnedMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedMessages {}
_ bin .Decoder = &UpdatePinnedMessages {}
_ bin .BareEncoder = &UpdatePinnedMessages {}
_ bin .BareDecoder = &UpdatePinnedMessages {}
_ UpdateClass = &UpdatePinnedMessages {}
)
func (u *UpdatePinnedMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdatePinnedMessages ) String () string {
if u == nil {
return "UpdatePinnedMessages(nil)"
}
type Alias UpdatePinnedMessages
return fmt .Sprintf ("UpdatePinnedMessages%+v" , Alias (*u ))
}
func (u *UpdatePinnedMessages ) FillFrom (from interface {
GetPinned () (value bool )
GetPeer () (value PeerClass )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Pinned = from .GetPinned ()
u .Peer = from .GetPeer ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdatePinnedMessages ) TypeID () uint32 {
return UpdatePinnedMessagesTypeID
}
func (*UpdatePinnedMessages ) TypeName () string {
return "updatePinnedMessages"
}
func (u *UpdatePinnedMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedMessages" ,
ID : UpdatePinnedMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdatePinnedMessages ) SetFlags () {
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdatePinnedMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedMessages#ed85eab5 as nil" )
}
b .PutID (UpdatePinnedMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedMessages#ed85eab5 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedMessages#ed85eab5: field peer: %w" , err )
}
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdatePinnedMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedMessages#ed85eab5 to nil" )
}
if err := b .ConsumeID (UpdatePinnedMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedMessages#ed85eab5 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field peer: %w" , err )
}
u .Peer = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedMessages#ed85eab5: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdatePinnedMessages ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdatePinnedMessages ) GetPinned () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdatePinnedMessages ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdatePinnedMessages ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
func (u *UpdatePinnedMessages ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdatePinnedMessages ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdatePinnedChannelMessages struct {
Flags bin .Fields
Pinned bool
ChannelID int64
Messages []int
Pts int
PtsCount int
}
const UpdatePinnedChannelMessagesTypeID = 0x5bb98608
func (u UpdatePinnedChannelMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePinnedChannelMessages {}
_ bin .Decoder = &UpdatePinnedChannelMessages {}
_ bin .BareEncoder = &UpdatePinnedChannelMessages {}
_ bin .BareDecoder = &UpdatePinnedChannelMessages {}
_ UpdateClass = &UpdatePinnedChannelMessages {}
)
func (u *UpdatePinnedChannelMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Messages == nil ) {
return false
}
if !(u .Pts == 0 ) {
return false
}
if !(u .PtsCount == 0 ) {
return false
}
return true
}
func (u *UpdatePinnedChannelMessages ) String () string {
if u == nil {
return "UpdatePinnedChannelMessages(nil)"
}
type Alias UpdatePinnedChannelMessages
return fmt .Sprintf ("UpdatePinnedChannelMessages%+v" , Alias (*u ))
}
func (u *UpdatePinnedChannelMessages ) FillFrom (from interface {
GetPinned () (value bool )
GetChannelID () (value int64 )
GetMessages () (value []int )
GetPts () (value int )
GetPtsCount () (value int )
}) {
u .Pinned = from .GetPinned ()
u .ChannelID = from .GetChannelID ()
u .Messages = from .GetMessages ()
u .Pts = from .GetPts ()
u .PtsCount = from .GetPtsCount ()
}
func (*UpdatePinnedChannelMessages ) TypeID () uint32 {
return UpdatePinnedChannelMessagesTypeID
}
func (*UpdatePinnedChannelMessages ) TypeName () string {
return "updatePinnedChannelMessages"
}
func (u *UpdatePinnedChannelMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePinnedChannelMessages" ,
ID : UpdatePinnedChannelMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Messages" ,
SchemaName : "messages" ,
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (u *UpdatePinnedChannelMessages ) SetFlags () {
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdatePinnedChannelMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedChannelMessages#5bb98608 as nil" )
}
b .PutID (UpdatePinnedChannelMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePinnedChannelMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePinnedChannelMessages#5bb98608 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePinnedChannelMessages#5bb98608: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
b .PutVectorHeader (len (u .Messages ))
for _ , v := range u .Messages {
b .PutInt (v )
}
b .PutInt (u .Pts )
b .PutInt (u .PtsCount )
return nil
}
func (u *UpdatePinnedChannelMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedChannelMessages#5bb98608 to nil" )
}
if err := b .ConsumeID (UpdatePinnedChannelMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePinnedChannelMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePinnedChannelMessages#5bb98608 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w" , err )
}
if headerLen > 0 {
u .Messages = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field messages: %w" , err )
}
u .Messages = append (u .Messages , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field pts: %w" , err )
}
u .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePinnedChannelMessages#5bb98608: field pts_count: %w" , err )
}
u .PtsCount = value
}
return nil
}
func (u *UpdatePinnedChannelMessages ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdatePinnedChannelMessages ) GetPinned () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdatePinnedChannelMessages ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdatePinnedChannelMessages ) GetMessages () (value []int ) {
if u == nil {
return
}
return u .Messages
}
func (u *UpdatePinnedChannelMessages ) GetPts () (value int ) {
if u == nil {
return
}
return u .Pts
}
func (u *UpdatePinnedChannelMessages ) GetPtsCount () (value int ) {
if u == nil {
return
}
return u .PtsCount
}
type UpdateChat struct {
ChatID int64
}
const UpdateChatTypeID = 0xf89a6a4e
func (u UpdateChat ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChat {}
_ bin .Decoder = &UpdateChat {}
_ bin .BareEncoder = &UpdateChat {}
_ bin .BareDecoder = &UpdateChat {}
_ UpdateClass = &UpdateChat {}
)
func (u *UpdateChat ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
return true
}
func (u *UpdateChat ) String () string {
if u == nil {
return "UpdateChat(nil)"
}
type Alias UpdateChat
return fmt .Sprintf ("UpdateChat%+v" , Alias (*u ))
}
func (u *UpdateChat ) FillFrom (from interface {
GetChatID () (value int64 )
}) {
u .ChatID = from .GetChatID ()
}
func (*UpdateChat ) TypeID () uint32 {
return UpdateChatTypeID
}
func (*UpdateChat ) TypeName () string {
return "updateChat"
}
func (u *UpdateChat ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChat" ,
ID : UpdateChatTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (u *UpdateChat ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChat#f89a6a4e as nil" )
}
b .PutID (UpdateChatTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChat ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChat#f89a6a4e as nil" )
}
b .PutLong (u .ChatID )
return nil
}
func (u *UpdateChat ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChat#f89a6a4e to nil" )
}
if err := b .ConsumeID (UpdateChatTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChat#f89a6a4e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChat ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChat#f89a6a4e to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChat#f89a6a4e: field chat_id: %w" , err )
}
u .ChatID = value
}
return nil
}
func (u *UpdateChat ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
type UpdateGroupCallParticipants struct {
Call InputGroupCall
Participants []GroupCallParticipant
Version int
}
const UpdateGroupCallParticipantsTypeID = 0xf2ebdb4e
func (u UpdateGroupCallParticipants ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupCallParticipants {}
_ bin .Decoder = &UpdateGroupCallParticipants {}
_ bin .BareEncoder = &UpdateGroupCallParticipants {}
_ bin .BareDecoder = &UpdateGroupCallParticipants {}
_ UpdateClass = &UpdateGroupCallParticipants {}
)
func (u *UpdateGroupCallParticipants ) Zero () bool {
if u == nil {
return true
}
if !(u .Call .Zero ()) {
return false
}
if !(u .Participants == nil ) {
return false
}
if !(u .Version == 0 ) {
return false
}
return true
}
func (u *UpdateGroupCallParticipants ) String () string {
if u == nil {
return "UpdateGroupCallParticipants(nil)"
}
type Alias UpdateGroupCallParticipants
return fmt .Sprintf ("UpdateGroupCallParticipants%+v" , Alias (*u ))
}
func (u *UpdateGroupCallParticipants ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetParticipants () (value []GroupCallParticipant )
GetVersion () (value int )
}) {
u .Call = from .GetCall ()
u .Participants = from .GetParticipants ()
u .Version = from .GetVersion ()
}
func (*UpdateGroupCallParticipants ) TypeID () uint32 {
return UpdateGroupCallParticipantsTypeID
}
func (*UpdateGroupCallParticipants ) TypeName () string {
return "updateGroupCallParticipants"
}
func (u *UpdateGroupCallParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupCallParticipants" ,
ID : UpdateGroupCallParticipantsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Participants" ,
SchemaName : "participants" ,
},
{
Name : "Version" ,
SchemaName : "version" ,
},
}
return typ
}
func (u *UpdateGroupCallParticipants ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallParticipants#f2ebdb4e as nil" )
}
b .PutID (UpdateGroupCallParticipantsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupCallParticipants ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallParticipants#f2ebdb4e as nil" )
}
if err := u .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallParticipants#f2ebdb4e: field call: %w" , err )
}
b .PutVectorHeader (len (u .Participants ))
for idx , v := range u .Participants {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallParticipants#f2ebdb4e: field participants element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Version )
return nil
}
func (u *UpdateGroupCallParticipants ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallParticipants#f2ebdb4e to nil" )
}
if err := b .ConsumeID (UpdateGroupCallParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupCallParticipants ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallParticipants#f2ebdb4e to nil" )
}
{
if err := u .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field call: %w" , err )
}
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w" , err )
}
if headerLen > 0 {
u .Participants = make ([]GroupCallParticipant , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value GroupCallParticipant
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field participants: %w" , err )
}
u .Participants = append (u .Participants , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCallParticipants#f2ebdb4e: field version: %w" , err )
}
u .Version = value
}
return nil
}
func (u *UpdateGroupCallParticipants ) GetCall () (value InputGroupCall ) {
if u == nil {
return
}
return u .Call
}
func (u *UpdateGroupCallParticipants ) GetParticipants () (value []GroupCallParticipant ) {
if u == nil {
return
}
return u .Participants
}
func (u *UpdateGroupCallParticipants ) GetVersion () (value int ) {
if u == nil {
return
}
return u .Version
}
type UpdateGroupCall struct {
ChatID int64
Call GroupCallClass
}
const UpdateGroupCallTypeID = 0x14b24500
func (u UpdateGroupCall ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupCall {}
_ bin .Decoder = &UpdateGroupCall {}
_ bin .BareEncoder = &UpdateGroupCall {}
_ bin .BareDecoder = &UpdateGroupCall {}
_ UpdateClass = &UpdateGroupCall {}
)
func (u *UpdateGroupCall ) Zero () bool {
if u == nil {
return true
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .Call == nil ) {
return false
}
return true
}
func (u *UpdateGroupCall ) String () string {
if u == nil {
return "UpdateGroupCall(nil)"
}
type Alias UpdateGroupCall
return fmt .Sprintf ("UpdateGroupCall%+v" , Alias (*u ))
}
func (u *UpdateGroupCall ) FillFrom (from interface {
GetChatID () (value int64 )
GetCall () (value GroupCallClass )
}) {
u .ChatID = from .GetChatID ()
u .Call = from .GetCall ()
}
func (*UpdateGroupCall ) TypeID () uint32 {
return UpdateGroupCallTypeID
}
func (*UpdateGroupCall ) TypeName () string {
return "updateGroupCall"
}
func (u *UpdateGroupCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupCall" ,
ID : UpdateGroupCallTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "Call" ,
SchemaName : "call" ,
},
}
return typ
}
func (u *UpdateGroupCall ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCall#14b24500 as nil" )
}
b .PutID (UpdateGroupCallTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupCall ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCall#14b24500 as nil" )
}
b .PutLong (u .ChatID )
if u .Call == nil {
return fmt .Errorf ("unable to encode updateGroupCall#14b24500: field call is nil" )
}
if err := u .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCall#14b24500: field call: %w" , err )
}
return nil
}
func (u *UpdateGroupCall ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCall#14b24500 to nil" )
}
if err := b .ConsumeID (UpdateGroupCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#14b24500: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupCall ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCall#14b24500 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#14b24500: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := DecodeGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode updateGroupCall#14b24500: field call: %w" , err )
}
u .Call = value
}
return nil
}
func (u *UpdateGroupCall ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateGroupCall ) GetCall () (value GroupCallClass ) {
if u == nil {
return
}
return u .Call
}
type UpdatePeerHistoryTTL struct {
Flags bin .Fields
Peer PeerClass
TTLPeriod int
}
const UpdatePeerHistoryTTLTypeID = 0xbb9bb9a5
func (u UpdatePeerHistoryTTL ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerHistoryTTL {}
_ bin .Decoder = &UpdatePeerHistoryTTL {}
_ bin .BareEncoder = &UpdatePeerHistoryTTL {}
_ bin .BareDecoder = &UpdatePeerHistoryTTL {}
_ UpdateClass = &UpdatePeerHistoryTTL {}
)
func (u *UpdatePeerHistoryTTL ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .TTLPeriod == 0 ) {
return false
}
return true
}
func (u *UpdatePeerHistoryTTL ) String () string {
if u == nil {
return "UpdatePeerHistoryTTL(nil)"
}
type Alias UpdatePeerHistoryTTL
return fmt .Sprintf ("UpdatePeerHistoryTTL%+v" , Alias (*u ))
}
func (u *UpdatePeerHistoryTTL ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetTTLPeriod () (value int , ok bool )
}) {
u .Peer = from .GetPeer ()
if val , ok := from .GetTTLPeriod (); ok {
u .TTLPeriod = val
}
}
func (*UpdatePeerHistoryTTL ) TypeID () uint32 {
return UpdatePeerHistoryTTLTypeID
}
func (*UpdatePeerHistoryTTL ) TypeName () string {
return "updatePeerHistoryTTL"
}
func (u *UpdatePeerHistoryTTL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerHistoryTTL" ,
ID : UpdatePeerHistoryTTLTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "TTLPeriod" ,
SchemaName : "ttl_period" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdatePeerHistoryTTL ) SetFlags () {
if !(u .TTLPeriod == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdatePeerHistoryTTL ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil" )
}
b .PutID (UpdatePeerHistoryTTLTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerHistoryTTL ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerHistoryTTL#bb9bb9a5 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerHistoryTTL#bb9bb9a5: field peer: %w" , err )
}
if u .Flags .Has (0 ) {
b .PutInt (u .TTLPeriod )
}
return nil
}
func (u *UpdatePeerHistoryTTL ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerHistoryTTL#bb9bb9a5 to nil" )
}
if err := b .ConsumeID (UpdatePeerHistoryTTLTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerHistoryTTL ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerHistoryTTL#bb9bb9a5 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field flags: %w" , err )
}
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field peer: %w" , err )
}
u .Peer = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePeerHistoryTTL#bb9bb9a5: field ttl_period: %w" , err )
}
u .TTLPeriod = value
}
return nil
}
func (u *UpdatePeerHistoryTTL ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdatePeerHistoryTTL ) SetTTLPeriod (value int ) {
u .Flags .Set (0 )
u .TTLPeriod = value
}
func (u *UpdatePeerHistoryTTL ) GetTTLPeriod () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .TTLPeriod , true
}
type UpdateChatParticipant struct {
Flags bin .Fields
ChatID int64
Date int
ActorID int64
UserID int64
PrevParticipant ChatParticipantClass
NewParticipant ChatParticipantClass
Invite ExportedChatInviteClass
Qts int
}
const UpdateChatParticipantTypeID = 0xd087663a
func (u UpdateChatParticipant ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChatParticipant {}
_ bin .Decoder = &UpdateChatParticipant {}
_ bin .BareEncoder = &UpdateChatParticipant {}
_ bin .BareDecoder = &UpdateChatParticipant {}
_ UpdateClass = &UpdateChatParticipant {}
)
func (u *UpdateChatParticipant ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChatID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .ActorID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .PrevParticipant == nil ) {
return false
}
if !(u .NewParticipant == nil ) {
return false
}
if !(u .Invite == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateChatParticipant ) String () string {
if u == nil {
return "UpdateChatParticipant(nil)"
}
type Alias UpdateChatParticipant
return fmt .Sprintf ("UpdateChatParticipant%+v" , Alias (*u ))
}
func (u *UpdateChatParticipant ) FillFrom (from interface {
GetChatID () (value int64 )
GetDate () (value int )
GetActorID () (value int64 )
GetUserID () (value int64 )
GetPrevParticipant () (value ChatParticipantClass , ok bool )
GetNewParticipant () (value ChatParticipantClass , ok bool )
GetInvite () (value ExportedChatInviteClass , ok bool )
GetQts () (value int )
}) {
u .ChatID = from .GetChatID ()
u .Date = from .GetDate ()
u .ActorID = from .GetActorID ()
u .UserID = from .GetUserID ()
if val , ok := from .GetPrevParticipant (); ok {
u .PrevParticipant = val
}
if val , ok := from .GetNewParticipant (); ok {
u .NewParticipant = val
}
if val , ok := from .GetInvite (); ok {
u .Invite = val
}
u .Qts = from .GetQts ()
}
func (*UpdateChatParticipant ) TypeID () uint32 {
return UpdateChatParticipantTypeID
}
func (*UpdateChatParticipant ) TypeName () string {
return "updateChatParticipant"
}
func (u *UpdateChatParticipant ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChatParticipant" ,
ID : UpdateChatParticipantTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "ActorID" ,
SchemaName : "actor_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "PrevParticipant" ,
SchemaName : "prev_participant" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "NewParticipant" ,
SchemaName : "new_participant" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Invite" ,
SchemaName : "invite" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateChatParticipant ) SetFlags () {
if !(u .PrevParticipant == nil ) {
u .Flags .Set (0 )
}
if !(u .NewParticipant == nil ) {
u .Flags .Set (1 )
}
if !(u .Invite == nil ) {
u .Flags .Set (2 )
}
}
func (u *UpdateChatParticipant ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipant#d087663a as nil" )
}
b .PutID (UpdateChatParticipantTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChatParticipant ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChatParticipant#d087663a as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field flags: %w" , err )
}
b .PutLong (u .ChatID )
b .PutInt (u .Date )
b .PutLong (u .ActorID )
b .PutLong (u .UserID )
if u .Flags .Has (0 ) {
if u .PrevParticipant == nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field prev_participant is nil" )
}
if err := u .PrevParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field prev_participant: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .NewParticipant == nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field new_participant is nil" )
}
if err := u .NewParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field new_participant: %w" , err )
}
}
if u .Flags .Has (2 ) {
if u .Invite == nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field invite is nil" )
}
if err := u .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChatParticipant#d087663a: field invite: %w" , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateChatParticipant ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipant#d087663a to nil" )
}
if err := b .ConsumeID (UpdateChatParticipantTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChatParticipant ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChatParticipant#d087663a to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field chat_id: %w" , err )
}
u .ChatID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field actor_id: %w" , err )
}
u .ActorID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field user_id: %w" , err )
}
u .UserID = value
}
if u .Flags .Has (0 ) {
value , err := DecodeChatParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field prev_participant: %w" , err )
}
u .PrevParticipant = value
}
if u .Flags .Has (1 ) {
value , err := DecodeChatParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field new_participant: %w" , err )
}
u .NewParticipant = value
}
if u .Flags .Has (2 ) {
value , err := DecodeExportedChatInvite (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field invite: %w" , err )
}
u .Invite = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChatParticipant#d087663a: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateChatParticipant ) GetChatID () (value int64 ) {
if u == nil {
return
}
return u .ChatID
}
func (u *UpdateChatParticipant ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateChatParticipant ) GetActorID () (value int64 ) {
if u == nil {
return
}
return u .ActorID
}
func (u *UpdateChatParticipant ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateChatParticipant ) SetPrevParticipant (value ChatParticipantClass ) {
u .Flags .Set (0 )
u .PrevParticipant = value
}
func (u *UpdateChatParticipant ) GetPrevParticipant () (value ChatParticipantClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .PrevParticipant , true
}
func (u *UpdateChatParticipant ) SetNewParticipant (value ChatParticipantClass ) {
u .Flags .Set (1 )
u .NewParticipant = value
}
func (u *UpdateChatParticipant ) GetNewParticipant () (value ChatParticipantClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .NewParticipant , true
}
func (u *UpdateChatParticipant ) SetInvite (value ExportedChatInviteClass ) {
u .Flags .Set (2 )
u .Invite = value
}
func (u *UpdateChatParticipant ) GetInvite () (value ExportedChatInviteClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (2 ) {
return value , false
}
return u .Invite , true
}
func (u *UpdateChatParticipant ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateChannelParticipant struct {
Flags bin .Fields
ViaChatlist bool
ChannelID int64
Date int
ActorID int64
UserID int64
PrevParticipant ChannelParticipantClass
NewParticipant ChannelParticipantClass
Invite ExportedChatInviteClass
Qts int
}
const UpdateChannelParticipantTypeID = 0x985d3abb
func (u UpdateChannelParticipant ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelParticipant {}
_ bin .Decoder = &UpdateChannelParticipant {}
_ bin .BareEncoder = &UpdateChannelParticipant {}
_ bin .BareDecoder = &UpdateChannelParticipant {}
_ UpdateClass = &UpdateChannelParticipant {}
)
func (u *UpdateChannelParticipant ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ViaChatlist == false ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .ActorID == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .PrevParticipant == nil ) {
return false
}
if !(u .NewParticipant == nil ) {
return false
}
if !(u .Invite == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateChannelParticipant ) String () string {
if u == nil {
return "UpdateChannelParticipant(nil)"
}
type Alias UpdateChannelParticipant
return fmt .Sprintf ("UpdateChannelParticipant%+v" , Alias (*u ))
}
func (u *UpdateChannelParticipant ) FillFrom (from interface {
GetViaChatlist () (value bool )
GetChannelID () (value int64 )
GetDate () (value int )
GetActorID () (value int64 )
GetUserID () (value int64 )
GetPrevParticipant () (value ChannelParticipantClass , ok bool )
GetNewParticipant () (value ChannelParticipantClass , ok bool )
GetInvite () (value ExportedChatInviteClass , ok bool )
GetQts () (value int )
}) {
u .ViaChatlist = from .GetViaChatlist ()
u .ChannelID = from .GetChannelID ()
u .Date = from .GetDate ()
u .ActorID = from .GetActorID ()
u .UserID = from .GetUserID ()
if val , ok := from .GetPrevParticipant (); ok {
u .PrevParticipant = val
}
if val , ok := from .GetNewParticipant (); ok {
u .NewParticipant = val
}
if val , ok := from .GetInvite (); ok {
u .Invite = val
}
u .Qts = from .GetQts ()
}
func (*UpdateChannelParticipant ) TypeID () uint32 {
return UpdateChannelParticipantTypeID
}
func (*UpdateChannelParticipant ) TypeName () string {
return "updateChannelParticipant"
}
func (u *UpdateChannelParticipant ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelParticipant" ,
ID : UpdateChannelParticipantTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ViaChatlist" ,
SchemaName : "via_chatlist" ,
Null : !u .Flags .Has (3 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "ActorID" ,
SchemaName : "actor_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "PrevParticipant" ,
SchemaName : "prev_participant" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "NewParticipant" ,
SchemaName : "new_participant" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Invite" ,
SchemaName : "invite" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateChannelParticipant ) SetFlags () {
if !(u .ViaChatlist == false ) {
u .Flags .Set (3 )
}
if !(u .PrevParticipant == nil ) {
u .Flags .Set (0 )
}
if !(u .NewParticipant == nil ) {
u .Flags .Set (1 )
}
if !(u .Invite == nil ) {
u .Flags .Set (2 )
}
}
func (u *UpdateChannelParticipant ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelParticipant#985d3abb as nil" )
}
b .PutID (UpdateChannelParticipantTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelParticipant ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelParticipant#985d3abb as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
b .PutInt (u .Date )
b .PutLong (u .ActorID )
b .PutLong (u .UserID )
if u .Flags .Has (0 ) {
if u .PrevParticipant == nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field prev_participant is nil" )
}
if err := u .PrevParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field prev_participant: %w" , err )
}
}
if u .Flags .Has (1 ) {
if u .NewParticipant == nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field new_participant is nil" )
}
if err := u .NewParticipant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field new_participant: %w" , err )
}
}
if u .Flags .Has (2 ) {
if u .Invite == nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field invite is nil" )
}
if err := u .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelParticipant#985d3abb: field invite: %w" , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateChannelParticipant ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelParticipant#985d3abb to nil" )
}
if err := b .ConsumeID (UpdateChannelParticipantTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelParticipant ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelParticipant#985d3abb to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field flags: %w" , err )
}
}
u .ViaChatlist = u .Flags .Has (3 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field actor_id: %w" , err )
}
u .ActorID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field user_id: %w" , err )
}
u .UserID = value
}
if u .Flags .Has (0 ) {
value , err := DecodeChannelParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field prev_participant: %w" , err )
}
u .PrevParticipant = value
}
if u .Flags .Has (1 ) {
value , err := DecodeChannelParticipant (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field new_participant: %w" , err )
}
u .NewParticipant = value
}
if u .Flags .Has (2 ) {
value , err := DecodeExportedChatInvite (b )
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field invite: %w" , err )
}
u .Invite = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelParticipant#985d3abb: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateChannelParticipant ) SetViaChatlist (value bool ) {
if value {
u .Flags .Set (3 )
u .ViaChatlist = true
} else {
u .Flags .Unset (3 )
u .ViaChatlist = false
}
}
func (u *UpdateChannelParticipant ) GetViaChatlist () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (3 )
}
func (u *UpdateChannelParticipant ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelParticipant ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateChannelParticipant ) GetActorID () (value int64 ) {
if u == nil {
return
}
return u .ActorID
}
func (u *UpdateChannelParticipant ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateChannelParticipant ) SetPrevParticipant (value ChannelParticipantClass ) {
u .Flags .Set (0 )
u .PrevParticipant = value
}
func (u *UpdateChannelParticipant ) GetPrevParticipant () (value ChannelParticipantClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .PrevParticipant , true
}
func (u *UpdateChannelParticipant ) SetNewParticipant (value ChannelParticipantClass ) {
u .Flags .Set (1 )
u .NewParticipant = value
}
func (u *UpdateChannelParticipant ) GetNewParticipant () (value ChannelParticipantClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .NewParticipant , true
}
func (u *UpdateChannelParticipant ) SetInvite (value ExportedChatInviteClass ) {
u .Flags .Set (2 )
u .Invite = value
}
func (u *UpdateChannelParticipant ) GetInvite () (value ExportedChatInviteClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (2 ) {
return value , false
}
return u .Invite , true
}
func (u *UpdateChannelParticipant ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateBotStopped struct {
UserID int64
Date int
Stopped bool
Qts int
}
const UpdateBotStoppedTypeID = 0xc4870a49
func (u UpdateBotStopped ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotStopped {}
_ bin .Decoder = &UpdateBotStopped {}
_ bin .BareEncoder = &UpdateBotStopped {}
_ bin .BareDecoder = &UpdateBotStopped {}
_ UpdateClass = &UpdateBotStopped {}
)
func (u *UpdateBotStopped ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Stopped == false ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotStopped ) String () string {
if u == nil {
return "UpdateBotStopped(nil)"
}
type Alias UpdateBotStopped
return fmt .Sprintf ("UpdateBotStopped%+v" , Alias (*u ))
}
func (u *UpdateBotStopped ) FillFrom (from interface {
GetUserID () (value int64 )
GetDate () (value int )
GetStopped () (value bool )
GetQts () (value int )
}) {
u .UserID = from .GetUserID ()
u .Date = from .GetDate ()
u .Stopped = from .GetStopped ()
u .Qts = from .GetQts ()
}
func (*UpdateBotStopped ) TypeID () uint32 {
return UpdateBotStoppedTypeID
}
func (*UpdateBotStopped ) TypeName () string {
return "updateBotStopped"
}
func (u *UpdateBotStopped ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotStopped" ,
ID : UpdateBotStoppedTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Stopped" ,
SchemaName : "stopped" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotStopped ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotStopped#c4870a49 as nil" )
}
b .PutID (UpdateBotStoppedTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotStopped ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotStopped#c4870a49 as nil" )
}
b .PutLong (u .UserID )
b .PutInt (u .Date )
b .PutBool (u .Stopped )
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotStopped ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotStopped#c4870a49 to nil" )
}
if err := b .ConsumeID (UpdateBotStoppedTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#c4870a49: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotStopped ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotStopped#c4870a49 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#c4870a49: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#c4870a49: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#c4870a49: field stopped: %w" , err )
}
u .Stopped = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotStopped#c4870a49: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateBotStopped ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotStopped ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateBotStopped ) GetStopped () (value bool ) {
if u == nil {
return
}
return u .Stopped
}
func (u *UpdateBotStopped ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateGroupCallConnection struct {
Flags bin .Fields
Presentation bool
Params DataJSON
}
const UpdateGroupCallConnectionTypeID = 0xb783982
func (u UpdateGroupCallConnection ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupCallConnection {}
_ bin .Decoder = &UpdateGroupCallConnection {}
_ bin .BareEncoder = &UpdateGroupCallConnection {}
_ bin .BareDecoder = &UpdateGroupCallConnection {}
_ UpdateClass = &UpdateGroupCallConnection {}
)
func (u *UpdateGroupCallConnection ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Presentation == false ) {
return false
}
if !(u .Params .Zero ()) {
return false
}
return true
}
func (u *UpdateGroupCallConnection ) String () string {
if u == nil {
return "UpdateGroupCallConnection(nil)"
}
type Alias UpdateGroupCallConnection
return fmt .Sprintf ("UpdateGroupCallConnection%+v" , Alias (*u ))
}
func (u *UpdateGroupCallConnection ) FillFrom (from interface {
GetPresentation () (value bool )
GetParams () (value DataJSON )
}) {
u .Presentation = from .GetPresentation ()
u .Params = from .GetParams ()
}
func (*UpdateGroupCallConnection ) TypeID () uint32 {
return UpdateGroupCallConnectionTypeID
}
func (*UpdateGroupCallConnection ) TypeName () string {
return "updateGroupCallConnection"
}
func (u *UpdateGroupCallConnection ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupCallConnection" ,
ID : UpdateGroupCallConnectionTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Presentation" ,
SchemaName : "presentation" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Params" ,
SchemaName : "params" ,
},
}
return typ
}
func (u *UpdateGroupCallConnection ) SetFlags () {
if !(u .Presentation == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdateGroupCallConnection ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallConnection#b783982 as nil" )
}
b .PutID (UpdateGroupCallConnectionTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupCallConnection ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupCallConnection#b783982 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallConnection#b783982: field flags: %w" , err )
}
if err := u .Params .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateGroupCallConnection#b783982: field params: %w" , err )
}
return nil
}
func (u *UpdateGroupCallConnection ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallConnection#b783982 to nil" )
}
if err := b .ConsumeID (UpdateGroupCallConnectionTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallConnection#b783982: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupCallConnection ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupCallConnection#b783982 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallConnection#b783982: field flags: %w" , err )
}
}
u .Presentation = u .Flags .Has (0 )
{
if err := u .Params .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateGroupCallConnection#b783982: field params: %w" , err )
}
}
return nil
}
func (u *UpdateGroupCallConnection ) SetPresentation (value bool ) {
if value {
u .Flags .Set (0 )
u .Presentation = true
} else {
u .Flags .Unset (0 )
u .Presentation = false
}
}
func (u *UpdateGroupCallConnection ) GetPresentation () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateGroupCallConnection ) GetParams () (value DataJSON ) {
if u == nil {
return
}
return u .Params
}
type UpdateBotCommands struct {
Peer PeerClass
BotID int64
Commands []BotCommand
}
const UpdateBotCommandsTypeID = 0x4d712f2e
func (u UpdateBotCommands ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotCommands {}
_ bin .Decoder = &UpdateBotCommands {}
_ bin .BareEncoder = &UpdateBotCommands {}
_ bin .BareDecoder = &UpdateBotCommands {}
_ UpdateClass = &UpdateBotCommands {}
)
func (u *UpdateBotCommands ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .BotID == 0 ) {
return false
}
if !(u .Commands == nil ) {
return false
}
return true
}
func (u *UpdateBotCommands ) String () string {
if u == nil {
return "UpdateBotCommands(nil)"
}
type Alias UpdateBotCommands
return fmt .Sprintf ("UpdateBotCommands%+v" , Alias (*u ))
}
func (u *UpdateBotCommands ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetBotID () (value int64 )
GetCommands () (value []BotCommand )
}) {
u .Peer = from .GetPeer ()
u .BotID = from .GetBotID ()
u .Commands = from .GetCommands ()
}
func (*UpdateBotCommands ) TypeID () uint32 {
return UpdateBotCommandsTypeID
}
func (*UpdateBotCommands ) TypeName () string {
return "updateBotCommands"
}
func (u *UpdateBotCommands ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotCommands" ,
ID : UpdateBotCommandsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "BotID" ,
SchemaName : "bot_id" ,
},
{
Name : "Commands" ,
SchemaName : "commands" ,
},
}
return typ
}
func (u *UpdateBotCommands ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCommands#4d712f2e as nil" )
}
b .PutID (UpdateBotCommandsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotCommands ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotCommands#4d712f2e as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotCommands#4d712f2e: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCommands#4d712f2e: field peer: %w" , err )
}
b .PutLong (u .BotID )
b .PutVectorHeader (len (u .Commands ))
for idx , v := range u .Commands {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotCommands#4d712f2e: field commands element with index %d: %w" , idx , err )
}
}
return nil
}
func (u *UpdateBotCommands ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCommands#4d712f2e to nil" )
}
if err := b .ConsumeID (UpdateBotCommandsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotCommands#4d712f2e: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotCommands ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotCommands#4d712f2e to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotCommands#4d712f2e: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCommands#4d712f2e: field bot_id: %w" , err )
}
u .BotID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotCommands#4d712f2e: field commands: %w" , err )
}
if headerLen > 0 {
u .Commands = make ([]BotCommand , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value BotCommand
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotCommands#4d712f2e: field commands: %w" , err )
}
u .Commands = append (u .Commands , value )
}
}
return nil
}
func (u *UpdateBotCommands ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotCommands ) GetBotID () (value int64 ) {
if u == nil {
return
}
return u .BotID
}
func (u *UpdateBotCommands ) GetCommands () (value []BotCommand ) {
if u == nil {
return
}
return u .Commands
}
type UpdatePendingJoinRequests struct {
Peer PeerClass
RequestsPending int
RecentRequesters []int64
}
const UpdatePendingJoinRequestsTypeID = 0x7063c3db
func (u UpdatePendingJoinRequests ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePendingJoinRequests {}
_ bin .Decoder = &UpdatePendingJoinRequests {}
_ bin .BareEncoder = &UpdatePendingJoinRequests {}
_ bin .BareDecoder = &UpdatePendingJoinRequests {}
_ UpdateClass = &UpdatePendingJoinRequests {}
)
func (u *UpdatePendingJoinRequests ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .RequestsPending == 0 ) {
return false
}
if !(u .RecentRequesters == nil ) {
return false
}
return true
}
func (u *UpdatePendingJoinRequests ) String () string {
if u == nil {
return "UpdatePendingJoinRequests(nil)"
}
type Alias UpdatePendingJoinRequests
return fmt .Sprintf ("UpdatePendingJoinRequests%+v" , Alias (*u ))
}
func (u *UpdatePendingJoinRequests ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetRequestsPending () (value int )
GetRecentRequesters () (value []int64 )
}) {
u .Peer = from .GetPeer ()
u .RequestsPending = from .GetRequestsPending ()
u .RecentRequesters = from .GetRecentRequesters ()
}
func (*UpdatePendingJoinRequests ) TypeID () uint32 {
return UpdatePendingJoinRequestsTypeID
}
func (*UpdatePendingJoinRequests ) TypeName () string {
return "updatePendingJoinRequests"
}
func (u *UpdatePendingJoinRequests ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePendingJoinRequests" ,
ID : UpdatePendingJoinRequestsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "RequestsPending" ,
SchemaName : "requests_pending" ,
},
{
Name : "RecentRequesters" ,
SchemaName : "recent_requesters" ,
},
}
return typ
}
func (u *UpdatePendingJoinRequests ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePendingJoinRequests#7063c3db as nil" )
}
b .PutID (UpdatePendingJoinRequestsTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePendingJoinRequests ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePendingJoinRequests#7063c3db as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePendingJoinRequests#7063c3db: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePendingJoinRequests#7063c3db: field peer: %w" , err )
}
b .PutInt (u .RequestsPending )
b .PutVectorHeader (len (u .RecentRequesters ))
for _ , v := range u .RecentRequesters {
b .PutLong (v )
}
return nil
}
func (u *UpdatePendingJoinRequests ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePendingJoinRequests#7063c3db to nil" )
}
if err := b .ConsumeID (UpdatePendingJoinRequestsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePendingJoinRequests#7063c3db: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePendingJoinRequests ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePendingJoinRequests#7063c3db to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePendingJoinRequests#7063c3db: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updatePendingJoinRequests#7063c3db: field requests_pending: %w" , err )
}
u .RequestsPending = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updatePendingJoinRequests#7063c3db: field recent_requesters: %w" , err )
}
if headerLen > 0 {
u .RecentRequesters = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updatePendingJoinRequests#7063c3db: field recent_requesters: %w" , err )
}
u .RecentRequesters = append (u .RecentRequesters , value )
}
}
return nil
}
func (u *UpdatePendingJoinRequests ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdatePendingJoinRequests ) GetRequestsPending () (value int ) {
if u == nil {
return
}
return u .RequestsPending
}
func (u *UpdatePendingJoinRequests ) GetRecentRequesters () (value []int64 ) {
if u == nil {
return
}
return u .RecentRequesters
}
type UpdateBotChatInviteRequester struct {
Peer PeerClass
Date int
UserID int64
About string
Invite ExportedChatInviteClass
Qts int
}
const UpdateBotChatInviteRequesterTypeID = 0x11dfa986
func (u UpdateBotChatInviteRequester ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotChatInviteRequester {}
_ bin .Decoder = &UpdateBotChatInviteRequester {}
_ bin .BareEncoder = &UpdateBotChatInviteRequester {}
_ bin .BareDecoder = &UpdateBotChatInviteRequester {}
_ UpdateClass = &UpdateBotChatInviteRequester {}
)
func (u *UpdateBotChatInviteRequester ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .UserID == 0 ) {
return false
}
if !(u .About == "" ) {
return false
}
if !(u .Invite == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotChatInviteRequester ) String () string {
if u == nil {
return "UpdateBotChatInviteRequester(nil)"
}
type Alias UpdateBotChatInviteRequester
return fmt .Sprintf ("UpdateBotChatInviteRequester%+v" , Alias (*u ))
}
func (u *UpdateBotChatInviteRequester ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetDate () (value int )
GetUserID () (value int64 )
GetAbout () (value string )
GetInvite () (value ExportedChatInviteClass )
GetQts () (value int )
}) {
u .Peer = from .GetPeer ()
u .Date = from .GetDate ()
u .UserID = from .GetUserID ()
u .About = from .GetAbout ()
u .Invite = from .GetInvite ()
u .Qts = from .GetQts ()
}
func (*UpdateBotChatInviteRequester ) TypeID () uint32 {
return UpdateBotChatInviteRequesterTypeID
}
func (*UpdateBotChatInviteRequester ) TypeName () string {
return "updateBotChatInviteRequester"
}
func (u *UpdateBotChatInviteRequester ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotChatInviteRequester" ,
ID : UpdateBotChatInviteRequesterTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "About" ,
SchemaName : "about" ,
},
{
Name : "Invite" ,
SchemaName : "invite" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotChatInviteRequester ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotChatInviteRequester#11dfa986 as nil" )
}
b .PutID (UpdateBotChatInviteRequesterTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotChatInviteRequester ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotChatInviteRequester#11dfa986 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotChatInviteRequester#11dfa986: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotChatInviteRequester#11dfa986: field peer: %w" , err )
}
b .PutInt (u .Date )
b .PutLong (u .UserID )
b .PutString (u .About )
if u .Invite == nil {
return fmt .Errorf ("unable to encode updateBotChatInviteRequester#11dfa986: field invite is nil" )
}
if err := u .Invite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotChatInviteRequester#11dfa986: field invite: %w" , err )
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotChatInviteRequester ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotChatInviteRequester#11dfa986 to nil" )
}
if err := b .ConsumeID (UpdateBotChatInviteRequesterTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotChatInviteRequester ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotChatInviteRequester#11dfa986 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field date: %w" , err )
}
u .Date = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field about: %w" , err )
}
u .About = value
}
{
value , err := DecodeExportedChatInvite (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field invite: %w" , err )
}
u .Invite = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatInviteRequester#11dfa986: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateBotChatInviteRequester ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotChatInviteRequester ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateBotChatInviteRequester ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateBotChatInviteRequester ) GetAbout () (value string ) {
if u == nil {
return
}
return u .About
}
func (u *UpdateBotChatInviteRequester ) GetInvite () (value ExportedChatInviteClass ) {
if u == nil {
return
}
return u .Invite
}
func (u *UpdateBotChatInviteRequester ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateMessageReactions struct {
Flags bin .Fields
Peer PeerClass
MsgID int
TopMsgID int
Reactions MessageReactions
}
const UpdateMessageReactionsTypeID = 0x5e1b3cb8
func (u UpdateMessageReactions ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessageReactions {}
_ bin .Decoder = &UpdateMessageReactions {}
_ bin .BareEncoder = &UpdateMessageReactions {}
_ bin .BareDecoder = &UpdateMessageReactions {}
_ UpdateClass = &UpdateMessageReactions {}
)
func (u *UpdateMessageReactions ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .TopMsgID == 0 ) {
return false
}
if !(u .Reactions .Zero ()) {
return false
}
return true
}
func (u *UpdateMessageReactions ) String () string {
if u == nil {
return "UpdateMessageReactions(nil)"
}
type Alias UpdateMessageReactions
return fmt .Sprintf ("UpdateMessageReactions%+v" , Alias (*u ))
}
func (u *UpdateMessageReactions ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetTopMsgID () (value int , ok bool )
GetReactions () (value MessageReactions )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
if val , ok := from .GetTopMsgID (); ok {
u .TopMsgID = val
}
u .Reactions = from .GetReactions ()
}
func (*UpdateMessageReactions ) TypeID () uint32 {
return UpdateMessageReactionsTypeID
}
func (*UpdateMessageReactions ) TypeName () string {
return "updateMessageReactions"
}
func (u *UpdateMessageReactions ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessageReactions" ,
ID : UpdateMessageReactionsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "TopMsgID" ,
SchemaName : "top_msg_id" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Reactions" ,
SchemaName : "reactions" ,
},
}
return typ
}
func (u *UpdateMessageReactions ) SetFlags () {
if !(u .TopMsgID == 0 ) {
u .Flags .Set (0 )
}
}
func (u *UpdateMessageReactions ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageReactions#5e1b3cb8 as nil" )
}
b .PutID (UpdateMessageReactionsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessageReactions ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageReactions#5e1b3cb8 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessageReactions#5e1b3cb8: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateMessageReactions#5e1b3cb8: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessageReactions#5e1b3cb8: field peer: %w" , err )
}
b .PutInt (u .MsgID )
if u .Flags .Has (0 ) {
b .PutInt (u .TopMsgID )
}
if err := u .Reactions .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessageReactions#5e1b3cb8: field reactions: %w" , err )
}
return nil
}
func (u *UpdateMessageReactions ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageReactions#5e1b3cb8 to nil" )
}
if err := b .ConsumeID (UpdateMessageReactionsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessageReactions ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageReactions#5e1b3cb8 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: field flags: %w" , err )
}
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: field msg_id: %w" , err )
}
u .MsgID = value
}
if u .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: field top_msg_id: %w" , err )
}
u .TopMsgID = value
}
{
if err := u .Reactions .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMessageReactions#5e1b3cb8: field reactions: %w" , err )
}
}
return nil
}
func (u *UpdateMessageReactions ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateMessageReactions ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateMessageReactions ) SetTopMsgID (value int ) {
u .Flags .Set (0 )
u .TopMsgID = value
}
func (u *UpdateMessageReactions ) GetTopMsgID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .TopMsgID , true
}
func (u *UpdateMessageReactions ) GetReactions () (value MessageReactions ) {
if u == nil {
return
}
return u .Reactions
}
type UpdateAttachMenuBots struct {
}
const UpdateAttachMenuBotsTypeID = 0x17b7a20b
func (u UpdateAttachMenuBots ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateAttachMenuBots {}
_ bin .Decoder = &UpdateAttachMenuBots {}
_ bin .BareEncoder = &UpdateAttachMenuBots {}
_ bin .BareDecoder = &UpdateAttachMenuBots {}
_ UpdateClass = &UpdateAttachMenuBots {}
)
func (u *UpdateAttachMenuBots ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateAttachMenuBots ) String () string {
if u == nil {
return "UpdateAttachMenuBots(nil)"
}
type Alias UpdateAttachMenuBots
return fmt .Sprintf ("UpdateAttachMenuBots%+v" , Alias (*u ))
}
func (*UpdateAttachMenuBots ) TypeID () uint32 {
return UpdateAttachMenuBotsTypeID
}
func (*UpdateAttachMenuBots ) TypeName () string {
return "updateAttachMenuBots"
}
func (u *UpdateAttachMenuBots ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateAttachMenuBots" ,
ID : UpdateAttachMenuBotsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateAttachMenuBots ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateAttachMenuBots#17b7a20b as nil" )
}
b .PutID (UpdateAttachMenuBotsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateAttachMenuBots ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateAttachMenuBots#17b7a20b as nil" )
}
return nil
}
func (u *UpdateAttachMenuBots ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateAttachMenuBots#17b7a20b to nil" )
}
if err := b .ConsumeID (UpdateAttachMenuBotsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateAttachMenuBots#17b7a20b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateAttachMenuBots ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateAttachMenuBots#17b7a20b to nil" )
}
return nil
}
type UpdateWebViewResultSent struct {
QueryID int64
}
const UpdateWebViewResultSentTypeID = 0x1592b79d
func (u UpdateWebViewResultSent ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateWebViewResultSent {}
_ bin .Decoder = &UpdateWebViewResultSent {}
_ bin .BareEncoder = &UpdateWebViewResultSent {}
_ bin .BareDecoder = &UpdateWebViewResultSent {}
_ UpdateClass = &UpdateWebViewResultSent {}
)
func (u *UpdateWebViewResultSent ) Zero () bool {
if u == nil {
return true
}
if !(u .QueryID == 0 ) {
return false
}
return true
}
func (u *UpdateWebViewResultSent ) String () string {
if u == nil {
return "UpdateWebViewResultSent(nil)"
}
type Alias UpdateWebViewResultSent
return fmt .Sprintf ("UpdateWebViewResultSent%+v" , Alias (*u ))
}
func (u *UpdateWebViewResultSent ) FillFrom (from interface {
GetQueryID () (value int64 )
}) {
u .QueryID = from .GetQueryID ()
}
func (*UpdateWebViewResultSent ) TypeID () uint32 {
return UpdateWebViewResultSentTypeID
}
func (*UpdateWebViewResultSent ) TypeName () string {
return "updateWebViewResultSent"
}
func (u *UpdateWebViewResultSent ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateWebViewResultSent" ,
ID : UpdateWebViewResultSentTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
}
return typ
}
func (u *UpdateWebViewResultSent ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebViewResultSent#1592b79d as nil" )
}
b .PutID (UpdateWebViewResultSentTypeID )
return u .EncodeBare (b )
}
func (u *UpdateWebViewResultSent ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateWebViewResultSent#1592b79d as nil" )
}
b .PutLong (u .QueryID )
return nil
}
func (u *UpdateWebViewResultSent ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebViewResultSent#1592b79d to nil" )
}
if err := b .ConsumeID (UpdateWebViewResultSentTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateWebViewResultSent#1592b79d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateWebViewResultSent ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateWebViewResultSent#1592b79d to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateWebViewResultSent#1592b79d: field query_id: %w" , err )
}
u .QueryID = value
}
return nil
}
func (u *UpdateWebViewResultSent ) GetQueryID () (value int64 ) {
if u == nil {
return
}
return u .QueryID
}
type UpdateBotMenuButton struct {
BotID int64
Button BotMenuButtonClass
}
const UpdateBotMenuButtonTypeID = 0x14b85813
func (u UpdateBotMenuButton ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotMenuButton {}
_ bin .Decoder = &UpdateBotMenuButton {}
_ bin .BareEncoder = &UpdateBotMenuButton {}
_ bin .BareDecoder = &UpdateBotMenuButton {}
_ UpdateClass = &UpdateBotMenuButton {}
)
func (u *UpdateBotMenuButton ) Zero () bool {
if u == nil {
return true
}
if !(u .BotID == 0 ) {
return false
}
if !(u .Button == nil ) {
return false
}
return true
}
func (u *UpdateBotMenuButton ) String () string {
if u == nil {
return "UpdateBotMenuButton(nil)"
}
type Alias UpdateBotMenuButton
return fmt .Sprintf ("UpdateBotMenuButton%+v" , Alias (*u ))
}
func (u *UpdateBotMenuButton ) FillFrom (from interface {
GetBotID () (value int64 )
GetButton () (value BotMenuButtonClass )
}) {
u .BotID = from .GetBotID ()
u .Button = from .GetButton ()
}
func (*UpdateBotMenuButton ) TypeID () uint32 {
return UpdateBotMenuButtonTypeID
}
func (*UpdateBotMenuButton ) TypeName () string {
return "updateBotMenuButton"
}
func (u *UpdateBotMenuButton ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotMenuButton" ,
ID : UpdateBotMenuButtonTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "BotID" ,
SchemaName : "bot_id" ,
},
{
Name : "Button" ,
SchemaName : "button" ,
},
}
return typ
}
func (u *UpdateBotMenuButton ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMenuButton#14b85813 as nil" )
}
b .PutID (UpdateBotMenuButtonTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotMenuButton ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMenuButton#14b85813 as nil" )
}
b .PutLong (u .BotID )
if u .Button == nil {
return fmt .Errorf ("unable to encode updateBotMenuButton#14b85813: field button is nil" )
}
if err := u .Button .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMenuButton#14b85813: field button: %w" , err )
}
return nil
}
func (u *UpdateBotMenuButton ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMenuButton#14b85813 to nil" )
}
if err := b .ConsumeID (UpdateBotMenuButtonTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotMenuButton#14b85813: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotMenuButton ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMenuButton#14b85813 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMenuButton#14b85813: field bot_id: %w" , err )
}
u .BotID = value
}
{
value , err := DecodeBotMenuButton (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMenuButton#14b85813: field button: %w" , err )
}
u .Button = value
}
return nil
}
func (u *UpdateBotMenuButton ) GetBotID () (value int64 ) {
if u == nil {
return
}
return u .BotID
}
func (u *UpdateBotMenuButton ) GetButton () (value BotMenuButtonClass ) {
if u == nil {
return
}
return u .Button
}
type UpdateSavedRingtones struct {
}
const UpdateSavedRingtonesTypeID = 0x74d8be99
func (u UpdateSavedRingtones ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateSavedRingtones {}
_ bin .Decoder = &UpdateSavedRingtones {}
_ bin .BareEncoder = &UpdateSavedRingtones {}
_ bin .BareDecoder = &UpdateSavedRingtones {}
_ UpdateClass = &UpdateSavedRingtones {}
)
func (u *UpdateSavedRingtones ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateSavedRingtones ) String () string {
if u == nil {
return "UpdateSavedRingtones(nil)"
}
type Alias UpdateSavedRingtones
return fmt .Sprintf ("UpdateSavedRingtones%+v" , Alias (*u ))
}
func (*UpdateSavedRingtones ) TypeID () uint32 {
return UpdateSavedRingtonesTypeID
}
func (*UpdateSavedRingtones ) TypeName () string {
return "updateSavedRingtones"
}
func (u *UpdateSavedRingtones ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateSavedRingtones" ,
ID : UpdateSavedRingtonesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateSavedRingtones ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedRingtones#74d8be99 as nil" )
}
b .PutID (UpdateSavedRingtonesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateSavedRingtones ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSavedRingtones#74d8be99 as nil" )
}
return nil
}
func (u *UpdateSavedRingtones ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedRingtones#74d8be99 to nil" )
}
if err := b .ConsumeID (UpdateSavedRingtonesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateSavedRingtones#74d8be99: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateSavedRingtones ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSavedRingtones#74d8be99 to nil" )
}
return nil
}
type UpdateTranscribedAudio struct {
Flags bin .Fields
Pending bool
Peer PeerClass
MsgID int
TranscriptionID int64
Text string
}
const UpdateTranscribedAudioTypeID = 0x84cd5a
func (u UpdateTranscribedAudio ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateTranscribedAudio {}
_ bin .Decoder = &UpdateTranscribedAudio {}
_ bin .BareEncoder = &UpdateTranscribedAudio {}
_ bin .BareDecoder = &UpdateTranscribedAudio {}
_ UpdateClass = &UpdateTranscribedAudio {}
)
func (u *UpdateTranscribedAudio ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pending == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .TranscriptionID == 0 ) {
return false
}
if !(u .Text == "" ) {
return false
}
return true
}
func (u *UpdateTranscribedAudio ) String () string {
if u == nil {
return "UpdateTranscribedAudio(nil)"
}
type Alias UpdateTranscribedAudio
return fmt .Sprintf ("UpdateTranscribedAudio%+v" , Alias (*u ))
}
func (u *UpdateTranscribedAudio ) FillFrom (from interface {
GetPending () (value bool )
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetTranscriptionID () (value int64 )
GetText () (value string )
}) {
u .Pending = from .GetPending ()
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .TranscriptionID = from .GetTranscriptionID ()
u .Text = from .GetText ()
}
func (*UpdateTranscribedAudio ) TypeID () uint32 {
return UpdateTranscribedAudioTypeID
}
func (*UpdateTranscribedAudio ) TypeName () string {
return "updateTranscribedAudio"
}
func (u *UpdateTranscribedAudio ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateTranscribedAudio" ,
ID : UpdateTranscribedAudioTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pending" ,
SchemaName : "pending" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "TranscriptionID" ,
SchemaName : "transcription_id" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (u *UpdateTranscribedAudio ) SetFlags () {
if !(u .Pending == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdateTranscribedAudio ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTranscribedAudio#84cd5a as nil" )
}
b .PutID (UpdateTranscribedAudioTypeID )
return u .EncodeBare (b )
}
func (u *UpdateTranscribedAudio ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateTranscribedAudio#84cd5a as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateTranscribedAudio#84cd5a: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateTranscribedAudio#84cd5a: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateTranscribedAudio#84cd5a: field peer: %w" , err )
}
b .PutInt (u .MsgID )
b .PutLong (u .TranscriptionID )
b .PutString (u .Text )
return nil
}
func (u *UpdateTranscribedAudio ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTranscribedAudio#84cd5a to nil" )
}
if err := b .ConsumeID (UpdateTranscribedAudioTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateTranscribedAudio ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateTranscribedAudio#84cd5a to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: field flags: %w" , err )
}
}
u .Pending = u .Flags .Has (0 )
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: field transcription_id: %w" , err )
}
u .TranscriptionID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode updateTranscribedAudio#84cd5a: field text: %w" , err )
}
u .Text = value
}
return nil
}
func (u *UpdateTranscribedAudio ) SetPending (value bool ) {
if value {
u .Flags .Set (0 )
u .Pending = true
} else {
u .Flags .Unset (0 )
u .Pending = false
}
}
func (u *UpdateTranscribedAudio ) GetPending () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateTranscribedAudio ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateTranscribedAudio ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateTranscribedAudio ) GetTranscriptionID () (value int64 ) {
if u == nil {
return
}
return u .TranscriptionID
}
func (u *UpdateTranscribedAudio ) GetText () (value string ) {
if u == nil {
return
}
return u .Text
}
type UpdateReadFeaturedEmojiStickers struct {
}
const UpdateReadFeaturedEmojiStickersTypeID = 0xfb4c496c
func (u UpdateReadFeaturedEmojiStickers ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadFeaturedEmojiStickers {}
_ bin .Decoder = &UpdateReadFeaturedEmojiStickers {}
_ bin .BareEncoder = &UpdateReadFeaturedEmojiStickers {}
_ bin .BareDecoder = &UpdateReadFeaturedEmojiStickers {}
_ UpdateClass = &UpdateReadFeaturedEmojiStickers {}
)
func (u *UpdateReadFeaturedEmojiStickers ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateReadFeaturedEmojiStickers ) String () string {
if u == nil {
return "UpdateReadFeaturedEmojiStickers(nil)"
}
type Alias UpdateReadFeaturedEmojiStickers
return fmt .Sprintf ("UpdateReadFeaturedEmojiStickers%+v" , Alias (*u ))
}
func (*UpdateReadFeaturedEmojiStickers ) TypeID () uint32 {
return UpdateReadFeaturedEmojiStickersTypeID
}
func (*UpdateReadFeaturedEmojiStickers ) TypeName () string {
return "updateReadFeaturedEmojiStickers"
}
func (u *UpdateReadFeaturedEmojiStickers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadFeaturedEmojiStickers" ,
ID : UpdateReadFeaturedEmojiStickersTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateReadFeaturedEmojiStickers ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedEmojiStickers#fb4c496c as nil" )
}
b .PutID (UpdateReadFeaturedEmojiStickersTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadFeaturedEmojiStickers ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadFeaturedEmojiStickers#fb4c496c as nil" )
}
return nil
}
func (u *UpdateReadFeaturedEmojiStickers ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedEmojiStickers#fb4c496c to nil" )
}
if err := b .ConsumeID (UpdateReadFeaturedEmojiStickersTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadFeaturedEmojiStickers#fb4c496c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadFeaturedEmojiStickers ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadFeaturedEmojiStickers#fb4c496c to nil" )
}
return nil
}
type UpdateUserEmojiStatus struct {
UserID int64
EmojiStatus EmojiStatusClass
}
const UpdateUserEmojiStatusTypeID = 0x28373599
func (u UpdateUserEmojiStatus ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUserEmojiStatus {}
_ bin .Decoder = &UpdateUserEmojiStatus {}
_ bin .BareEncoder = &UpdateUserEmojiStatus {}
_ bin .BareDecoder = &UpdateUserEmojiStatus {}
_ UpdateClass = &UpdateUserEmojiStatus {}
)
func (u *UpdateUserEmojiStatus ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
if !(u .EmojiStatus == nil ) {
return false
}
return true
}
func (u *UpdateUserEmojiStatus ) String () string {
if u == nil {
return "UpdateUserEmojiStatus(nil)"
}
type Alias UpdateUserEmojiStatus
return fmt .Sprintf ("UpdateUserEmojiStatus%+v" , Alias (*u ))
}
func (u *UpdateUserEmojiStatus ) FillFrom (from interface {
GetUserID () (value int64 )
GetEmojiStatus () (value EmojiStatusClass )
}) {
u .UserID = from .GetUserID ()
u .EmojiStatus = from .GetEmojiStatus ()
}
func (*UpdateUserEmojiStatus ) TypeID () uint32 {
return UpdateUserEmojiStatusTypeID
}
func (*UpdateUserEmojiStatus ) TypeName () string {
return "updateUserEmojiStatus"
}
func (u *UpdateUserEmojiStatus ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUserEmojiStatus" ,
ID : UpdateUserEmojiStatusTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "EmojiStatus" ,
SchemaName : "emoji_status" ,
},
}
return typ
}
func (u *UpdateUserEmojiStatus ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserEmojiStatus#28373599 as nil" )
}
b .PutID (UpdateUserEmojiStatusTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUserEmojiStatus ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUserEmojiStatus#28373599 as nil" )
}
b .PutLong (u .UserID )
if u .EmojiStatus == nil {
return fmt .Errorf ("unable to encode updateUserEmojiStatus#28373599: field emoji_status is nil" )
}
if err := u .EmojiStatus .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateUserEmojiStatus#28373599: field emoji_status: %w" , err )
}
return nil
}
func (u *UpdateUserEmojiStatus ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserEmojiStatus#28373599 to nil" )
}
if err := b .ConsumeID (UpdateUserEmojiStatusTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUserEmojiStatus#28373599: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUserEmojiStatus ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUserEmojiStatus#28373599 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUserEmojiStatus#28373599: field user_id: %w" , err )
}
u .UserID = value
}
{
value , err := DecodeEmojiStatus (b )
if err != nil {
return fmt .Errorf ("unable to decode updateUserEmojiStatus#28373599: field emoji_status: %w" , err )
}
u .EmojiStatus = value
}
return nil
}
func (u *UpdateUserEmojiStatus ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
func (u *UpdateUserEmojiStatus ) GetEmojiStatus () (value EmojiStatusClass ) {
if u == nil {
return
}
return u .EmojiStatus
}
type UpdateRecentEmojiStatuses struct {
}
const UpdateRecentEmojiStatusesTypeID = 0x30f443db
func (u UpdateRecentEmojiStatuses ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateRecentEmojiStatuses {}
_ bin .Decoder = &UpdateRecentEmojiStatuses {}
_ bin .BareEncoder = &UpdateRecentEmojiStatuses {}
_ bin .BareDecoder = &UpdateRecentEmojiStatuses {}
_ UpdateClass = &UpdateRecentEmojiStatuses {}
)
func (u *UpdateRecentEmojiStatuses ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateRecentEmojiStatuses ) String () string {
if u == nil {
return "UpdateRecentEmojiStatuses(nil)"
}
type Alias UpdateRecentEmojiStatuses
return fmt .Sprintf ("UpdateRecentEmojiStatuses%+v" , Alias (*u ))
}
func (*UpdateRecentEmojiStatuses ) TypeID () uint32 {
return UpdateRecentEmojiStatusesTypeID
}
func (*UpdateRecentEmojiStatuses ) TypeName () string {
return "updateRecentEmojiStatuses"
}
func (u *UpdateRecentEmojiStatuses ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateRecentEmojiStatuses" ,
ID : UpdateRecentEmojiStatusesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateRecentEmojiStatuses ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentEmojiStatuses#30f443db as nil" )
}
b .PutID (UpdateRecentEmojiStatusesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateRecentEmojiStatuses ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentEmojiStatuses#30f443db as nil" )
}
return nil
}
func (u *UpdateRecentEmojiStatuses ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentEmojiStatuses#30f443db to nil" )
}
if err := b .ConsumeID (UpdateRecentEmojiStatusesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateRecentEmojiStatuses#30f443db: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateRecentEmojiStatuses ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentEmojiStatuses#30f443db to nil" )
}
return nil
}
type UpdateRecentReactions struct {
}
const UpdateRecentReactionsTypeID = 0x6f7863f4
func (u UpdateRecentReactions ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateRecentReactions {}
_ bin .Decoder = &UpdateRecentReactions {}
_ bin .BareEncoder = &UpdateRecentReactions {}
_ bin .BareDecoder = &UpdateRecentReactions {}
_ UpdateClass = &UpdateRecentReactions {}
)
func (u *UpdateRecentReactions ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateRecentReactions ) String () string {
if u == nil {
return "UpdateRecentReactions(nil)"
}
type Alias UpdateRecentReactions
return fmt .Sprintf ("UpdateRecentReactions%+v" , Alias (*u ))
}
func (*UpdateRecentReactions ) TypeID () uint32 {
return UpdateRecentReactionsTypeID
}
func (*UpdateRecentReactions ) TypeName () string {
return "updateRecentReactions"
}
func (u *UpdateRecentReactions ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateRecentReactions" ,
ID : UpdateRecentReactionsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateRecentReactions ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentReactions#6f7863f4 as nil" )
}
b .PutID (UpdateRecentReactionsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateRecentReactions ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateRecentReactions#6f7863f4 as nil" )
}
return nil
}
func (u *UpdateRecentReactions ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentReactions#6f7863f4 to nil" )
}
if err := b .ConsumeID (UpdateRecentReactionsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateRecentReactions#6f7863f4: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateRecentReactions ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateRecentReactions#6f7863f4 to nil" )
}
return nil
}
type UpdateMoveStickerSetToTop struct {
Flags bin .Fields
Masks bool
Emojis bool
Stickerset int64
}
const UpdateMoveStickerSetToTopTypeID = 0x86fccf85
func (u UpdateMoveStickerSetToTop ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMoveStickerSetToTop {}
_ bin .Decoder = &UpdateMoveStickerSetToTop {}
_ bin .BareEncoder = &UpdateMoveStickerSetToTop {}
_ bin .BareDecoder = &UpdateMoveStickerSetToTop {}
_ UpdateClass = &UpdateMoveStickerSetToTop {}
)
func (u *UpdateMoveStickerSetToTop ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Masks == false ) {
return false
}
if !(u .Emojis == false ) {
return false
}
if !(u .Stickerset == 0 ) {
return false
}
return true
}
func (u *UpdateMoveStickerSetToTop ) String () string {
if u == nil {
return "UpdateMoveStickerSetToTop(nil)"
}
type Alias UpdateMoveStickerSetToTop
return fmt .Sprintf ("UpdateMoveStickerSetToTop%+v" , Alias (*u ))
}
func (u *UpdateMoveStickerSetToTop ) FillFrom (from interface {
GetMasks () (value bool )
GetEmojis () (value bool )
GetStickerset () (value int64 )
}) {
u .Masks = from .GetMasks ()
u .Emojis = from .GetEmojis ()
u .Stickerset = from .GetStickerset ()
}
func (*UpdateMoveStickerSetToTop ) TypeID () uint32 {
return UpdateMoveStickerSetToTopTypeID
}
func (*UpdateMoveStickerSetToTop ) TypeName () string {
return "updateMoveStickerSetToTop"
}
func (u *UpdateMoveStickerSetToTop ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMoveStickerSetToTop" ,
ID : UpdateMoveStickerSetToTopTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Masks" ,
SchemaName : "masks" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "Emojis" ,
SchemaName : "emojis" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
}
return typ
}
func (u *UpdateMoveStickerSetToTop ) SetFlags () {
if !(u .Masks == false ) {
u .Flags .Set (0 )
}
if !(u .Emojis == false ) {
u .Flags .Set (1 )
}
}
func (u *UpdateMoveStickerSetToTop ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMoveStickerSetToTop#86fccf85 as nil" )
}
b .PutID (UpdateMoveStickerSetToTopTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMoveStickerSetToTop ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMoveStickerSetToTop#86fccf85 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMoveStickerSetToTop#86fccf85: field flags: %w" , err )
}
b .PutLong (u .Stickerset )
return nil
}
func (u *UpdateMoveStickerSetToTop ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMoveStickerSetToTop#86fccf85 to nil" )
}
if err := b .ConsumeID (UpdateMoveStickerSetToTopTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMoveStickerSetToTop#86fccf85: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMoveStickerSetToTop ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMoveStickerSetToTop#86fccf85 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateMoveStickerSetToTop#86fccf85: field flags: %w" , err )
}
}
u .Masks = u .Flags .Has (0 )
u .Emojis = u .Flags .Has (1 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateMoveStickerSetToTop#86fccf85: field stickerset: %w" , err )
}
u .Stickerset = value
}
return nil
}
func (u *UpdateMoveStickerSetToTop ) SetMasks (value bool ) {
if value {
u .Flags .Set (0 )
u .Masks = true
} else {
u .Flags .Unset (0 )
u .Masks = false
}
}
func (u *UpdateMoveStickerSetToTop ) GetMasks () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateMoveStickerSetToTop ) SetEmojis (value bool ) {
if value {
u .Flags .Set (1 )
u .Emojis = true
} else {
u .Flags .Unset (1 )
u .Emojis = false
}
}
func (u *UpdateMoveStickerSetToTop ) GetEmojis () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (1 )
}
func (u *UpdateMoveStickerSetToTop ) GetStickerset () (value int64 ) {
if u == nil {
return
}
return u .Stickerset
}
type UpdateMessageExtendedMedia struct {
Peer PeerClass
MsgID int
ExtendedMedia MessageExtendedMediaClass
}
const UpdateMessageExtendedMediaTypeID = 0x5a73a98c
func (u UpdateMessageExtendedMedia ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateMessageExtendedMedia {}
_ bin .Decoder = &UpdateMessageExtendedMedia {}
_ bin .BareEncoder = &UpdateMessageExtendedMedia {}
_ bin .BareDecoder = &UpdateMessageExtendedMedia {}
_ UpdateClass = &UpdateMessageExtendedMedia {}
)
func (u *UpdateMessageExtendedMedia ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .ExtendedMedia == nil ) {
return false
}
return true
}
func (u *UpdateMessageExtendedMedia ) String () string {
if u == nil {
return "UpdateMessageExtendedMedia(nil)"
}
type Alias UpdateMessageExtendedMedia
return fmt .Sprintf ("UpdateMessageExtendedMedia%+v" , Alias (*u ))
}
func (u *UpdateMessageExtendedMedia ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetExtendedMedia () (value MessageExtendedMediaClass )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .ExtendedMedia = from .GetExtendedMedia ()
}
func (*UpdateMessageExtendedMedia ) TypeID () uint32 {
return UpdateMessageExtendedMediaTypeID
}
func (*UpdateMessageExtendedMedia ) TypeName () string {
return "updateMessageExtendedMedia"
}
func (u *UpdateMessageExtendedMedia ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateMessageExtendedMedia" ,
ID : UpdateMessageExtendedMediaTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ExtendedMedia" ,
SchemaName : "extended_media" ,
},
}
return typ
}
func (u *UpdateMessageExtendedMedia ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageExtendedMedia#5a73a98c as nil" )
}
b .PutID (UpdateMessageExtendedMediaTypeID )
return u .EncodeBare (b )
}
func (u *UpdateMessageExtendedMedia ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateMessageExtendedMedia#5a73a98c as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateMessageExtendedMedia#5a73a98c: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessageExtendedMedia#5a73a98c: field peer: %w" , err )
}
b .PutInt (u .MsgID )
if u .ExtendedMedia == nil {
return fmt .Errorf ("unable to encode updateMessageExtendedMedia#5a73a98c: field extended_media is nil" )
}
if err := u .ExtendedMedia .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateMessageExtendedMedia#5a73a98c: field extended_media: %w" , err )
}
return nil
}
func (u *UpdateMessageExtendedMedia ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageExtendedMedia#5a73a98c to nil" )
}
if err := b .ConsumeID (UpdateMessageExtendedMediaTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateMessageExtendedMedia#5a73a98c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateMessageExtendedMedia ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateMessageExtendedMedia#5a73a98c to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateMessageExtendedMedia#5a73a98c: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateMessageExtendedMedia#5a73a98c: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := DecodeMessageExtendedMedia (b )
if err != nil {
return fmt .Errorf ("unable to decode updateMessageExtendedMedia#5a73a98c: field extended_media: %w" , err )
}
u .ExtendedMedia = value
}
return nil
}
func (u *UpdateMessageExtendedMedia ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateMessageExtendedMedia ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateMessageExtendedMedia ) GetExtendedMedia () (value MessageExtendedMediaClass ) {
if u == nil {
return
}
return u .ExtendedMedia
}
type UpdateChannelPinnedTopic struct {
Flags bin .Fields
Pinned bool
ChannelID int64
TopicID int
}
const UpdateChannelPinnedTopicTypeID = 0x192efbe3
func (u UpdateChannelPinnedTopic ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelPinnedTopic {}
_ bin .Decoder = &UpdateChannelPinnedTopic {}
_ bin .BareEncoder = &UpdateChannelPinnedTopic {}
_ bin .BareDecoder = &UpdateChannelPinnedTopic {}
_ UpdateClass = &UpdateChannelPinnedTopic {}
)
func (u *UpdateChannelPinnedTopic ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Pinned == false ) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .TopicID == 0 ) {
return false
}
return true
}
func (u *UpdateChannelPinnedTopic ) String () string {
if u == nil {
return "UpdateChannelPinnedTopic(nil)"
}
type Alias UpdateChannelPinnedTopic
return fmt .Sprintf ("UpdateChannelPinnedTopic%+v" , Alias (*u ))
}
func (u *UpdateChannelPinnedTopic ) FillFrom (from interface {
GetPinned () (value bool )
GetChannelID () (value int64 )
GetTopicID () (value int )
}) {
u .Pinned = from .GetPinned ()
u .ChannelID = from .GetChannelID ()
u .TopicID = from .GetTopicID ()
}
func (*UpdateChannelPinnedTopic ) TypeID () uint32 {
return UpdateChannelPinnedTopicTypeID
}
func (*UpdateChannelPinnedTopic ) TypeName () string {
return "updateChannelPinnedTopic"
}
func (u *UpdateChannelPinnedTopic ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelPinnedTopic" ,
ID : UpdateChannelPinnedTopicTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pinned" ,
SchemaName : "pinned" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "TopicID" ,
SchemaName : "topic_id" ,
},
}
return typ
}
func (u *UpdateChannelPinnedTopic ) SetFlags () {
if !(u .Pinned == false ) {
u .Flags .Set (0 )
}
}
func (u *UpdateChannelPinnedTopic ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelPinnedTopic#192efbe3 as nil" )
}
b .PutID (UpdateChannelPinnedTopicTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelPinnedTopic ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelPinnedTopic#192efbe3 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelPinnedTopic#192efbe3: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
b .PutInt (u .TopicID )
return nil
}
func (u *UpdateChannelPinnedTopic ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelPinnedTopic#192efbe3 to nil" )
}
if err := b .ConsumeID (UpdateChannelPinnedTopicTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopic#192efbe3: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelPinnedTopic ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelPinnedTopic#192efbe3 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopic#192efbe3: field flags: %w" , err )
}
}
u .Pinned = u .Flags .Has (0 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopic#192efbe3: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopic#192efbe3: field topic_id: %w" , err )
}
u .TopicID = value
}
return nil
}
func (u *UpdateChannelPinnedTopic ) SetPinned (value bool ) {
if value {
u .Flags .Set (0 )
u .Pinned = true
} else {
u .Flags .Unset (0 )
u .Pinned = false
}
}
func (u *UpdateChannelPinnedTopic ) GetPinned () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UpdateChannelPinnedTopic ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelPinnedTopic ) GetTopicID () (value int ) {
if u == nil {
return
}
return u .TopicID
}
type UpdateChannelPinnedTopics struct {
Flags bin .Fields
ChannelID int64
Order []int
}
const UpdateChannelPinnedTopicsTypeID = 0xfe198602
func (u UpdateChannelPinnedTopics ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelPinnedTopics {}
_ bin .Decoder = &UpdateChannelPinnedTopics {}
_ bin .BareEncoder = &UpdateChannelPinnedTopics {}
_ bin .BareDecoder = &UpdateChannelPinnedTopics {}
_ UpdateClass = &UpdateChannelPinnedTopics {}
)
func (u *UpdateChannelPinnedTopics ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Order == nil ) {
return false
}
return true
}
func (u *UpdateChannelPinnedTopics ) String () string {
if u == nil {
return "UpdateChannelPinnedTopics(nil)"
}
type Alias UpdateChannelPinnedTopics
return fmt .Sprintf ("UpdateChannelPinnedTopics%+v" , Alias (*u ))
}
func (u *UpdateChannelPinnedTopics ) FillFrom (from interface {
GetChannelID () (value int64 )
GetOrder () (value []int , ok bool )
}) {
u .ChannelID = from .GetChannelID ()
if val , ok := from .GetOrder (); ok {
u .Order = val
}
}
func (*UpdateChannelPinnedTopics ) TypeID () uint32 {
return UpdateChannelPinnedTopicsTypeID
}
func (*UpdateChannelPinnedTopics ) TypeName () string {
return "updateChannelPinnedTopics"
}
func (u *UpdateChannelPinnedTopics ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelPinnedTopics" ,
ID : UpdateChannelPinnedTopicsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Order" ,
SchemaName : "order" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdateChannelPinnedTopics ) SetFlags () {
if !(u .Order == nil ) {
u .Flags .Set (0 )
}
}
func (u *UpdateChannelPinnedTopics ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelPinnedTopics#fe198602 as nil" )
}
b .PutID (UpdateChannelPinnedTopicsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelPinnedTopics ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelPinnedTopics#fe198602 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateChannelPinnedTopics#fe198602: field flags: %w" , err )
}
b .PutLong (u .ChannelID )
if u .Flags .Has (0 ) {
b .PutVectorHeader (len (u .Order ))
for _ , v := range u .Order {
b .PutInt (v )
}
}
return nil
}
func (u *UpdateChannelPinnedTopics ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelPinnedTopics#fe198602 to nil" )
}
if err := b .ConsumeID (UpdateChannelPinnedTopicsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopics#fe198602: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelPinnedTopics ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelPinnedTopics#fe198602 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopics#fe198602: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopics#fe198602: field channel_id: %w" , err )
}
u .ChannelID = value
}
if u .Flags .Has (0 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopics#fe198602: field order: %w" , err )
}
if headerLen > 0 {
u .Order = make ([]int , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelPinnedTopics#fe198602: field order: %w" , err )
}
u .Order = append (u .Order , value )
}
}
return nil
}
func (u *UpdateChannelPinnedTopics ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelPinnedTopics ) SetOrder (value []int ) {
u .Flags .Set (0 )
u .Order = value
}
func (u *UpdateChannelPinnedTopics ) GetOrder () (value []int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Order , true
}
type UpdateUser struct {
UserID int64
}
const UpdateUserTypeID = 0x20529438
func (u UpdateUser ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateUser {}
_ bin .Decoder = &UpdateUser {}
_ bin .BareEncoder = &UpdateUser {}
_ bin .BareDecoder = &UpdateUser {}
_ UpdateClass = &UpdateUser {}
)
func (u *UpdateUser ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
return true
}
func (u *UpdateUser ) String () string {
if u == nil {
return "UpdateUser(nil)"
}
type Alias UpdateUser
return fmt .Sprintf ("UpdateUser%+v" , Alias (*u ))
}
func (u *UpdateUser ) FillFrom (from interface {
GetUserID () (value int64 )
}) {
u .UserID = from .GetUserID ()
}
func (*UpdateUser ) TypeID () uint32 {
return UpdateUserTypeID
}
func (*UpdateUser ) TypeName () string {
return "updateUser"
}
func (u *UpdateUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateUser" ,
ID : UpdateUserTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (u *UpdateUser ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUser#20529438 as nil" )
}
b .PutID (UpdateUserTypeID )
return u .EncodeBare (b )
}
func (u *UpdateUser ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateUser#20529438 as nil" )
}
b .PutLong (u .UserID )
return nil
}
func (u *UpdateUser ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUser#20529438 to nil" )
}
if err := b .ConsumeID (UpdateUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateUser#20529438: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateUser ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateUser#20529438 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateUser#20529438: field user_id: %w" , err )
}
u .UserID = value
}
return nil
}
func (u *UpdateUser ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
type UpdateAutoSaveSettings struct {
}
const UpdateAutoSaveSettingsTypeID = 0xec05b097
func (u UpdateAutoSaveSettings ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateAutoSaveSettings {}
_ bin .Decoder = &UpdateAutoSaveSettings {}
_ bin .BareEncoder = &UpdateAutoSaveSettings {}
_ bin .BareDecoder = &UpdateAutoSaveSettings {}
_ UpdateClass = &UpdateAutoSaveSettings {}
)
func (u *UpdateAutoSaveSettings ) Zero () bool {
if u == nil {
return true
}
return true
}
func (u *UpdateAutoSaveSettings ) String () string {
if u == nil {
return "UpdateAutoSaveSettings(nil)"
}
type Alias UpdateAutoSaveSettings
return fmt .Sprintf ("UpdateAutoSaveSettings%+v" , Alias (*u ))
}
func (*UpdateAutoSaveSettings ) TypeID () uint32 {
return UpdateAutoSaveSettingsTypeID
}
func (*UpdateAutoSaveSettings ) TypeName () string {
return "updateAutoSaveSettings"
}
func (u *UpdateAutoSaveSettings ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateAutoSaveSettings" ,
ID : UpdateAutoSaveSettingsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (u *UpdateAutoSaveSettings ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateAutoSaveSettings#ec05b097 as nil" )
}
b .PutID (UpdateAutoSaveSettingsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateAutoSaveSettings ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateAutoSaveSettings#ec05b097 as nil" )
}
return nil
}
func (u *UpdateAutoSaveSettings ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateAutoSaveSettings#ec05b097 to nil" )
}
if err := b .ConsumeID (UpdateAutoSaveSettingsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateAutoSaveSettings#ec05b097: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateAutoSaveSettings ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateAutoSaveSettings#ec05b097 to nil" )
}
return nil
}
type UpdateGroupInvitePrivacyForbidden struct {
UserID int64
}
const UpdateGroupInvitePrivacyForbiddenTypeID = 0xccf08ad6
func (u UpdateGroupInvitePrivacyForbidden ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateGroupInvitePrivacyForbidden {}
_ bin .Decoder = &UpdateGroupInvitePrivacyForbidden {}
_ bin .BareEncoder = &UpdateGroupInvitePrivacyForbidden {}
_ bin .BareDecoder = &UpdateGroupInvitePrivacyForbidden {}
_ UpdateClass = &UpdateGroupInvitePrivacyForbidden {}
)
func (u *UpdateGroupInvitePrivacyForbidden ) Zero () bool {
if u == nil {
return true
}
if !(u .UserID == 0 ) {
return false
}
return true
}
func (u *UpdateGroupInvitePrivacyForbidden ) String () string {
if u == nil {
return "UpdateGroupInvitePrivacyForbidden(nil)"
}
type Alias UpdateGroupInvitePrivacyForbidden
return fmt .Sprintf ("UpdateGroupInvitePrivacyForbidden%+v" , Alias (*u ))
}
func (u *UpdateGroupInvitePrivacyForbidden ) FillFrom (from interface {
GetUserID () (value int64 )
}) {
u .UserID = from .GetUserID ()
}
func (*UpdateGroupInvitePrivacyForbidden ) TypeID () uint32 {
return UpdateGroupInvitePrivacyForbiddenTypeID
}
func (*UpdateGroupInvitePrivacyForbidden ) TypeName () string {
return "updateGroupInvitePrivacyForbidden"
}
func (u *UpdateGroupInvitePrivacyForbidden ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateGroupInvitePrivacyForbidden" ,
ID : UpdateGroupInvitePrivacyForbiddenTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (u *UpdateGroupInvitePrivacyForbidden ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupInvitePrivacyForbidden#ccf08ad6 as nil" )
}
b .PutID (UpdateGroupInvitePrivacyForbiddenTypeID )
return u .EncodeBare (b )
}
func (u *UpdateGroupInvitePrivacyForbidden ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateGroupInvitePrivacyForbidden#ccf08ad6 as nil" )
}
b .PutLong (u .UserID )
return nil
}
func (u *UpdateGroupInvitePrivacyForbidden ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupInvitePrivacyForbidden#ccf08ad6 to nil" )
}
if err := b .ConsumeID (UpdateGroupInvitePrivacyForbiddenTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateGroupInvitePrivacyForbidden#ccf08ad6: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateGroupInvitePrivacyForbidden ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateGroupInvitePrivacyForbidden#ccf08ad6 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateGroupInvitePrivacyForbidden#ccf08ad6: field user_id: %w" , err )
}
u .UserID = value
}
return nil
}
func (u *UpdateGroupInvitePrivacyForbidden ) GetUserID () (value int64 ) {
if u == nil {
return
}
return u .UserID
}
type UpdateStory struct {
Peer PeerClass
Story StoryItemClass
}
const UpdateStoryTypeID = 0x75b3b798
func (u UpdateStory ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStory {}
_ bin .Decoder = &UpdateStory {}
_ bin .BareEncoder = &UpdateStory {}
_ bin .BareDecoder = &UpdateStory {}
_ UpdateClass = &UpdateStory {}
)
func (u *UpdateStory ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Story == nil ) {
return false
}
return true
}
func (u *UpdateStory ) String () string {
if u == nil {
return "UpdateStory(nil)"
}
type Alias UpdateStory
return fmt .Sprintf ("UpdateStory%+v" , Alias (*u ))
}
func (u *UpdateStory ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetStory () (value StoryItemClass )
}) {
u .Peer = from .GetPeer ()
u .Story = from .GetStory ()
}
func (*UpdateStory ) TypeID () uint32 {
return UpdateStoryTypeID
}
func (*UpdateStory ) TypeName () string {
return "updateStory"
}
func (u *UpdateStory ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStory" ,
ID : UpdateStoryTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Story" ,
SchemaName : "story" ,
},
}
return typ
}
func (u *UpdateStory ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStory#75b3b798 as nil" )
}
b .PutID (UpdateStoryTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStory ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStory#75b3b798 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateStory#75b3b798: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStory#75b3b798: field peer: %w" , err )
}
if u .Story == nil {
return fmt .Errorf ("unable to encode updateStory#75b3b798: field story is nil" )
}
if err := u .Story .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStory#75b3b798: field story: %w" , err )
}
return nil
}
func (u *UpdateStory ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStory#75b3b798 to nil" )
}
if err := b .ConsumeID (UpdateStoryTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStory#75b3b798: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStory ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStory#75b3b798 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateStory#75b3b798: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := DecodeStoryItem (b )
if err != nil {
return fmt .Errorf ("unable to decode updateStory#75b3b798: field story: %w" , err )
}
u .Story = value
}
return nil
}
func (u *UpdateStory ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateStory ) GetStory () (value StoryItemClass ) {
if u == nil {
return
}
return u .Story
}
type UpdateReadStories struct {
Peer PeerClass
MaxID int
}
const UpdateReadStoriesTypeID = 0xf74e932b
func (u UpdateReadStories ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateReadStories {}
_ bin .Decoder = &UpdateReadStories {}
_ bin .BareEncoder = &UpdateReadStories {}
_ bin .BareDecoder = &UpdateReadStories {}
_ UpdateClass = &UpdateReadStories {}
)
func (u *UpdateReadStories ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MaxID == 0 ) {
return false
}
return true
}
func (u *UpdateReadStories ) String () string {
if u == nil {
return "UpdateReadStories(nil)"
}
type Alias UpdateReadStories
return fmt .Sprintf ("UpdateReadStories%+v" , Alias (*u ))
}
func (u *UpdateReadStories ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMaxID () (value int )
}) {
u .Peer = from .GetPeer ()
u .MaxID = from .GetMaxID ()
}
func (*UpdateReadStories ) TypeID () uint32 {
return UpdateReadStoriesTypeID
}
func (*UpdateReadStories ) TypeName () string {
return "updateReadStories"
}
func (u *UpdateReadStories ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateReadStories" ,
ID : UpdateReadStoriesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MaxID" ,
SchemaName : "max_id" ,
},
}
return typ
}
func (u *UpdateReadStories ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadStories#f74e932b as nil" )
}
b .PutID (UpdateReadStoriesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateReadStories ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateReadStories#f74e932b as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateReadStories#f74e932b: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateReadStories#f74e932b: field peer: %w" , err )
}
b .PutInt (u .MaxID )
return nil
}
func (u *UpdateReadStories ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadStories#f74e932b to nil" )
}
if err := b .ConsumeID (UpdateReadStoriesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateReadStories#f74e932b: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateReadStories ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateReadStories#f74e932b to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateReadStories#f74e932b: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateReadStories#f74e932b: field max_id: %w" , err )
}
u .MaxID = value
}
return nil
}
func (u *UpdateReadStories ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateReadStories ) GetMaxID () (value int ) {
if u == nil {
return
}
return u .MaxID
}
type UpdateStoryID struct {
ID int
RandomID int64
}
const UpdateStoryIDTypeID = 0x1bf335b9
func (u UpdateStoryID ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStoryID {}
_ bin .Decoder = &UpdateStoryID {}
_ bin .BareEncoder = &UpdateStoryID {}
_ bin .BareDecoder = &UpdateStoryID {}
_ UpdateClass = &UpdateStoryID {}
)
func (u *UpdateStoryID ) Zero () bool {
if u == nil {
return true
}
if !(u .ID == 0 ) {
return false
}
if !(u .RandomID == 0 ) {
return false
}
return true
}
func (u *UpdateStoryID ) String () string {
if u == nil {
return "UpdateStoryID(nil)"
}
type Alias UpdateStoryID
return fmt .Sprintf ("UpdateStoryID%+v" , Alias (*u ))
}
func (u *UpdateStoryID ) FillFrom (from interface {
GetID () (value int )
GetRandomID () (value int64 )
}) {
u .ID = from .GetID ()
u .RandomID = from .GetRandomID ()
}
func (*UpdateStoryID ) TypeID () uint32 {
return UpdateStoryIDTypeID
}
func (*UpdateStoryID ) TypeName () string {
return "updateStoryID"
}
func (u *UpdateStoryID ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStoryID" ,
ID : UpdateStoryIDTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "RandomID" ,
SchemaName : "random_id" ,
},
}
return typ
}
func (u *UpdateStoryID ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStoryID#1bf335b9 as nil" )
}
b .PutID (UpdateStoryIDTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStoryID ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStoryID#1bf335b9 as nil" )
}
b .PutInt (u .ID )
b .PutLong (u .RandomID )
return nil
}
func (u *UpdateStoryID ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStoryID#1bf335b9 to nil" )
}
if err := b .ConsumeID (UpdateStoryIDTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStoryID#1bf335b9: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStoryID ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStoryID#1bf335b9 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateStoryID#1bf335b9: field id: %w" , err )
}
u .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateStoryID#1bf335b9: field random_id: %w" , err )
}
u .RandomID = value
}
return nil
}
func (u *UpdateStoryID ) GetID () (value int ) {
if u == nil {
return
}
return u .ID
}
func (u *UpdateStoryID ) GetRandomID () (value int64 ) {
if u == nil {
return
}
return u .RandomID
}
type UpdateStoriesStealthMode struct {
StealthMode StoriesStealthMode
}
const UpdateStoriesStealthModeTypeID = 0x2c084dc1
func (u UpdateStoriesStealthMode ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateStoriesStealthMode {}
_ bin .Decoder = &UpdateStoriesStealthMode {}
_ bin .BareEncoder = &UpdateStoriesStealthMode {}
_ bin .BareDecoder = &UpdateStoriesStealthMode {}
_ UpdateClass = &UpdateStoriesStealthMode {}
)
func (u *UpdateStoriesStealthMode ) Zero () bool {
if u == nil {
return true
}
if !(u .StealthMode .Zero ()) {
return false
}
return true
}
func (u *UpdateStoriesStealthMode ) String () string {
if u == nil {
return "UpdateStoriesStealthMode(nil)"
}
type Alias UpdateStoriesStealthMode
return fmt .Sprintf ("UpdateStoriesStealthMode%+v" , Alias (*u ))
}
func (u *UpdateStoriesStealthMode ) FillFrom (from interface {
GetStealthMode () (value StoriesStealthMode )
}) {
u .StealthMode = from .GetStealthMode ()
}
func (*UpdateStoriesStealthMode ) TypeID () uint32 {
return UpdateStoriesStealthModeTypeID
}
func (*UpdateStoriesStealthMode ) TypeName () string {
return "updateStoriesStealthMode"
}
func (u *UpdateStoriesStealthMode ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateStoriesStealthMode" ,
ID : UpdateStoriesStealthModeTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "StealthMode" ,
SchemaName : "stealth_mode" ,
},
}
return typ
}
func (u *UpdateStoriesStealthMode ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStoriesStealthMode#2c084dc1 as nil" )
}
b .PutID (UpdateStoriesStealthModeTypeID )
return u .EncodeBare (b )
}
func (u *UpdateStoriesStealthMode ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateStoriesStealthMode#2c084dc1 as nil" )
}
if err := u .StealthMode .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateStoriesStealthMode#2c084dc1: field stealth_mode: %w" , err )
}
return nil
}
func (u *UpdateStoriesStealthMode ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStoriesStealthMode#2c084dc1 to nil" )
}
if err := b .ConsumeID (UpdateStoriesStealthModeTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateStoriesStealthMode#2c084dc1: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateStoriesStealthMode ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateStoriesStealthMode#2c084dc1 to nil" )
}
{
if err := u .StealthMode .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateStoriesStealthMode#2c084dc1: field stealth_mode: %w" , err )
}
}
return nil
}
func (u *UpdateStoriesStealthMode ) GetStealthMode () (value StoriesStealthMode ) {
if u == nil {
return
}
return u .StealthMode
}
type UpdateSentStoryReaction struct {
Peer PeerClass
StoryID int
Reaction ReactionClass
}
const UpdateSentStoryReactionTypeID = 0x7d627683
func (u UpdateSentStoryReaction ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateSentStoryReaction {}
_ bin .Decoder = &UpdateSentStoryReaction {}
_ bin .BareEncoder = &UpdateSentStoryReaction {}
_ bin .BareDecoder = &UpdateSentStoryReaction {}
_ UpdateClass = &UpdateSentStoryReaction {}
)
func (u *UpdateSentStoryReaction ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .StoryID == 0 ) {
return false
}
if !(u .Reaction == nil ) {
return false
}
return true
}
func (u *UpdateSentStoryReaction ) String () string {
if u == nil {
return "UpdateSentStoryReaction(nil)"
}
type Alias UpdateSentStoryReaction
return fmt .Sprintf ("UpdateSentStoryReaction%+v" , Alias (*u ))
}
func (u *UpdateSentStoryReaction ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetStoryID () (value int )
GetReaction () (value ReactionClass )
}) {
u .Peer = from .GetPeer ()
u .StoryID = from .GetStoryID ()
u .Reaction = from .GetReaction ()
}
func (*UpdateSentStoryReaction ) TypeID () uint32 {
return UpdateSentStoryReactionTypeID
}
func (*UpdateSentStoryReaction ) TypeName () string {
return "updateSentStoryReaction"
}
func (u *UpdateSentStoryReaction ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateSentStoryReaction" ,
ID : UpdateSentStoryReactionTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "StoryID" ,
SchemaName : "story_id" ,
},
{
Name : "Reaction" ,
SchemaName : "reaction" ,
},
}
return typ
}
func (u *UpdateSentStoryReaction ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSentStoryReaction#7d627683 as nil" )
}
b .PutID (UpdateSentStoryReactionTypeID )
return u .EncodeBare (b )
}
func (u *UpdateSentStoryReaction ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateSentStoryReaction#7d627683 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateSentStoryReaction#7d627683: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateSentStoryReaction#7d627683: field peer: %w" , err )
}
b .PutInt (u .StoryID )
if u .Reaction == nil {
return fmt .Errorf ("unable to encode updateSentStoryReaction#7d627683: field reaction is nil" )
}
if err := u .Reaction .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateSentStoryReaction#7d627683: field reaction: %w" , err )
}
return nil
}
func (u *UpdateSentStoryReaction ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSentStoryReaction#7d627683 to nil" )
}
if err := b .ConsumeID (UpdateSentStoryReactionTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateSentStoryReaction#7d627683: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateSentStoryReaction ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateSentStoryReaction#7d627683 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateSentStoryReaction#7d627683: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateSentStoryReaction#7d627683: field story_id: %w" , err )
}
u .StoryID = value
}
{
value , err := DecodeReaction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateSentStoryReaction#7d627683: field reaction: %w" , err )
}
u .Reaction = value
}
return nil
}
func (u *UpdateSentStoryReaction ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateSentStoryReaction ) GetStoryID () (value int ) {
if u == nil {
return
}
return u .StoryID
}
func (u *UpdateSentStoryReaction ) GetReaction () (value ReactionClass ) {
if u == nil {
return
}
return u .Reaction
}
type UpdateBotChatBoost struct {
Peer PeerClass
Boost Boost
Qts int
}
const UpdateBotChatBoostTypeID = 0x904dd49c
func (u UpdateBotChatBoost ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotChatBoost {}
_ bin .Decoder = &UpdateBotChatBoost {}
_ bin .BareEncoder = &UpdateBotChatBoost {}
_ bin .BareDecoder = &UpdateBotChatBoost {}
_ UpdateClass = &UpdateBotChatBoost {}
)
func (u *UpdateBotChatBoost ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .Boost .Zero ()) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotChatBoost ) String () string {
if u == nil {
return "UpdateBotChatBoost(nil)"
}
type Alias UpdateBotChatBoost
return fmt .Sprintf ("UpdateBotChatBoost%+v" , Alias (*u ))
}
func (u *UpdateBotChatBoost ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetBoost () (value Boost )
GetQts () (value int )
}) {
u .Peer = from .GetPeer ()
u .Boost = from .GetBoost ()
u .Qts = from .GetQts ()
}
func (*UpdateBotChatBoost ) TypeID () uint32 {
return UpdateBotChatBoostTypeID
}
func (*UpdateBotChatBoost ) TypeName () string {
return "updateBotChatBoost"
}
func (u *UpdateBotChatBoost ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotChatBoost" ,
ID : UpdateBotChatBoostTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Boost" ,
SchemaName : "boost" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotChatBoost ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotChatBoost#904dd49c as nil" )
}
b .PutID (UpdateBotChatBoostTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotChatBoost ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotChatBoost#904dd49c as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotChatBoost#904dd49c: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotChatBoost#904dd49c: field peer: %w" , err )
}
if err := u .Boost .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotChatBoost#904dd49c: field boost: %w" , err )
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotChatBoost ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotChatBoost#904dd49c to nil" )
}
if err := b .ConsumeID (UpdateBotChatBoostTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotChatBoost#904dd49c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotChatBoost ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotChatBoost#904dd49c to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatBoost#904dd49c: field peer: %w" , err )
}
u .Peer = value
}
{
if err := u .Boost .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotChatBoost#904dd49c: field boost: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotChatBoost#904dd49c: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateBotChatBoost ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotChatBoost ) GetBoost () (value Boost ) {
if u == nil {
return
}
return u .Boost
}
func (u *UpdateBotChatBoost ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
type UpdateChannelViewForumAsMessages struct {
ChannelID int64
Enabled bool
}
const UpdateChannelViewForumAsMessagesTypeID = 0x7b68920
func (u UpdateChannelViewForumAsMessages ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateChannelViewForumAsMessages {}
_ bin .Decoder = &UpdateChannelViewForumAsMessages {}
_ bin .BareEncoder = &UpdateChannelViewForumAsMessages {}
_ bin .BareDecoder = &UpdateChannelViewForumAsMessages {}
_ UpdateClass = &UpdateChannelViewForumAsMessages {}
)
func (u *UpdateChannelViewForumAsMessages ) Zero () bool {
if u == nil {
return true
}
if !(u .ChannelID == 0 ) {
return false
}
if !(u .Enabled == false ) {
return false
}
return true
}
func (u *UpdateChannelViewForumAsMessages ) String () string {
if u == nil {
return "UpdateChannelViewForumAsMessages(nil)"
}
type Alias UpdateChannelViewForumAsMessages
return fmt .Sprintf ("UpdateChannelViewForumAsMessages%+v" , Alias (*u ))
}
func (u *UpdateChannelViewForumAsMessages ) FillFrom (from interface {
GetChannelID () (value int64 )
GetEnabled () (value bool )
}) {
u .ChannelID = from .GetChannelID ()
u .Enabled = from .GetEnabled ()
}
func (*UpdateChannelViewForumAsMessages ) TypeID () uint32 {
return UpdateChannelViewForumAsMessagesTypeID
}
func (*UpdateChannelViewForumAsMessages ) TypeName () string {
return "updateChannelViewForumAsMessages"
}
func (u *UpdateChannelViewForumAsMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateChannelViewForumAsMessages" ,
ID : UpdateChannelViewForumAsMessagesTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Enabled" ,
SchemaName : "enabled" ,
},
}
return typ
}
func (u *UpdateChannelViewForumAsMessages ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelViewForumAsMessages#7b68920 as nil" )
}
b .PutID (UpdateChannelViewForumAsMessagesTypeID )
return u .EncodeBare (b )
}
func (u *UpdateChannelViewForumAsMessages ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateChannelViewForumAsMessages#7b68920 as nil" )
}
b .PutLong (u .ChannelID )
b .PutBool (u .Enabled )
return nil
}
func (u *UpdateChannelViewForumAsMessages ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelViewForumAsMessages#7b68920 to nil" )
}
if err := b .ConsumeID (UpdateChannelViewForumAsMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateChannelViewForumAsMessages#7b68920: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateChannelViewForumAsMessages ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateChannelViewForumAsMessages#7b68920 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelViewForumAsMessages#7b68920: field channel_id: %w" , err )
}
u .ChannelID = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode updateChannelViewForumAsMessages#7b68920: field enabled: %w" , err )
}
u .Enabled = value
}
return nil
}
func (u *UpdateChannelViewForumAsMessages ) GetChannelID () (value int64 ) {
if u == nil {
return
}
return u .ChannelID
}
func (u *UpdateChannelViewForumAsMessages ) GetEnabled () (value bool ) {
if u == nil {
return
}
return u .Enabled
}
type UpdatePeerWallpaper struct {
Flags bin .Fields
WallpaperOverridden bool
Peer PeerClass
Wallpaper WallPaperClass
}
const UpdatePeerWallpaperTypeID = 0xae3f101d
func (u UpdatePeerWallpaper ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdatePeerWallpaper {}
_ bin .Decoder = &UpdatePeerWallpaper {}
_ bin .BareEncoder = &UpdatePeerWallpaper {}
_ bin .BareDecoder = &UpdatePeerWallpaper {}
_ UpdateClass = &UpdatePeerWallpaper {}
)
func (u *UpdatePeerWallpaper ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .WallpaperOverridden == false ) {
return false
}
if !(u .Peer == nil ) {
return false
}
if !(u .Wallpaper == nil ) {
return false
}
return true
}
func (u *UpdatePeerWallpaper ) String () string {
if u == nil {
return "UpdatePeerWallpaper(nil)"
}
type Alias UpdatePeerWallpaper
return fmt .Sprintf ("UpdatePeerWallpaper%+v" , Alias (*u ))
}
func (u *UpdatePeerWallpaper ) FillFrom (from interface {
GetWallpaperOverridden () (value bool )
GetPeer () (value PeerClass )
GetWallpaper () (value WallPaperClass , ok bool )
}) {
u .WallpaperOverridden = from .GetWallpaperOverridden ()
u .Peer = from .GetPeer ()
if val , ok := from .GetWallpaper (); ok {
u .Wallpaper = val
}
}
func (*UpdatePeerWallpaper ) TypeID () uint32 {
return UpdatePeerWallpaperTypeID
}
func (*UpdatePeerWallpaper ) TypeName () string {
return "updatePeerWallpaper"
}
func (u *UpdatePeerWallpaper ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updatePeerWallpaper" ,
ID : UpdatePeerWallpaperTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "WallpaperOverridden" ,
SchemaName : "wallpaper_overridden" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Wallpaper" ,
SchemaName : "wallpaper" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *UpdatePeerWallpaper ) SetFlags () {
if !(u .WallpaperOverridden == false ) {
u .Flags .Set (1 )
}
if !(u .Wallpaper == nil ) {
u .Flags .Set (0 )
}
}
func (u *UpdatePeerWallpaper ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerWallpaper#ae3f101d as nil" )
}
b .PutID (UpdatePeerWallpaperTypeID )
return u .EncodeBare (b )
}
func (u *UpdatePeerWallpaper ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updatePeerWallpaper#ae3f101d as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerWallpaper#ae3f101d: field flags: %w" , err )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updatePeerWallpaper#ae3f101d: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerWallpaper#ae3f101d: field peer: %w" , err )
}
if u .Flags .Has (0 ) {
if u .Wallpaper == nil {
return fmt .Errorf ("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper is nil" )
}
if err := u .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper: %w" , err )
}
}
return nil
}
func (u *UpdatePeerWallpaper ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerWallpaper#ae3f101d to nil" )
}
if err := b .ConsumeID (UpdatePeerWallpaperTypeID ); err != nil {
return fmt .Errorf ("unable to decode updatePeerWallpaper#ae3f101d: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdatePeerWallpaper ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updatePeerWallpaper#ae3f101d to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updatePeerWallpaper#ae3f101d: field flags: %w" , err )
}
}
u .WallpaperOverridden = u .Flags .Has (1 )
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerWallpaper#ae3f101d: field peer: %w" , err )
}
u .Peer = value
}
if u .Flags .Has (0 ) {
value , err := DecodeWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode updatePeerWallpaper#ae3f101d: field wallpaper: %w" , err )
}
u .Wallpaper = value
}
return nil
}
func (u *UpdatePeerWallpaper ) SetWallpaperOverridden (value bool ) {
if value {
u .Flags .Set (1 )
u .WallpaperOverridden = true
} else {
u .Flags .Unset (1 )
u .WallpaperOverridden = false
}
}
func (u *UpdatePeerWallpaper ) GetWallpaperOverridden () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (1 )
}
func (u *UpdatePeerWallpaper ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdatePeerWallpaper ) SetWallpaper (value WallPaperClass ) {
u .Flags .Set (0 )
u .Wallpaper = value
}
func (u *UpdatePeerWallpaper ) GetWallpaper () (value WallPaperClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Wallpaper , true
}
type UpdateBotMessageReaction struct {
Peer PeerClass
MsgID int
Date int
Actor PeerClass
OldReactions []ReactionClass
NewReactions []ReactionClass
Qts int
}
const UpdateBotMessageReactionTypeID = 0xac21d3ce
func (u UpdateBotMessageReaction ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotMessageReaction {}
_ bin .Decoder = &UpdateBotMessageReaction {}
_ bin .BareEncoder = &UpdateBotMessageReaction {}
_ bin .BareDecoder = &UpdateBotMessageReaction {}
_ UpdateClass = &UpdateBotMessageReaction {}
)
func (u *UpdateBotMessageReaction ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Actor == nil ) {
return false
}
if !(u .OldReactions == nil ) {
return false
}
if !(u .NewReactions == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotMessageReaction ) String () string {
if u == nil {
return "UpdateBotMessageReaction(nil)"
}
type Alias UpdateBotMessageReaction
return fmt .Sprintf ("UpdateBotMessageReaction%+v" , Alias (*u ))
}
func (u *UpdateBotMessageReaction ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetDate () (value int )
GetActor () (value PeerClass )
GetOldReactions () (value []ReactionClass )
GetNewReactions () (value []ReactionClass )
GetQts () (value int )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .Date = from .GetDate ()
u .Actor = from .GetActor ()
u .OldReactions = from .GetOldReactions ()
u .NewReactions = from .GetNewReactions ()
u .Qts = from .GetQts ()
}
func (*UpdateBotMessageReaction ) TypeID () uint32 {
return UpdateBotMessageReactionTypeID
}
func (*UpdateBotMessageReaction ) TypeName () string {
return "updateBotMessageReaction"
}
func (u *UpdateBotMessageReaction ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotMessageReaction" ,
ID : UpdateBotMessageReactionTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Actor" ,
SchemaName : "actor" ,
},
{
Name : "OldReactions" ,
SchemaName : "old_reactions" ,
},
{
Name : "NewReactions" ,
SchemaName : "new_reactions" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotMessageReaction ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMessageReaction#ac21d3ce as nil" )
}
b .PutID (UpdateBotMessageReactionTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotMessageReaction ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMessageReaction#ac21d3ce as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field peer: %w" , err )
}
b .PutInt (u .MsgID )
b .PutInt (u .Date )
if u .Actor == nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field actor is nil" )
}
if err := u .Actor .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field actor: %w" , err )
}
b .PutVectorHeader (len (u .OldReactions ))
for idx , v := range u .OldReactions {
if v == nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d: %w" , idx , err )
}
}
b .PutVectorHeader (len (u .NewReactions ))
for idx , v := range u .NewReactions {
if v == nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotMessageReaction ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMessageReaction#ac21d3ce to nil" )
}
if err := b .ConsumeID (UpdateBotMessageReactionTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotMessageReaction ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMessageReaction#ac21d3ce to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field date: %w" , err )
}
u .Date = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field actor: %w" , err )
}
u .Actor = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w" , err )
}
if headerLen > 0 {
u .OldReactions = make ([]ReactionClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeReaction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w" , err )
}
u .OldReactions = append (u .OldReactions , value )
}
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w" , err )
}
if headerLen > 0 {
u .NewReactions = make ([]ReactionClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeReaction (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w" , err )
}
u .NewReactions = append (u .NewReactions , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReaction#ac21d3ce: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateBotMessageReaction ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotMessageReaction ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateBotMessageReaction ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateBotMessageReaction ) GetActor () (value PeerClass ) {
if u == nil {
return
}
return u .Actor
}
func (u *UpdateBotMessageReaction ) GetOldReactions () (value []ReactionClass ) {
if u == nil {
return
}
return u .OldReactions
}
func (u *UpdateBotMessageReaction ) GetNewReactions () (value []ReactionClass ) {
if u == nil {
return
}
return u .NewReactions
}
func (u *UpdateBotMessageReaction ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
func (u *UpdateBotMessageReaction ) MapOldReactions () (value ReactionClassArray ) {
return ReactionClassArray (u .OldReactions )
}
func (u *UpdateBotMessageReaction ) MapNewReactions () (value ReactionClassArray ) {
return ReactionClassArray (u .NewReactions )
}
type UpdateBotMessageReactions struct {
Peer PeerClass
MsgID int
Date int
Reactions []ReactionCount
Qts int
}
const UpdateBotMessageReactionsTypeID = 0x9cb7759
func (u UpdateBotMessageReactions ) construct () UpdateClass { return &u }
var (
_ bin .Encoder = &UpdateBotMessageReactions {}
_ bin .Decoder = &UpdateBotMessageReactions {}
_ bin .BareEncoder = &UpdateBotMessageReactions {}
_ bin .BareDecoder = &UpdateBotMessageReactions {}
_ UpdateClass = &UpdateBotMessageReactions {}
)
func (u *UpdateBotMessageReactions ) Zero () bool {
if u == nil {
return true
}
if !(u .Peer == nil ) {
return false
}
if !(u .MsgID == 0 ) {
return false
}
if !(u .Date == 0 ) {
return false
}
if !(u .Reactions == nil ) {
return false
}
if !(u .Qts == 0 ) {
return false
}
return true
}
func (u *UpdateBotMessageReactions ) String () string {
if u == nil {
return "UpdateBotMessageReactions(nil)"
}
type Alias UpdateBotMessageReactions
return fmt .Sprintf ("UpdateBotMessageReactions%+v" , Alias (*u ))
}
func (u *UpdateBotMessageReactions ) FillFrom (from interface {
GetPeer () (value PeerClass )
GetMsgID () (value int )
GetDate () (value int )
GetReactions () (value []ReactionCount )
GetQts () (value int )
}) {
u .Peer = from .GetPeer ()
u .MsgID = from .GetMsgID ()
u .Date = from .GetDate ()
u .Reactions = from .GetReactions ()
u .Qts = from .GetQts ()
}
func (*UpdateBotMessageReactions ) TypeID () uint32 {
return UpdateBotMessageReactionsTypeID
}
func (*UpdateBotMessageReactions ) TypeName () string {
return "updateBotMessageReactions"
}
func (u *UpdateBotMessageReactions ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "updateBotMessageReactions" ,
ID : UpdateBotMessageReactionsTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Reactions" ,
SchemaName : "reactions" ,
},
{
Name : "Qts" ,
SchemaName : "qts" ,
},
}
return typ
}
func (u *UpdateBotMessageReactions ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMessageReactions#9cb7759 as nil" )
}
b .PutID (UpdateBotMessageReactionsTypeID )
return u .EncodeBare (b )
}
func (u *UpdateBotMessageReactions ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode updateBotMessageReactions#9cb7759 as nil" )
}
if u .Peer == nil {
return fmt .Errorf ("unable to encode updateBotMessageReactions#9cb7759: field peer is nil" )
}
if err := u .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReactions#9cb7759: field peer: %w" , err )
}
b .PutInt (u .MsgID )
b .PutInt (u .Date )
b .PutVectorHeader (len (u .Reactions ))
for idx , v := range u .Reactions {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode updateBotMessageReactions#9cb7759: field reactions element with index %d: %w" , idx , err )
}
}
b .PutInt (u .Qts )
return nil
}
func (u *UpdateBotMessageReactions ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMessageReactions#9cb7759 to nil" )
}
if err := b .ConsumeID (UpdateBotMessageReactionsTypeID ); err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UpdateBotMessageReactions ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode updateBotMessageReactions#9cb7759 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field peer: %w" , err )
}
u .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field msg_id: %w" , err )
}
u .MsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field date: %w" , err )
}
u .Date = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w" , err )
}
if headerLen > 0 {
u .Reactions = make ([]ReactionCount , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value ReactionCount
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w" , err )
}
u .Reactions = append (u .Reactions , value )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode updateBotMessageReactions#9cb7759: field qts: %w" , err )
}
u .Qts = value
}
return nil
}
func (u *UpdateBotMessageReactions ) GetPeer () (value PeerClass ) {
if u == nil {
return
}
return u .Peer
}
func (u *UpdateBotMessageReactions ) GetMsgID () (value int ) {
if u == nil {
return
}
return u .MsgID
}
func (u *UpdateBotMessageReactions ) GetDate () (value int ) {
if u == nil {
return
}
return u .Date
}
func (u *UpdateBotMessageReactions ) GetReactions () (value []ReactionCount ) {
if u == nil {
return
}
return u .Reactions
}
func (u *UpdateBotMessageReactions ) GetQts () (value int ) {
if u == nil {
return
}
return u .Qts
}
const UpdateClassName = "Update"
type UpdateClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () UpdateClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeUpdate (buf *bin .Buffer ) (UpdateClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case UpdateNewMessageTypeID :
v := UpdateNewMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessageIDTypeID :
v := UpdateMessageID {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteMessagesTypeID :
v := UpdateDeleteMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserTypingTypeID :
v := UpdateUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatUserTypingTypeID :
v := UpdateChatUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantsTypeID :
v := UpdateChatParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserStatusTypeID :
v := UpdateUserStatus {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserNameTypeID :
v := UpdateUserName {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewAuthorizationTypeID :
v := UpdateNewAuthorization {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewEncryptedMessageTypeID :
v := UpdateNewEncryptedMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptedChatTypingTypeID :
v := UpdateEncryptedChatTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptionTypeID :
v := UpdateEncryption {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEncryptedMessagesReadTypeID :
v := UpdateEncryptedMessagesRead {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantAddTypeID :
v := UpdateChatParticipantAdd {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantDeleteTypeID :
v := UpdateChatParticipantDelete {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDCOptionsTypeID :
v := UpdateDCOptions {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNotifySettingsTypeID :
v := UpdateNotifySettings {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateServiceNotificationTypeID :
v := UpdateServiceNotification {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePrivacyTypeID :
v := UpdatePrivacy {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserPhoneTypeID :
v := UpdateUserPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadHistoryInboxTypeID :
v := UpdateReadHistoryInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadHistoryOutboxTypeID :
v := UpdateReadHistoryOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateWebPageTypeID :
v := UpdateWebPage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadMessagesContentsTypeID :
v := UpdateReadMessagesContents {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelTooLongTypeID :
v := UpdateChannelTooLong {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelTypeID :
v := UpdateChannel {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewChannelMessageTypeID :
v := UpdateNewChannelMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelInboxTypeID :
v := UpdateReadChannelInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteChannelMessagesTypeID :
v := UpdateDeleteChannelMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelMessageViewsTypeID :
v := UpdateChannelMessageViews {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantAdminTypeID :
v := UpdateChatParticipantAdmin {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewStickerSetTypeID :
v := UpdateNewStickerSet {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStickerSetsOrderTypeID :
v := UpdateStickerSetsOrder {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStickerSetsTypeID :
v := UpdateStickerSets {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateSavedGifsTypeID :
v := UpdateSavedGifs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotInlineQueryTypeID :
v := UpdateBotInlineQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotInlineSendTypeID :
v := UpdateBotInlineSend {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEditChannelMessageTypeID :
v := UpdateEditChannelMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotCallbackQueryTypeID :
v := UpdateBotCallbackQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateEditMessageTypeID :
v := UpdateEditMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateInlineBotCallbackQueryTypeID :
v := UpdateInlineBotCallbackQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelOutboxTypeID :
v := UpdateReadChannelOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDraftMessageTypeID :
v := UpdateDraftMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadFeaturedStickersTypeID :
v := UpdateReadFeaturedStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateRecentStickersTypeID :
v := UpdateRecentStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateConfigTypeID :
v := UpdateConfig {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePtsChangedTypeID :
v := UpdatePtsChanged {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelWebPageTypeID :
v := UpdateChannelWebPage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogPinnedTypeID :
v := UpdateDialogPinned {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedDialogsTypeID :
v := UpdatePinnedDialogs {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotWebhookJSONTypeID :
v := UpdateBotWebhookJSON {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotWebhookJSONQueryTypeID :
v := UpdateBotWebhookJSONQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotShippingQueryTypeID :
v := UpdateBotShippingQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotPrecheckoutQueryTypeID :
v := UpdateBotPrecheckoutQuery {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePhoneCallTypeID :
v := UpdatePhoneCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLangPackTooLongTypeID :
v := UpdateLangPackTooLong {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLangPackTypeID :
v := UpdateLangPack {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateFavedStickersTypeID :
v := UpdateFavedStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelReadMessagesContentsTypeID :
v := UpdateChannelReadMessagesContents {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateContactsResetTypeID :
v := UpdateContactsReset {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelAvailableMessagesTypeID :
v := UpdateChannelAvailableMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogUnreadMarkTypeID :
v := UpdateDialogUnreadMark {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessagePollTypeID :
v := UpdateMessagePoll {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatDefaultBannedRightsTypeID :
v := UpdateChatDefaultBannedRights {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateFolderPeersTypeID :
v := UpdateFolderPeers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerSettingsTypeID :
v := UpdatePeerSettings {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerLocatedTypeID :
v := UpdatePeerLocated {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateNewScheduledMessageTypeID :
v := UpdateNewScheduledMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDeleteScheduledMessagesTypeID :
v := UpdateDeleteScheduledMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateThemeTypeID :
v := UpdateTheme {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGeoLiveViewedTypeID :
v := UpdateGeoLiveViewed {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateLoginTokenTypeID :
v := UpdateLoginToken {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessagePollVoteTypeID :
v := UpdateMessagePollVote {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFilterTypeID :
v := UpdateDialogFilter {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFilterOrderTypeID :
v := UpdateDialogFilterOrder {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateDialogFiltersTypeID :
v := UpdateDialogFilters {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePhoneCallSignalingDataTypeID :
v := UpdatePhoneCallSignalingData {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelMessageForwardsTypeID :
v := UpdateChannelMessageForwards {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelDiscussionInboxTypeID :
v := UpdateReadChannelDiscussionInbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadChannelDiscussionOutboxTypeID :
v := UpdateReadChannelDiscussionOutbox {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerBlockedTypeID :
v := UpdatePeerBlocked {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelUserTypingTypeID :
v := UpdateChannelUserTyping {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedMessagesTypeID :
v := UpdatePinnedMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePinnedChannelMessagesTypeID :
v := UpdatePinnedChannelMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatTypeID :
v := UpdateChat {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupCallParticipantsTypeID :
v := UpdateGroupCallParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupCallTypeID :
v := UpdateGroupCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerHistoryTTLTypeID :
v := UpdatePeerHistoryTTL {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChatParticipantTypeID :
v := UpdateChatParticipant {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelParticipantTypeID :
v := UpdateChannelParticipant {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotStoppedTypeID :
v := UpdateBotStopped {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupCallConnectionTypeID :
v := UpdateGroupCallConnection {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotCommandsTypeID :
v := UpdateBotCommands {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePendingJoinRequestsTypeID :
v := UpdatePendingJoinRequests {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotChatInviteRequesterTypeID :
v := UpdateBotChatInviteRequester {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessageReactionsTypeID :
v := UpdateMessageReactions {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateAttachMenuBotsTypeID :
v := UpdateAttachMenuBots {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateWebViewResultSentTypeID :
v := UpdateWebViewResultSent {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotMenuButtonTypeID :
v := UpdateBotMenuButton {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateSavedRingtonesTypeID :
v := UpdateSavedRingtones {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateTranscribedAudioTypeID :
v := UpdateTranscribedAudio {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadFeaturedEmojiStickersTypeID :
v := UpdateReadFeaturedEmojiStickers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserEmojiStatusTypeID :
v := UpdateUserEmojiStatus {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateRecentEmojiStatusesTypeID :
v := UpdateRecentEmojiStatuses {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateRecentReactionsTypeID :
v := UpdateRecentReactions {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMoveStickerSetToTopTypeID :
v := UpdateMoveStickerSetToTop {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateMessageExtendedMediaTypeID :
v := UpdateMessageExtendedMedia {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelPinnedTopicTypeID :
v := UpdateChannelPinnedTopic {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelPinnedTopicsTypeID :
v := UpdateChannelPinnedTopics {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateUserTypeID :
v := UpdateUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateAutoSaveSettingsTypeID :
v := UpdateAutoSaveSettings {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateGroupInvitePrivacyForbiddenTypeID :
v := UpdateGroupInvitePrivacyForbidden {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStoryTypeID :
v := UpdateStory {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateReadStoriesTypeID :
v := UpdateReadStories {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStoryIDTypeID :
v := UpdateStoryID {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateStoriesStealthModeTypeID :
v := UpdateStoriesStealthMode {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateSentStoryReactionTypeID :
v := UpdateSentStoryReaction {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotChatBoostTypeID :
v := UpdateBotChatBoost {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateChannelViewForumAsMessagesTypeID :
v := UpdateChannelViewForumAsMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdatePeerWallpaperTypeID :
v := UpdatePeerWallpaper {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotMessageReactionTypeID :
v := UpdateBotMessageReaction {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
case UpdateBotMessageReactionsTypeID :
v := UpdateBotMessageReactions {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode UpdateClass: %w" , bin .NewUnexpectedID (id ))
}
}
type UpdateBox struct {
Update UpdateClass
}
func (b *UpdateBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode UpdateBox to nil" )
}
v , err := DecodeUpdate (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .Update = v
return nil
}
func (b *UpdateBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .Update == nil {
return fmt .Errorf ("unable to encode UpdateClass as nil" )
}
return b .Update .Encode (buf )
}
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 .