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 PrivacyKeyStatusTimestamp struct {
}
const PrivacyKeyStatusTimestampTypeID = 0xbc2eab30
func (p PrivacyKeyStatusTimestamp ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyStatusTimestamp {}
_ bin .Decoder = &PrivacyKeyStatusTimestamp {}
_ bin .BareEncoder = &PrivacyKeyStatusTimestamp {}
_ bin .BareDecoder = &PrivacyKeyStatusTimestamp {}
_ PrivacyKeyClass = &PrivacyKeyStatusTimestamp {}
)
func (p *PrivacyKeyStatusTimestamp ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyStatusTimestamp ) String () string {
if p == nil {
return "PrivacyKeyStatusTimestamp(nil)"
}
type Alias PrivacyKeyStatusTimestamp
return fmt .Sprintf ("PrivacyKeyStatusTimestamp%+v" , Alias (*p ))
}
func (*PrivacyKeyStatusTimestamp ) TypeID () uint32 {
return PrivacyKeyStatusTimestampTypeID
}
func (*PrivacyKeyStatusTimestamp ) TypeName () string {
return "privacyKeyStatusTimestamp"
}
func (p *PrivacyKeyStatusTimestamp ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyStatusTimestamp" ,
ID : PrivacyKeyStatusTimestampTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyStatusTimestamp ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyStatusTimestamp#bc2eab30 as nil" )
}
b .PutID (PrivacyKeyStatusTimestampTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyStatusTimestamp ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyStatusTimestamp#bc2eab30 as nil" )
}
return nil
}
func (p *PrivacyKeyStatusTimestamp ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyStatusTimestamp#bc2eab30 to nil" )
}
if err := b .ConsumeID (PrivacyKeyStatusTimestampTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyStatusTimestamp#bc2eab30: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyStatusTimestamp ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyStatusTimestamp#bc2eab30 to nil" )
}
return nil
}
type PrivacyKeyChatInvite struct {
}
const PrivacyKeyChatInviteTypeID = 0x500e6dfa
func (p PrivacyKeyChatInvite ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyChatInvite {}
_ bin .Decoder = &PrivacyKeyChatInvite {}
_ bin .BareEncoder = &PrivacyKeyChatInvite {}
_ bin .BareDecoder = &PrivacyKeyChatInvite {}
_ PrivacyKeyClass = &PrivacyKeyChatInvite {}
)
func (p *PrivacyKeyChatInvite ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyChatInvite ) String () string {
if p == nil {
return "PrivacyKeyChatInvite(nil)"
}
type Alias PrivacyKeyChatInvite
return fmt .Sprintf ("PrivacyKeyChatInvite%+v" , Alias (*p ))
}
func (*PrivacyKeyChatInvite ) TypeID () uint32 {
return PrivacyKeyChatInviteTypeID
}
func (*PrivacyKeyChatInvite ) TypeName () string {
return "privacyKeyChatInvite"
}
func (p *PrivacyKeyChatInvite ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyChatInvite" ,
ID : PrivacyKeyChatInviteTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyChatInvite ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyChatInvite#500e6dfa as nil" )
}
b .PutID (PrivacyKeyChatInviteTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyChatInvite ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyChatInvite#500e6dfa as nil" )
}
return nil
}
func (p *PrivacyKeyChatInvite ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyChatInvite#500e6dfa to nil" )
}
if err := b .ConsumeID (PrivacyKeyChatInviteTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyChatInvite#500e6dfa: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyChatInvite ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyChatInvite#500e6dfa to nil" )
}
return nil
}
type PrivacyKeyPhoneCall struct {
}
const PrivacyKeyPhoneCallTypeID = 0x3d662b7b
func (p PrivacyKeyPhoneCall ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyPhoneCall {}
_ bin .Decoder = &PrivacyKeyPhoneCall {}
_ bin .BareEncoder = &PrivacyKeyPhoneCall {}
_ bin .BareDecoder = &PrivacyKeyPhoneCall {}
_ PrivacyKeyClass = &PrivacyKeyPhoneCall {}
)
func (p *PrivacyKeyPhoneCall ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyPhoneCall ) String () string {
if p == nil {
return "PrivacyKeyPhoneCall(nil)"
}
type Alias PrivacyKeyPhoneCall
return fmt .Sprintf ("PrivacyKeyPhoneCall%+v" , Alias (*p ))
}
func (*PrivacyKeyPhoneCall ) TypeID () uint32 {
return PrivacyKeyPhoneCallTypeID
}
func (*PrivacyKeyPhoneCall ) TypeName () string {
return "privacyKeyPhoneCall"
}
func (p *PrivacyKeyPhoneCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyPhoneCall" ,
ID : PrivacyKeyPhoneCallTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyPhoneCall ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneCall#3d662b7b as nil" )
}
b .PutID (PrivacyKeyPhoneCallTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyPhoneCall ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneCall#3d662b7b as nil" )
}
return nil
}
func (p *PrivacyKeyPhoneCall ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneCall#3d662b7b to nil" )
}
if err := b .ConsumeID (PrivacyKeyPhoneCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyPhoneCall#3d662b7b: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyPhoneCall ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneCall#3d662b7b to nil" )
}
return nil
}
type PrivacyKeyPhoneP2P struct {
}
const PrivacyKeyPhoneP2PTypeID = 0x39491cc8
func (p PrivacyKeyPhoneP2P ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyPhoneP2P {}
_ bin .Decoder = &PrivacyKeyPhoneP2P {}
_ bin .BareEncoder = &PrivacyKeyPhoneP2P {}
_ bin .BareDecoder = &PrivacyKeyPhoneP2P {}
_ PrivacyKeyClass = &PrivacyKeyPhoneP2P {}
)
func (p *PrivacyKeyPhoneP2P ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyPhoneP2P ) String () string {
if p == nil {
return "PrivacyKeyPhoneP2P(nil)"
}
type Alias PrivacyKeyPhoneP2P
return fmt .Sprintf ("PrivacyKeyPhoneP2P%+v" , Alias (*p ))
}
func (*PrivacyKeyPhoneP2P ) TypeID () uint32 {
return PrivacyKeyPhoneP2PTypeID
}
func (*PrivacyKeyPhoneP2P ) TypeName () string {
return "privacyKeyPhoneP2P"
}
func (p *PrivacyKeyPhoneP2P ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyPhoneP2P" ,
ID : PrivacyKeyPhoneP2PTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyPhoneP2P ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneP2P#39491cc8 as nil" )
}
b .PutID (PrivacyKeyPhoneP2PTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyPhoneP2P ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneP2P#39491cc8 as nil" )
}
return nil
}
func (p *PrivacyKeyPhoneP2P ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneP2P#39491cc8 to nil" )
}
if err := b .ConsumeID (PrivacyKeyPhoneP2PTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyPhoneP2P#39491cc8: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyPhoneP2P ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneP2P#39491cc8 to nil" )
}
return nil
}
type PrivacyKeyForwards struct {
}
const PrivacyKeyForwardsTypeID = 0x69ec56a3
func (p PrivacyKeyForwards ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyForwards {}
_ bin .Decoder = &PrivacyKeyForwards {}
_ bin .BareEncoder = &PrivacyKeyForwards {}
_ bin .BareDecoder = &PrivacyKeyForwards {}
_ PrivacyKeyClass = &PrivacyKeyForwards {}
)
func (p *PrivacyKeyForwards ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyForwards ) String () string {
if p == nil {
return "PrivacyKeyForwards(nil)"
}
type Alias PrivacyKeyForwards
return fmt .Sprintf ("PrivacyKeyForwards%+v" , Alias (*p ))
}
func (*PrivacyKeyForwards ) TypeID () uint32 {
return PrivacyKeyForwardsTypeID
}
func (*PrivacyKeyForwards ) TypeName () string {
return "privacyKeyForwards"
}
func (p *PrivacyKeyForwards ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyForwards" ,
ID : PrivacyKeyForwardsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyForwards ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyForwards#69ec56a3 as nil" )
}
b .PutID (PrivacyKeyForwardsTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyForwards ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyForwards#69ec56a3 as nil" )
}
return nil
}
func (p *PrivacyKeyForwards ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyForwards#69ec56a3 to nil" )
}
if err := b .ConsumeID (PrivacyKeyForwardsTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyForwards#69ec56a3: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyForwards ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyForwards#69ec56a3 to nil" )
}
return nil
}
type PrivacyKeyProfilePhoto struct {
}
const PrivacyKeyProfilePhotoTypeID = 0x96151fed
func (p PrivacyKeyProfilePhoto ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyProfilePhoto {}
_ bin .Decoder = &PrivacyKeyProfilePhoto {}
_ bin .BareEncoder = &PrivacyKeyProfilePhoto {}
_ bin .BareDecoder = &PrivacyKeyProfilePhoto {}
_ PrivacyKeyClass = &PrivacyKeyProfilePhoto {}
)
func (p *PrivacyKeyProfilePhoto ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyProfilePhoto ) String () string {
if p == nil {
return "PrivacyKeyProfilePhoto(nil)"
}
type Alias PrivacyKeyProfilePhoto
return fmt .Sprintf ("PrivacyKeyProfilePhoto%+v" , Alias (*p ))
}
func (*PrivacyKeyProfilePhoto ) TypeID () uint32 {
return PrivacyKeyProfilePhotoTypeID
}
func (*PrivacyKeyProfilePhoto ) TypeName () string {
return "privacyKeyProfilePhoto"
}
func (p *PrivacyKeyProfilePhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyProfilePhoto" ,
ID : PrivacyKeyProfilePhotoTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyProfilePhoto ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyProfilePhoto#96151fed as nil" )
}
b .PutID (PrivacyKeyProfilePhotoTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyProfilePhoto ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyProfilePhoto#96151fed as nil" )
}
return nil
}
func (p *PrivacyKeyProfilePhoto ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyProfilePhoto#96151fed to nil" )
}
if err := b .ConsumeID (PrivacyKeyProfilePhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyProfilePhoto#96151fed: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyProfilePhoto ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyProfilePhoto#96151fed to nil" )
}
return nil
}
type PrivacyKeyPhoneNumber struct {
}
const PrivacyKeyPhoneNumberTypeID = 0xd19ae46d
func (p PrivacyKeyPhoneNumber ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyPhoneNumber {}
_ bin .Decoder = &PrivacyKeyPhoneNumber {}
_ bin .BareEncoder = &PrivacyKeyPhoneNumber {}
_ bin .BareDecoder = &PrivacyKeyPhoneNumber {}
_ PrivacyKeyClass = &PrivacyKeyPhoneNumber {}
)
func (p *PrivacyKeyPhoneNumber ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyPhoneNumber ) String () string {
if p == nil {
return "PrivacyKeyPhoneNumber(nil)"
}
type Alias PrivacyKeyPhoneNumber
return fmt .Sprintf ("PrivacyKeyPhoneNumber%+v" , Alias (*p ))
}
func (*PrivacyKeyPhoneNumber ) TypeID () uint32 {
return PrivacyKeyPhoneNumberTypeID
}
func (*PrivacyKeyPhoneNumber ) TypeName () string {
return "privacyKeyPhoneNumber"
}
func (p *PrivacyKeyPhoneNumber ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyPhoneNumber" ,
ID : PrivacyKeyPhoneNumberTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyPhoneNumber ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneNumber#d19ae46d as nil" )
}
b .PutID (PrivacyKeyPhoneNumberTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyPhoneNumber ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyPhoneNumber#d19ae46d as nil" )
}
return nil
}
func (p *PrivacyKeyPhoneNumber ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneNumber#d19ae46d to nil" )
}
if err := b .ConsumeID (PrivacyKeyPhoneNumberTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyPhoneNumber#d19ae46d: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyPhoneNumber ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyPhoneNumber#d19ae46d to nil" )
}
return nil
}
type PrivacyKeyAddedByPhone struct {
}
const PrivacyKeyAddedByPhoneTypeID = 0x42ffd42b
func (p PrivacyKeyAddedByPhone ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyAddedByPhone {}
_ bin .Decoder = &PrivacyKeyAddedByPhone {}
_ bin .BareEncoder = &PrivacyKeyAddedByPhone {}
_ bin .BareDecoder = &PrivacyKeyAddedByPhone {}
_ PrivacyKeyClass = &PrivacyKeyAddedByPhone {}
)
func (p *PrivacyKeyAddedByPhone ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyAddedByPhone ) String () string {
if p == nil {
return "PrivacyKeyAddedByPhone(nil)"
}
type Alias PrivacyKeyAddedByPhone
return fmt .Sprintf ("PrivacyKeyAddedByPhone%+v" , Alias (*p ))
}
func (*PrivacyKeyAddedByPhone ) TypeID () uint32 {
return PrivacyKeyAddedByPhoneTypeID
}
func (*PrivacyKeyAddedByPhone ) TypeName () string {
return "privacyKeyAddedByPhone"
}
func (p *PrivacyKeyAddedByPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyAddedByPhone" ,
ID : PrivacyKeyAddedByPhoneTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyAddedByPhone ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyAddedByPhone#42ffd42b as nil" )
}
b .PutID (PrivacyKeyAddedByPhoneTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyAddedByPhone ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyAddedByPhone#42ffd42b as nil" )
}
return nil
}
func (p *PrivacyKeyAddedByPhone ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyAddedByPhone#42ffd42b to nil" )
}
if err := b .ConsumeID (PrivacyKeyAddedByPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyAddedByPhone#42ffd42b: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyAddedByPhone ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyAddedByPhone#42ffd42b to nil" )
}
return nil
}
type PrivacyKeyVoiceMessages struct {
}
const PrivacyKeyVoiceMessagesTypeID = 0x697f414
func (p PrivacyKeyVoiceMessages ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyVoiceMessages {}
_ bin .Decoder = &PrivacyKeyVoiceMessages {}
_ bin .BareEncoder = &PrivacyKeyVoiceMessages {}
_ bin .BareDecoder = &PrivacyKeyVoiceMessages {}
_ PrivacyKeyClass = &PrivacyKeyVoiceMessages {}
)
func (p *PrivacyKeyVoiceMessages ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyVoiceMessages ) String () string {
if p == nil {
return "PrivacyKeyVoiceMessages(nil)"
}
type Alias PrivacyKeyVoiceMessages
return fmt .Sprintf ("PrivacyKeyVoiceMessages%+v" , Alias (*p ))
}
func (*PrivacyKeyVoiceMessages ) TypeID () uint32 {
return PrivacyKeyVoiceMessagesTypeID
}
func (*PrivacyKeyVoiceMessages ) TypeName () string {
return "privacyKeyVoiceMessages"
}
func (p *PrivacyKeyVoiceMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyVoiceMessages" ,
ID : PrivacyKeyVoiceMessagesTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyVoiceMessages ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyVoiceMessages#697f414 as nil" )
}
b .PutID (PrivacyKeyVoiceMessagesTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyVoiceMessages ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyVoiceMessages#697f414 as nil" )
}
return nil
}
func (p *PrivacyKeyVoiceMessages ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyVoiceMessages#697f414 to nil" )
}
if err := b .ConsumeID (PrivacyKeyVoiceMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyVoiceMessages#697f414: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyVoiceMessages ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyVoiceMessages#697f414 to nil" )
}
return nil
}
type PrivacyKeyAbout struct {
}
const PrivacyKeyAboutTypeID = 0xa486b761
func (p PrivacyKeyAbout ) construct () PrivacyKeyClass { return &p }
var (
_ bin .Encoder = &PrivacyKeyAbout {}
_ bin .Decoder = &PrivacyKeyAbout {}
_ bin .BareEncoder = &PrivacyKeyAbout {}
_ bin .BareDecoder = &PrivacyKeyAbout {}
_ PrivacyKeyClass = &PrivacyKeyAbout {}
)
func (p *PrivacyKeyAbout ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PrivacyKeyAbout ) String () string {
if p == nil {
return "PrivacyKeyAbout(nil)"
}
type Alias PrivacyKeyAbout
return fmt .Sprintf ("PrivacyKeyAbout%+v" , Alias (*p ))
}
func (*PrivacyKeyAbout ) TypeID () uint32 {
return PrivacyKeyAboutTypeID
}
func (*PrivacyKeyAbout ) TypeName () string {
return "privacyKeyAbout"
}
func (p *PrivacyKeyAbout ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "privacyKeyAbout" ,
ID : PrivacyKeyAboutTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PrivacyKeyAbout ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyAbout#a486b761 as nil" )
}
b .PutID (PrivacyKeyAboutTypeID )
return p .EncodeBare (b )
}
func (p *PrivacyKeyAbout ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode privacyKeyAbout#a486b761 as nil" )
}
return nil
}
func (p *PrivacyKeyAbout ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyAbout#a486b761 to nil" )
}
if err := b .ConsumeID (PrivacyKeyAboutTypeID ); err != nil {
return fmt .Errorf ("unable to decode privacyKeyAbout#a486b761: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PrivacyKeyAbout ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode privacyKeyAbout#a486b761 to nil" )
}
return nil
}
const PrivacyKeyClassName = "PrivacyKey"
type PrivacyKeyClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () PrivacyKeyClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodePrivacyKey (buf *bin .Buffer ) (PrivacyKeyClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case PrivacyKeyStatusTimestampTypeID :
v := PrivacyKeyStatusTimestamp {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyChatInviteTypeID :
v := PrivacyKeyChatInvite {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyPhoneCallTypeID :
v := PrivacyKeyPhoneCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyPhoneP2PTypeID :
v := PrivacyKeyPhoneP2P {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyForwardsTypeID :
v := PrivacyKeyForwards {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyProfilePhotoTypeID :
v := PrivacyKeyProfilePhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyPhoneNumberTypeID :
v := PrivacyKeyPhoneNumber {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyAddedByPhoneTypeID :
v := PrivacyKeyAddedByPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyVoiceMessagesTypeID :
v := PrivacyKeyVoiceMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
case PrivacyKeyAboutTypeID :
v := PrivacyKeyAbout {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode PrivacyKeyClass: %w" , bin .NewUnexpectedID (id ))
}
}
type PrivacyKeyBox struct {
PrivacyKey PrivacyKeyClass
}
func (b *PrivacyKeyBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode PrivacyKeyBox to nil" )
}
v , err := DecodePrivacyKey (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .PrivacyKey = v
return nil
}
func (b *PrivacyKeyBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .PrivacyKey == nil {
return fmt .Errorf ("unable to encode PrivacyKeyClass as nil" )
}
return b .PrivacyKey .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 .