// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// PrivacyKeyStatusTimestamp represents TL type `privacyKeyStatusTimestamp#bc2eab30`.
// Whether we can see the last online timestamp of this user
//
// See https://core.telegram.org/constructor/privacyKeyStatusTimestamp for reference.
type PrivacyKeyStatusTimestamp struct {
}

// PrivacyKeyStatusTimestampTypeID is TL type id of PrivacyKeyStatusTimestamp.
const PrivacyKeyStatusTimestampTypeID = 0xbc2eab30

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyStatusTimestamp) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyStatusTimestamp.
var (
	_ bin.Encoder     = &PrivacyKeyStatusTimestamp{}
	_ bin.Decoder     = &PrivacyKeyStatusTimestamp{}
	_ bin.BareEncoder = &PrivacyKeyStatusTimestamp{}
	_ bin.BareDecoder = &PrivacyKeyStatusTimestamp{}

	_ PrivacyKeyClass = &PrivacyKeyStatusTimestamp{}
)

func ( *PrivacyKeyStatusTimestamp) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyStatusTimestamp) () string {
	if  == nil {
		return "PrivacyKeyStatusTimestamp(nil)"
	}
	type  PrivacyKeyStatusTimestamp
	return fmt.Sprintf("PrivacyKeyStatusTimestamp%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyStatusTimestamp) () uint32 {
	return PrivacyKeyStatusTimestampTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyStatusTimestamp) () string {
	return "privacyKeyStatusTimestamp"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyStatusTimestamp) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyStatusTimestamp",
		ID:   PrivacyKeyStatusTimestampTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyStatusTimestamp) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyStatusTimestamp#bc2eab30 as nil")
	}
	.PutID(PrivacyKeyStatusTimestampTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyStatusTimestamp) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyStatusTimestamp#bc2eab30 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyStatusTimestamp) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyStatusTimestamp#bc2eab30 to nil")
	}
	if  := .ConsumeID(PrivacyKeyStatusTimestampTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyStatusTimestamp#bc2eab30: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyStatusTimestamp) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyStatusTimestamp#bc2eab30 to nil")
	}
	return nil
}

// PrivacyKeyChatInvite represents TL type `privacyKeyChatInvite#500e6dfa`.
// Whether the user can be invited to chats
//
// See https://core.telegram.org/constructor/privacyKeyChatInvite for reference.
type PrivacyKeyChatInvite struct {
}

// PrivacyKeyChatInviteTypeID is TL type id of PrivacyKeyChatInvite.
const PrivacyKeyChatInviteTypeID = 0x500e6dfa

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyChatInvite) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyChatInvite.
var (
	_ bin.Encoder     = &PrivacyKeyChatInvite{}
	_ bin.Decoder     = &PrivacyKeyChatInvite{}
	_ bin.BareEncoder = &PrivacyKeyChatInvite{}
	_ bin.BareDecoder = &PrivacyKeyChatInvite{}

	_ PrivacyKeyClass = &PrivacyKeyChatInvite{}
)

func ( *PrivacyKeyChatInvite) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyChatInvite) () string {
	if  == nil {
		return "PrivacyKeyChatInvite(nil)"
	}
	type  PrivacyKeyChatInvite
	return fmt.Sprintf("PrivacyKeyChatInvite%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyChatInvite) () uint32 {
	return PrivacyKeyChatInviteTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyChatInvite) () string {
	return "privacyKeyChatInvite"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyChatInvite) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyChatInvite",
		ID:   PrivacyKeyChatInviteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyChatInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyChatInvite#500e6dfa as nil")
	}
	.PutID(PrivacyKeyChatInviteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyChatInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyChatInvite#500e6dfa as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyChatInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyChatInvite#500e6dfa to nil")
	}
	if  := .ConsumeID(PrivacyKeyChatInviteTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyChatInvite#500e6dfa: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyChatInvite) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyChatInvite#500e6dfa to nil")
	}
	return nil
}

// PrivacyKeyPhoneCall represents TL type `privacyKeyPhoneCall#3d662b7b`.
// Whether the user accepts phone calls
//
// See https://core.telegram.org/constructor/privacyKeyPhoneCall for reference.
type PrivacyKeyPhoneCall struct {
}

// PrivacyKeyPhoneCallTypeID is TL type id of PrivacyKeyPhoneCall.
const PrivacyKeyPhoneCallTypeID = 0x3d662b7b

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyPhoneCall) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyPhoneCall.
var (
	_ bin.Encoder     = &PrivacyKeyPhoneCall{}
	_ bin.Decoder     = &PrivacyKeyPhoneCall{}
	_ bin.BareEncoder = &PrivacyKeyPhoneCall{}
	_ bin.BareDecoder = &PrivacyKeyPhoneCall{}

	_ PrivacyKeyClass = &PrivacyKeyPhoneCall{}
)

func ( *PrivacyKeyPhoneCall) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyPhoneCall) () string {
	if  == nil {
		return "PrivacyKeyPhoneCall(nil)"
	}
	type  PrivacyKeyPhoneCall
	return fmt.Sprintf("PrivacyKeyPhoneCall%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyPhoneCall) () uint32 {
	return PrivacyKeyPhoneCallTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyPhoneCall) () string {
	return "privacyKeyPhoneCall"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyPhoneCall) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyPhoneCall",
		ID:   PrivacyKeyPhoneCallTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneCall#3d662b7b as nil")
	}
	.PutID(PrivacyKeyPhoneCallTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneCall#3d662b7b as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneCall#3d662b7b to nil")
	}
	if  := .ConsumeID(PrivacyKeyPhoneCallTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyPhoneCall#3d662b7b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyPhoneCall) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneCall#3d662b7b to nil")
	}
	return nil
}

// PrivacyKeyPhoneP2P represents TL type `privacyKeyPhoneP2P#39491cc8`.
// Whether P2P connections in phone calls with this user are allowed
//
// See https://core.telegram.org/constructor/privacyKeyPhoneP2P for reference.
type PrivacyKeyPhoneP2P struct {
}

// PrivacyKeyPhoneP2PTypeID is TL type id of PrivacyKeyPhoneP2P.
const PrivacyKeyPhoneP2PTypeID = 0x39491cc8

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyPhoneP2P) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyPhoneP2P.
var (
	_ bin.Encoder     = &PrivacyKeyPhoneP2P{}
	_ bin.Decoder     = &PrivacyKeyPhoneP2P{}
	_ bin.BareEncoder = &PrivacyKeyPhoneP2P{}
	_ bin.BareDecoder = &PrivacyKeyPhoneP2P{}

	_ PrivacyKeyClass = &PrivacyKeyPhoneP2P{}
)

func ( *PrivacyKeyPhoneP2P) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyPhoneP2P) () string {
	if  == nil {
		return "PrivacyKeyPhoneP2P(nil)"
	}
	type  PrivacyKeyPhoneP2P
	return fmt.Sprintf("PrivacyKeyPhoneP2P%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyPhoneP2P) () uint32 {
	return PrivacyKeyPhoneP2PTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyPhoneP2P) () string {
	return "privacyKeyPhoneP2P"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyPhoneP2P) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyPhoneP2P",
		ID:   PrivacyKeyPhoneP2PTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyPhoneP2P) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneP2P#39491cc8 as nil")
	}
	.PutID(PrivacyKeyPhoneP2PTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyPhoneP2P) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneP2P#39491cc8 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyPhoneP2P) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneP2P#39491cc8 to nil")
	}
	if  := .ConsumeID(PrivacyKeyPhoneP2PTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyPhoneP2P#39491cc8: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyPhoneP2P) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneP2P#39491cc8 to nil")
	}
	return nil
}

// PrivacyKeyForwards represents TL type `privacyKeyForwards#69ec56a3`.
// Whether messages forwarded from the user will be anonymously forwarded¹
//
// Links:
//  1. https://telegram.org/blog/unsend-privacy-emoji#anonymous-forwarding
//
// See https://core.telegram.org/constructor/privacyKeyForwards for reference.
type PrivacyKeyForwards struct {
}

// PrivacyKeyForwardsTypeID is TL type id of PrivacyKeyForwards.
const PrivacyKeyForwardsTypeID = 0x69ec56a3

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyForwards) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyForwards.
var (
	_ bin.Encoder     = &PrivacyKeyForwards{}
	_ bin.Decoder     = &PrivacyKeyForwards{}
	_ bin.BareEncoder = &PrivacyKeyForwards{}
	_ bin.BareDecoder = &PrivacyKeyForwards{}

	_ PrivacyKeyClass = &PrivacyKeyForwards{}
)

func ( *PrivacyKeyForwards) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyForwards) () string {
	if  == nil {
		return "PrivacyKeyForwards(nil)"
	}
	type  PrivacyKeyForwards
	return fmt.Sprintf("PrivacyKeyForwards%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyForwards) () uint32 {
	return PrivacyKeyForwardsTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyForwards) () string {
	return "privacyKeyForwards"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyForwards) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyForwards",
		ID:   PrivacyKeyForwardsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyForwards#69ec56a3 as nil")
	}
	.PutID(PrivacyKeyForwardsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyForwards#69ec56a3 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyForwards#69ec56a3 to nil")
	}
	if  := .ConsumeID(PrivacyKeyForwardsTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyForwards#69ec56a3: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyForwards) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyForwards#69ec56a3 to nil")
	}
	return nil
}

// PrivacyKeyProfilePhoto represents TL type `privacyKeyProfilePhoto#96151fed`.
// Whether the profile picture of the user is visible
//
// See https://core.telegram.org/constructor/privacyKeyProfilePhoto for reference.
type PrivacyKeyProfilePhoto struct {
}

// PrivacyKeyProfilePhotoTypeID is TL type id of PrivacyKeyProfilePhoto.
const PrivacyKeyProfilePhotoTypeID = 0x96151fed

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyProfilePhoto) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyProfilePhoto.
var (
	_ bin.Encoder     = &PrivacyKeyProfilePhoto{}
	_ bin.Decoder     = &PrivacyKeyProfilePhoto{}
	_ bin.BareEncoder = &PrivacyKeyProfilePhoto{}
	_ bin.BareDecoder = &PrivacyKeyProfilePhoto{}

	_ PrivacyKeyClass = &PrivacyKeyProfilePhoto{}
)

func ( *PrivacyKeyProfilePhoto) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyProfilePhoto) () string {
	if  == nil {
		return "PrivacyKeyProfilePhoto(nil)"
	}
	type  PrivacyKeyProfilePhoto
	return fmt.Sprintf("PrivacyKeyProfilePhoto%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyProfilePhoto) () uint32 {
	return PrivacyKeyProfilePhotoTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyProfilePhoto) () string {
	return "privacyKeyProfilePhoto"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyProfilePhoto) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyProfilePhoto",
		ID:   PrivacyKeyProfilePhotoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyProfilePhoto#96151fed as nil")
	}
	.PutID(PrivacyKeyProfilePhotoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyProfilePhoto#96151fed as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyProfilePhoto#96151fed to nil")
	}
	if  := .ConsumeID(PrivacyKeyProfilePhotoTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyProfilePhoto#96151fed: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyProfilePhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyProfilePhoto#96151fed to nil")
	}
	return nil
}

// PrivacyKeyPhoneNumber represents TL type `privacyKeyPhoneNumber#d19ae46d`.
// Whether the user allows us to see his phone number
//
// See https://core.telegram.org/constructor/privacyKeyPhoneNumber for reference.
type PrivacyKeyPhoneNumber struct {
}

// PrivacyKeyPhoneNumberTypeID is TL type id of PrivacyKeyPhoneNumber.
const PrivacyKeyPhoneNumberTypeID = 0xd19ae46d

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyPhoneNumber) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyPhoneNumber.
var (
	_ bin.Encoder     = &PrivacyKeyPhoneNumber{}
	_ bin.Decoder     = &PrivacyKeyPhoneNumber{}
	_ bin.BareEncoder = &PrivacyKeyPhoneNumber{}
	_ bin.BareDecoder = &PrivacyKeyPhoneNumber{}

	_ PrivacyKeyClass = &PrivacyKeyPhoneNumber{}
)

func ( *PrivacyKeyPhoneNumber) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyPhoneNumber) () string {
	if  == nil {
		return "PrivacyKeyPhoneNumber(nil)"
	}
	type  PrivacyKeyPhoneNumber
	return fmt.Sprintf("PrivacyKeyPhoneNumber%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyPhoneNumber) () uint32 {
	return PrivacyKeyPhoneNumberTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyPhoneNumber) () string {
	return "privacyKeyPhoneNumber"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyPhoneNumber) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyPhoneNumber",
		ID:   PrivacyKeyPhoneNumberTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyPhoneNumber) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneNumber#d19ae46d as nil")
	}
	.PutID(PrivacyKeyPhoneNumberTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyPhoneNumber) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyPhoneNumber#d19ae46d as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyPhoneNumber) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneNumber#d19ae46d to nil")
	}
	if  := .ConsumeID(PrivacyKeyPhoneNumberTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyPhoneNumber#d19ae46d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyPhoneNumber) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyPhoneNumber#d19ae46d to nil")
	}
	return nil
}

// PrivacyKeyAddedByPhone represents TL type `privacyKeyAddedByPhone#42ffd42b`.
// Whether this user can be added to our contact list by their phone number
//
// See https://core.telegram.org/constructor/privacyKeyAddedByPhone for reference.
type PrivacyKeyAddedByPhone struct {
}

// PrivacyKeyAddedByPhoneTypeID is TL type id of PrivacyKeyAddedByPhone.
const PrivacyKeyAddedByPhoneTypeID = 0x42ffd42b

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyAddedByPhone) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyAddedByPhone.
var (
	_ bin.Encoder     = &PrivacyKeyAddedByPhone{}
	_ bin.Decoder     = &PrivacyKeyAddedByPhone{}
	_ bin.BareEncoder = &PrivacyKeyAddedByPhone{}
	_ bin.BareDecoder = &PrivacyKeyAddedByPhone{}

	_ PrivacyKeyClass = &PrivacyKeyAddedByPhone{}
)

func ( *PrivacyKeyAddedByPhone) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyAddedByPhone) () string {
	if  == nil {
		return "PrivacyKeyAddedByPhone(nil)"
	}
	type  PrivacyKeyAddedByPhone
	return fmt.Sprintf("PrivacyKeyAddedByPhone%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyAddedByPhone) () uint32 {
	return PrivacyKeyAddedByPhoneTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyAddedByPhone) () string {
	return "privacyKeyAddedByPhone"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyAddedByPhone) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyAddedByPhone",
		ID:   PrivacyKeyAddedByPhoneTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyAddedByPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyAddedByPhone#42ffd42b as nil")
	}
	.PutID(PrivacyKeyAddedByPhoneTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyAddedByPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyAddedByPhone#42ffd42b as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyAddedByPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyAddedByPhone#42ffd42b to nil")
	}
	if  := .ConsumeID(PrivacyKeyAddedByPhoneTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyAddedByPhone#42ffd42b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyAddedByPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyAddedByPhone#42ffd42b to nil")
	}
	return nil
}

// PrivacyKeyVoiceMessages represents TL type `privacyKeyVoiceMessages#697f414`.
// Whether the user accepts voice messages
//
// See https://core.telegram.org/constructor/privacyKeyVoiceMessages for reference.
type PrivacyKeyVoiceMessages struct {
}

// PrivacyKeyVoiceMessagesTypeID is TL type id of PrivacyKeyVoiceMessages.
const PrivacyKeyVoiceMessagesTypeID = 0x697f414

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyVoiceMessages) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyVoiceMessages.
var (
	_ bin.Encoder     = &PrivacyKeyVoiceMessages{}
	_ bin.Decoder     = &PrivacyKeyVoiceMessages{}
	_ bin.BareEncoder = &PrivacyKeyVoiceMessages{}
	_ bin.BareDecoder = &PrivacyKeyVoiceMessages{}

	_ PrivacyKeyClass = &PrivacyKeyVoiceMessages{}
)

func ( *PrivacyKeyVoiceMessages) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyVoiceMessages) () string {
	if  == nil {
		return "PrivacyKeyVoiceMessages(nil)"
	}
	type  PrivacyKeyVoiceMessages
	return fmt.Sprintf("PrivacyKeyVoiceMessages%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyVoiceMessages) () uint32 {
	return PrivacyKeyVoiceMessagesTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyVoiceMessages) () string {
	return "privacyKeyVoiceMessages"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyVoiceMessages) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyVoiceMessages",
		ID:   PrivacyKeyVoiceMessagesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyVoiceMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyVoiceMessages#697f414 as nil")
	}
	.PutID(PrivacyKeyVoiceMessagesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyVoiceMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyVoiceMessages#697f414 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyVoiceMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyVoiceMessages#697f414 to nil")
	}
	if  := .ConsumeID(PrivacyKeyVoiceMessagesTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyVoiceMessages#697f414: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyVoiceMessages) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyVoiceMessages#697f414 to nil")
	}
	return nil
}

// PrivacyKeyAbout represents TL type `privacyKeyAbout#a486b761`.
// Whether people can see your bio
//
// See https://core.telegram.org/constructor/privacyKeyAbout for reference.
type PrivacyKeyAbout struct {
}

// PrivacyKeyAboutTypeID is TL type id of PrivacyKeyAbout.
const PrivacyKeyAboutTypeID = 0xa486b761

// construct implements constructor of PrivacyKeyClass.
func ( PrivacyKeyAbout) () PrivacyKeyClass { return & }

// Ensuring interfaces in compile-time for PrivacyKeyAbout.
var (
	_ bin.Encoder     = &PrivacyKeyAbout{}
	_ bin.Decoder     = &PrivacyKeyAbout{}
	_ bin.BareEncoder = &PrivacyKeyAbout{}
	_ bin.BareDecoder = &PrivacyKeyAbout{}

	_ PrivacyKeyClass = &PrivacyKeyAbout{}
)

func ( *PrivacyKeyAbout) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *PrivacyKeyAbout) () string {
	if  == nil {
		return "PrivacyKeyAbout(nil)"
	}
	type  PrivacyKeyAbout
	return fmt.Sprintf("PrivacyKeyAbout%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*PrivacyKeyAbout) () uint32 {
	return PrivacyKeyAboutTypeID
}

// TypeName returns name of type in TL schema.
func (*PrivacyKeyAbout) () string {
	return "privacyKeyAbout"
}

// TypeInfo returns info about TL type.
func ( *PrivacyKeyAbout) () tdp.Type {
	 := tdp.Type{
		Name: "privacyKeyAbout",
		ID:   PrivacyKeyAboutTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PrivacyKeyAbout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyAbout#a486b761 as nil")
	}
	.PutID(PrivacyKeyAboutTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PrivacyKeyAbout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode privacyKeyAbout#a486b761 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PrivacyKeyAbout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyAbout#a486b761 to nil")
	}
	if  := .ConsumeID(PrivacyKeyAboutTypeID);  != nil {
		return fmt.Errorf("unable to decode privacyKeyAbout#a486b761: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PrivacyKeyAbout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode privacyKeyAbout#a486b761 to nil")
	}
	return nil
}

// PrivacyKeyClassName is schema name of PrivacyKeyClass.
const PrivacyKeyClassName = "PrivacyKey"

// PrivacyKeyClass represents PrivacyKey generic type.
//
// See https://core.telegram.org/type/PrivacyKey for reference.
//
// Example:
//
//	g, err := tg.DecodePrivacyKey(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.PrivacyKeyStatusTimestamp: // privacyKeyStatusTimestamp#bc2eab30
//	case *tg.PrivacyKeyChatInvite: // privacyKeyChatInvite#500e6dfa
//	case *tg.PrivacyKeyPhoneCall: // privacyKeyPhoneCall#3d662b7b
//	case *tg.PrivacyKeyPhoneP2P: // privacyKeyPhoneP2P#39491cc8
//	case *tg.PrivacyKeyForwards: // privacyKeyForwards#69ec56a3
//	case *tg.PrivacyKeyProfilePhoto: // privacyKeyProfilePhoto#96151fed
//	case *tg.PrivacyKeyPhoneNumber: // privacyKeyPhoneNumber#d19ae46d
//	case *tg.PrivacyKeyAddedByPhone: // privacyKeyAddedByPhone#42ffd42b
//	case *tg.PrivacyKeyVoiceMessages: // privacyKeyVoiceMessages#697f414
//	case *tg.PrivacyKeyAbout: // privacyKeyAbout#a486b761
//	default: panic(v)
//	}
type PrivacyKeyClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() PrivacyKeyClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool
}

// DecodePrivacyKey implements binary de-serialization for PrivacyKeyClass.
func ( *bin.Buffer) (PrivacyKeyClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case PrivacyKeyStatusTimestampTypeID:
		// Decoding privacyKeyStatusTimestamp#bc2eab30.
		 := PrivacyKeyStatusTimestamp{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyChatInviteTypeID:
		// Decoding privacyKeyChatInvite#500e6dfa.
		 := PrivacyKeyChatInvite{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyPhoneCallTypeID:
		// Decoding privacyKeyPhoneCall#3d662b7b.
		 := PrivacyKeyPhoneCall{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyPhoneP2PTypeID:
		// Decoding privacyKeyPhoneP2P#39491cc8.
		 := PrivacyKeyPhoneP2P{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyForwardsTypeID:
		// Decoding privacyKeyForwards#69ec56a3.
		 := PrivacyKeyForwards{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyProfilePhotoTypeID:
		// Decoding privacyKeyProfilePhoto#96151fed.
		 := PrivacyKeyProfilePhoto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyPhoneNumberTypeID:
		// Decoding privacyKeyPhoneNumber#d19ae46d.
		 := PrivacyKeyPhoneNumber{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyAddedByPhoneTypeID:
		// Decoding privacyKeyAddedByPhone#42ffd42b.
		 := PrivacyKeyAddedByPhone{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyVoiceMessagesTypeID:
		// Decoding privacyKeyVoiceMessages#697f414.
		 := PrivacyKeyVoiceMessages{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	case PrivacyKeyAboutTypeID:
		// Decoding privacyKeyAbout#a486b761.
		 := PrivacyKeyAbout{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode PrivacyKeyClass: %w", bin.NewUnexpectedID())
	}
}

// PrivacyKey boxes the PrivacyKeyClass providing a helper.
type PrivacyKeyBox struct {
	PrivacyKey PrivacyKeyClass
}

// Decode implements bin.Decoder for PrivacyKeyBox.
func ( *PrivacyKeyBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode PrivacyKeyBox to nil")
	}
	,  := DecodePrivacyKey()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.PrivacyKey = 
	return nil
}

// Encode implements bin.Encode for PrivacyKeyBox.
func ( *PrivacyKeyBox) ( *bin.Buffer) error {
	if  == nil || .PrivacyKey == nil {
		return fmt.Errorf("unable to encode PrivacyKeyClass as nil")
	}
	return .PrivacyKey.Encode()
}