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 InputPrivacyKeyStatusTimestamp struct {
}
const InputPrivacyKeyStatusTimestampTypeID = 0x4f96cb18
func (i InputPrivacyKeyStatusTimestamp ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyStatusTimestamp {}
_ bin .Decoder = &InputPrivacyKeyStatusTimestamp {}
_ bin .BareEncoder = &InputPrivacyKeyStatusTimestamp {}
_ bin .BareDecoder = &InputPrivacyKeyStatusTimestamp {}
_ InputPrivacyKeyClass = &InputPrivacyKeyStatusTimestamp {}
)
func (i *InputPrivacyKeyStatusTimestamp ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyStatusTimestamp ) String () string {
if i == nil {
return "InputPrivacyKeyStatusTimestamp(nil)"
}
type Alias InputPrivacyKeyStatusTimestamp
return fmt .Sprintf ("InputPrivacyKeyStatusTimestamp%+v" , Alias (*i ))
}
func (*InputPrivacyKeyStatusTimestamp ) TypeID () uint32 {
return InputPrivacyKeyStatusTimestampTypeID
}
func (*InputPrivacyKeyStatusTimestamp ) TypeName () string {
return "inputPrivacyKeyStatusTimestamp"
}
func (i *InputPrivacyKeyStatusTimestamp ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyStatusTimestamp" ,
ID : InputPrivacyKeyStatusTimestampTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyStatusTimestamp ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyStatusTimestamp#4f96cb18 as nil" )
}
b .PutID (InputPrivacyKeyStatusTimestampTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyStatusTimestamp ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyStatusTimestamp#4f96cb18 as nil" )
}
return nil
}
func (i *InputPrivacyKeyStatusTimestamp ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyStatusTimestamp#4f96cb18 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyStatusTimestampTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyStatusTimestamp#4f96cb18: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyStatusTimestamp ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyStatusTimestamp#4f96cb18 to nil" )
}
return nil
}
type InputPrivacyKeyChatInvite struct {
}
const InputPrivacyKeyChatInviteTypeID = 0xbdfb0426
func (i InputPrivacyKeyChatInvite ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyChatInvite {}
_ bin .Decoder = &InputPrivacyKeyChatInvite {}
_ bin .BareEncoder = &InputPrivacyKeyChatInvite {}
_ bin .BareDecoder = &InputPrivacyKeyChatInvite {}
_ InputPrivacyKeyClass = &InputPrivacyKeyChatInvite {}
)
func (i *InputPrivacyKeyChatInvite ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyChatInvite ) String () string {
if i == nil {
return "InputPrivacyKeyChatInvite(nil)"
}
type Alias InputPrivacyKeyChatInvite
return fmt .Sprintf ("InputPrivacyKeyChatInvite%+v" , Alias (*i ))
}
func (*InputPrivacyKeyChatInvite ) TypeID () uint32 {
return InputPrivacyKeyChatInviteTypeID
}
func (*InputPrivacyKeyChatInvite ) TypeName () string {
return "inputPrivacyKeyChatInvite"
}
func (i *InputPrivacyKeyChatInvite ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyChatInvite" ,
ID : InputPrivacyKeyChatInviteTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyChatInvite ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyChatInvite#bdfb0426 as nil" )
}
b .PutID (InputPrivacyKeyChatInviteTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyChatInvite ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyChatInvite#bdfb0426 as nil" )
}
return nil
}
func (i *InputPrivacyKeyChatInvite ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyChatInvite#bdfb0426 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyChatInviteTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyChatInvite#bdfb0426: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyChatInvite ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyChatInvite#bdfb0426 to nil" )
}
return nil
}
type InputPrivacyKeyPhoneCall struct {
}
const InputPrivacyKeyPhoneCallTypeID = 0xfabadc5f
func (i InputPrivacyKeyPhoneCall ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyPhoneCall {}
_ bin .Decoder = &InputPrivacyKeyPhoneCall {}
_ bin .BareEncoder = &InputPrivacyKeyPhoneCall {}
_ bin .BareDecoder = &InputPrivacyKeyPhoneCall {}
_ InputPrivacyKeyClass = &InputPrivacyKeyPhoneCall {}
)
func (i *InputPrivacyKeyPhoneCall ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyPhoneCall ) String () string {
if i == nil {
return "InputPrivacyKeyPhoneCall(nil)"
}
type Alias InputPrivacyKeyPhoneCall
return fmt .Sprintf ("InputPrivacyKeyPhoneCall%+v" , Alias (*i ))
}
func (*InputPrivacyKeyPhoneCall ) TypeID () uint32 {
return InputPrivacyKeyPhoneCallTypeID
}
func (*InputPrivacyKeyPhoneCall ) TypeName () string {
return "inputPrivacyKeyPhoneCall"
}
func (i *InputPrivacyKeyPhoneCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyPhoneCall" ,
ID : InputPrivacyKeyPhoneCallTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyPhoneCall ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneCall#fabadc5f as nil" )
}
b .PutID (InputPrivacyKeyPhoneCallTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyPhoneCall ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneCall#fabadc5f as nil" )
}
return nil
}
func (i *InputPrivacyKeyPhoneCall ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneCall#fabadc5f to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyPhoneCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyPhoneCall#fabadc5f: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyPhoneCall ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneCall#fabadc5f to nil" )
}
return nil
}
type InputPrivacyKeyPhoneP2P struct {
}
const InputPrivacyKeyPhoneP2PTypeID = 0xdb9e70d2
func (i InputPrivacyKeyPhoneP2P ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyPhoneP2P {}
_ bin .Decoder = &InputPrivacyKeyPhoneP2P {}
_ bin .BareEncoder = &InputPrivacyKeyPhoneP2P {}
_ bin .BareDecoder = &InputPrivacyKeyPhoneP2P {}
_ InputPrivacyKeyClass = &InputPrivacyKeyPhoneP2P {}
)
func (i *InputPrivacyKeyPhoneP2P ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyPhoneP2P ) String () string {
if i == nil {
return "InputPrivacyKeyPhoneP2P(nil)"
}
type Alias InputPrivacyKeyPhoneP2P
return fmt .Sprintf ("InputPrivacyKeyPhoneP2P%+v" , Alias (*i ))
}
func (*InputPrivacyKeyPhoneP2P ) TypeID () uint32 {
return InputPrivacyKeyPhoneP2PTypeID
}
func (*InputPrivacyKeyPhoneP2P ) TypeName () string {
return "inputPrivacyKeyPhoneP2P"
}
func (i *InputPrivacyKeyPhoneP2P ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyPhoneP2P" ,
ID : InputPrivacyKeyPhoneP2PTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyPhoneP2P ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneP2P#db9e70d2 as nil" )
}
b .PutID (InputPrivacyKeyPhoneP2PTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyPhoneP2P ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneP2P#db9e70d2 as nil" )
}
return nil
}
func (i *InputPrivacyKeyPhoneP2P ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneP2P#db9e70d2 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyPhoneP2PTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyPhoneP2P#db9e70d2: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyPhoneP2P ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneP2P#db9e70d2 to nil" )
}
return nil
}
type InputPrivacyKeyForwards struct {
}
const InputPrivacyKeyForwardsTypeID = 0xa4dd4c08
func (i InputPrivacyKeyForwards ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyForwards {}
_ bin .Decoder = &InputPrivacyKeyForwards {}
_ bin .BareEncoder = &InputPrivacyKeyForwards {}
_ bin .BareDecoder = &InputPrivacyKeyForwards {}
_ InputPrivacyKeyClass = &InputPrivacyKeyForwards {}
)
func (i *InputPrivacyKeyForwards ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyForwards ) String () string {
if i == nil {
return "InputPrivacyKeyForwards(nil)"
}
type Alias InputPrivacyKeyForwards
return fmt .Sprintf ("InputPrivacyKeyForwards%+v" , Alias (*i ))
}
func (*InputPrivacyKeyForwards ) TypeID () uint32 {
return InputPrivacyKeyForwardsTypeID
}
func (*InputPrivacyKeyForwards ) TypeName () string {
return "inputPrivacyKeyForwards"
}
func (i *InputPrivacyKeyForwards ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyForwards" ,
ID : InputPrivacyKeyForwardsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyForwards ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyForwards#a4dd4c08 as nil" )
}
b .PutID (InputPrivacyKeyForwardsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyForwards ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyForwards#a4dd4c08 as nil" )
}
return nil
}
func (i *InputPrivacyKeyForwards ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyForwards#a4dd4c08 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyForwardsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyForwards#a4dd4c08: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyForwards ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyForwards#a4dd4c08 to nil" )
}
return nil
}
type InputPrivacyKeyProfilePhoto struct {
}
const InputPrivacyKeyProfilePhotoTypeID = 0x5719bacc
func (i InputPrivacyKeyProfilePhoto ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyProfilePhoto {}
_ bin .Decoder = &InputPrivacyKeyProfilePhoto {}
_ bin .BareEncoder = &InputPrivacyKeyProfilePhoto {}
_ bin .BareDecoder = &InputPrivacyKeyProfilePhoto {}
_ InputPrivacyKeyClass = &InputPrivacyKeyProfilePhoto {}
)
func (i *InputPrivacyKeyProfilePhoto ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyProfilePhoto ) String () string {
if i == nil {
return "InputPrivacyKeyProfilePhoto(nil)"
}
type Alias InputPrivacyKeyProfilePhoto
return fmt .Sprintf ("InputPrivacyKeyProfilePhoto%+v" , Alias (*i ))
}
func (*InputPrivacyKeyProfilePhoto ) TypeID () uint32 {
return InputPrivacyKeyProfilePhotoTypeID
}
func (*InputPrivacyKeyProfilePhoto ) TypeName () string {
return "inputPrivacyKeyProfilePhoto"
}
func (i *InputPrivacyKeyProfilePhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyProfilePhoto" ,
ID : InputPrivacyKeyProfilePhotoTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyProfilePhoto ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyProfilePhoto#5719bacc as nil" )
}
b .PutID (InputPrivacyKeyProfilePhotoTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyProfilePhoto ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyProfilePhoto#5719bacc as nil" )
}
return nil
}
func (i *InputPrivacyKeyProfilePhoto ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyProfilePhoto#5719bacc to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyProfilePhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyProfilePhoto#5719bacc: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyProfilePhoto ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyProfilePhoto#5719bacc to nil" )
}
return nil
}
type InputPrivacyKeyPhoneNumber struct {
}
const InputPrivacyKeyPhoneNumberTypeID = 0x352dafa
func (i InputPrivacyKeyPhoneNumber ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyPhoneNumber {}
_ bin .Decoder = &InputPrivacyKeyPhoneNumber {}
_ bin .BareEncoder = &InputPrivacyKeyPhoneNumber {}
_ bin .BareDecoder = &InputPrivacyKeyPhoneNumber {}
_ InputPrivacyKeyClass = &InputPrivacyKeyPhoneNumber {}
)
func (i *InputPrivacyKeyPhoneNumber ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyPhoneNumber ) String () string {
if i == nil {
return "InputPrivacyKeyPhoneNumber(nil)"
}
type Alias InputPrivacyKeyPhoneNumber
return fmt .Sprintf ("InputPrivacyKeyPhoneNumber%+v" , Alias (*i ))
}
func (*InputPrivacyKeyPhoneNumber ) TypeID () uint32 {
return InputPrivacyKeyPhoneNumberTypeID
}
func (*InputPrivacyKeyPhoneNumber ) TypeName () string {
return "inputPrivacyKeyPhoneNumber"
}
func (i *InputPrivacyKeyPhoneNumber ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyPhoneNumber" ,
ID : InputPrivacyKeyPhoneNumberTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyPhoneNumber ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneNumber#352dafa as nil" )
}
b .PutID (InputPrivacyKeyPhoneNumberTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyPhoneNumber ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyPhoneNumber#352dafa as nil" )
}
return nil
}
func (i *InputPrivacyKeyPhoneNumber ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneNumber#352dafa to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyPhoneNumberTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyPhoneNumber#352dafa: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyPhoneNumber ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyPhoneNumber#352dafa to nil" )
}
return nil
}
type InputPrivacyKeyAddedByPhone struct {
}
const InputPrivacyKeyAddedByPhoneTypeID = 0xd1219bdd
func (i InputPrivacyKeyAddedByPhone ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyAddedByPhone {}
_ bin .Decoder = &InputPrivacyKeyAddedByPhone {}
_ bin .BareEncoder = &InputPrivacyKeyAddedByPhone {}
_ bin .BareDecoder = &InputPrivacyKeyAddedByPhone {}
_ InputPrivacyKeyClass = &InputPrivacyKeyAddedByPhone {}
)
func (i *InputPrivacyKeyAddedByPhone ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyAddedByPhone ) String () string {
if i == nil {
return "InputPrivacyKeyAddedByPhone(nil)"
}
type Alias InputPrivacyKeyAddedByPhone
return fmt .Sprintf ("InputPrivacyKeyAddedByPhone%+v" , Alias (*i ))
}
func (*InputPrivacyKeyAddedByPhone ) TypeID () uint32 {
return InputPrivacyKeyAddedByPhoneTypeID
}
func (*InputPrivacyKeyAddedByPhone ) TypeName () string {
return "inputPrivacyKeyAddedByPhone"
}
func (i *InputPrivacyKeyAddedByPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyAddedByPhone" ,
ID : InputPrivacyKeyAddedByPhoneTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyAddedByPhone ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyAddedByPhone#d1219bdd as nil" )
}
b .PutID (InputPrivacyKeyAddedByPhoneTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyAddedByPhone ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyAddedByPhone#d1219bdd as nil" )
}
return nil
}
func (i *InputPrivacyKeyAddedByPhone ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyAddedByPhone#d1219bdd to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyAddedByPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyAddedByPhone#d1219bdd: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyAddedByPhone ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyAddedByPhone#d1219bdd to nil" )
}
return nil
}
type InputPrivacyKeyVoiceMessages struct {
}
const InputPrivacyKeyVoiceMessagesTypeID = 0xaee69d68
func (i InputPrivacyKeyVoiceMessages ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyVoiceMessages {}
_ bin .Decoder = &InputPrivacyKeyVoiceMessages {}
_ bin .BareEncoder = &InputPrivacyKeyVoiceMessages {}
_ bin .BareDecoder = &InputPrivacyKeyVoiceMessages {}
_ InputPrivacyKeyClass = &InputPrivacyKeyVoiceMessages {}
)
func (i *InputPrivacyKeyVoiceMessages ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyVoiceMessages ) String () string {
if i == nil {
return "InputPrivacyKeyVoiceMessages(nil)"
}
type Alias InputPrivacyKeyVoiceMessages
return fmt .Sprintf ("InputPrivacyKeyVoiceMessages%+v" , Alias (*i ))
}
func (*InputPrivacyKeyVoiceMessages ) TypeID () uint32 {
return InputPrivacyKeyVoiceMessagesTypeID
}
func (*InputPrivacyKeyVoiceMessages ) TypeName () string {
return "inputPrivacyKeyVoiceMessages"
}
func (i *InputPrivacyKeyVoiceMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyVoiceMessages" ,
ID : InputPrivacyKeyVoiceMessagesTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyVoiceMessages ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyVoiceMessages#aee69d68 as nil" )
}
b .PutID (InputPrivacyKeyVoiceMessagesTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyVoiceMessages ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyVoiceMessages#aee69d68 as nil" )
}
return nil
}
func (i *InputPrivacyKeyVoiceMessages ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyVoiceMessages#aee69d68 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyVoiceMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyVoiceMessages#aee69d68: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyVoiceMessages ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyVoiceMessages#aee69d68 to nil" )
}
return nil
}
type InputPrivacyKeyAbout struct {
}
const InputPrivacyKeyAboutTypeID = 0x3823cc40
func (i InputPrivacyKeyAbout ) construct () InputPrivacyKeyClass { return &i }
var (
_ bin .Encoder = &InputPrivacyKeyAbout {}
_ bin .Decoder = &InputPrivacyKeyAbout {}
_ bin .BareEncoder = &InputPrivacyKeyAbout {}
_ bin .BareDecoder = &InputPrivacyKeyAbout {}
_ InputPrivacyKeyClass = &InputPrivacyKeyAbout {}
)
func (i *InputPrivacyKeyAbout ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyKeyAbout ) String () string {
if i == nil {
return "InputPrivacyKeyAbout(nil)"
}
type Alias InputPrivacyKeyAbout
return fmt .Sprintf ("InputPrivacyKeyAbout%+v" , Alias (*i ))
}
func (*InputPrivacyKeyAbout ) TypeID () uint32 {
return InputPrivacyKeyAboutTypeID
}
func (*InputPrivacyKeyAbout ) TypeName () string {
return "inputPrivacyKeyAbout"
}
func (i *InputPrivacyKeyAbout ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyKeyAbout" ,
ID : InputPrivacyKeyAboutTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyKeyAbout ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyAbout#3823cc40 as nil" )
}
b .PutID (InputPrivacyKeyAboutTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyKeyAbout ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyKeyAbout#3823cc40 as nil" )
}
return nil
}
func (i *InputPrivacyKeyAbout ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyAbout#3823cc40 to nil" )
}
if err := b .ConsumeID (InputPrivacyKeyAboutTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyKeyAbout#3823cc40: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyKeyAbout ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyKeyAbout#3823cc40 to nil" )
}
return nil
}
const InputPrivacyKeyClassName = "InputPrivacyKey"
type InputPrivacyKeyClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputPrivacyKeyClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeInputPrivacyKey (buf *bin .Buffer ) (InputPrivacyKeyClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputPrivacyKeyStatusTimestampTypeID :
v := InputPrivacyKeyStatusTimestamp {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyChatInviteTypeID :
v := InputPrivacyKeyChatInvite {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyPhoneCallTypeID :
v := InputPrivacyKeyPhoneCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyPhoneP2PTypeID :
v := InputPrivacyKeyPhoneP2P {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyForwardsTypeID :
v := InputPrivacyKeyForwards {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyProfilePhotoTypeID :
v := InputPrivacyKeyProfilePhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyPhoneNumberTypeID :
v := InputPrivacyKeyPhoneNumber {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyAddedByPhoneTypeID :
v := InputPrivacyKeyAddedByPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyVoiceMessagesTypeID :
v := InputPrivacyKeyVoiceMessages {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
case InputPrivacyKeyAboutTypeID :
v := InputPrivacyKeyAbout {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputPrivacyKeyClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputPrivacyKeyBox struct {
InputPrivacyKey InputPrivacyKeyClass
}
func (b *InputPrivacyKeyBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputPrivacyKeyBox to nil" )
}
v , err := DecodeInputPrivacyKey (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputPrivacyKey = v
return nil
}
func (b *InputPrivacyKeyBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputPrivacyKey == nil {
return fmt .Errorf ("unable to encode InputPrivacyKeyClass as nil" )
}
return b .InputPrivacyKey .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 .