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 InputPrivacyValueAllowContacts struct {
}
const InputPrivacyValueAllowContactsTypeID = 0xd09e07b
func (i InputPrivacyValueAllowContacts ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueAllowContacts {}
_ bin .Decoder = &InputPrivacyValueAllowContacts {}
_ bin .BareEncoder = &InputPrivacyValueAllowContacts {}
_ bin .BareDecoder = &InputPrivacyValueAllowContacts {}
_ InputPrivacyRuleClass = &InputPrivacyValueAllowContacts {}
)
func (i *InputPrivacyValueAllowContacts ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyValueAllowContacts ) String () string {
if i == nil {
return "InputPrivacyValueAllowContacts(nil)"
}
type Alias InputPrivacyValueAllowContacts
return fmt .Sprintf ("InputPrivacyValueAllowContacts%+v" , Alias (*i ))
}
func (*InputPrivacyValueAllowContacts ) TypeID () uint32 {
return InputPrivacyValueAllowContactsTypeID
}
func (*InputPrivacyValueAllowContacts ) TypeName () string {
return "inputPrivacyValueAllowContacts"
}
func (i *InputPrivacyValueAllowContacts ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueAllowContacts" ,
ID : InputPrivacyValueAllowContactsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyValueAllowContacts ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowContacts#d09e07b as nil" )
}
b .PutID (InputPrivacyValueAllowContactsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueAllowContacts ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowContacts#d09e07b as nil" )
}
return nil
}
func (i *InputPrivacyValueAllowContacts ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowContacts#d09e07b to nil" )
}
if err := b .ConsumeID (InputPrivacyValueAllowContactsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowContacts#d09e07b: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueAllowContacts ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowContacts#d09e07b to nil" )
}
return nil
}
type InputPrivacyValueAllowAll struct {
}
const InputPrivacyValueAllowAllTypeID = 0x184b35ce
func (i InputPrivacyValueAllowAll ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueAllowAll {}
_ bin .Decoder = &InputPrivacyValueAllowAll {}
_ bin .BareEncoder = &InputPrivacyValueAllowAll {}
_ bin .BareDecoder = &InputPrivacyValueAllowAll {}
_ InputPrivacyRuleClass = &InputPrivacyValueAllowAll {}
)
func (i *InputPrivacyValueAllowAll ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyValueAllowAll ) String () string {
if i == nil {
return "InputPrivacyValueAllowAll(nil)"
}
type Alias InputPrivacyValueAllowAll
return fmt .Sprintf ("InputPrivacyValueAllowAll%+v" , Alias (*i ))
}
func (*InputPrivacyValueAllowAll ) TypeID () uint32 {
return InputPrivacyValueAllowAllTypeID
}
func (*InputPrivacyValueAllowAll ) TypeName () string {
return "inputPrivacyValueAllowAll"
}
func (i *InputPrivacyValueAllowAll ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueAllowAll" ,
ID : InputPrivacyValueAllowAllTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyValueAllowAll ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowAll#184b35ce as nil" )
}
b .PutID (InputPrivacyValueAllowAllTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueAllowAll ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowAll#184b35ce as nil" )
}
return nil
}
func (i *InputPrivacyValueAllowAll ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowAll#184b35ce to nil" )
}
if err := b .ConsumeID (InputPrivacyValueAllowAllTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowAll#184b35ce: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueAllowAll ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowAll#184b35ce to nil" )
}
return nil
}
type InputPrivacyValueAllowUsers struct {
Users []InputUserClass
}
const InputPrivacyValueAllowUsersTypeID = 0x131cc67f
func (i InputPrivacyValueAllowUsers ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueAllowUsers {}
_ bin .Decoder = &InputPrivacyValueAllowUsers {}
_ bin .BareEncoder = &InputPrivacyValueAllowUsers {}
_ bin .BareDecoder = &InputPrivacyValueAllowUsers {}
_ InputPrivacyRuleClass = &InputPrivacyValueAllowUsers {}
)
func (i *InputPrivacyValueAllowUsers ) Zero () bool {
if i == nil {
return true
}
if !(i .Users == nil ) {
return false
}
return true
}
func (i *InputPrivacyValueAllowUsers ) String () string {
if i == nil {
return "InputPrivacyValueAllowUsers(nil)"
}
type Alias InputPrivacyValueAllowUsers
return fmt .Sprintf ("InputPrivacyValueAllowUsers%+v" , Alias (*i ))
}
func (i *InputPrivacyValueAllowUsers ) FillFrom (from interface {
GetUsers () (value []InputUserClass )
}) {
i .Users = from .GetUsers ()
}
func (*InputPrivacyValueAllowUsers ) TypeID () uint32 {
return InputPrivacyValueAllowUsersTypeID
}
func (*InputPrivacyValueAllowUsers ) TypeName () string {
return "inputPrivacyValueAllowUsers"
}
func (i *InputPrivacyValueAllowUsers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueAllowUsers" ,
ID : InputPrivacyValueAllowUsersTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Users" ,
SchemaName : "users" ,
},
}
return typ
}
func (i *InputPrivacyValueAllowUsers ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowUsers#131cc67f as nil" )
}
b .PutID (InputPrivacyValueAllowUsersTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueAllowUsers ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowUsers#131cc67f as nil" )
}
b .PutVectorHeader (len (i .Users ))
for idx , v := range i .Users {
if v == nil {
return fmt .Errorf ("unable to encode inputPrivacyValueAllowUsers#131cc67f: field users element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPrivacyValueAllowUsers#131cc67f: field users element with index %d: %w" , idx , err )
}
}
return nil
}
func (i *InputPrivacyValueAllowUsers ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowUsers#131cc67f to nil" )
}
if err := b .ConsumeID (InputPrivacyValueAllowUsersTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowUsers#131cc67f: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueAllowUsers ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowUsers#131cc67f to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowUsers#131cc67f: field users: %w" , err )
}
if headerLen > 0 {
i .Users = make ([]InputUserClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowUsers#131cc67f: field users: %w" , err )
}
i .Users = append (i .Users , value )
}
}
return nil
}
func (i *InputPrivacyValueAllowUsers ) GetUsers () (value []InputUserClass ) {
if i == nil {
return
}
return i .Users
}
func (i *InputPrivacyValueAllowUsers ) MapUsers () (value InputUserClassArray ) {
return InputUserClassArray (i .Users )
}
type InputPrivacyValueDisallowContacts struct {
}
const InputPrivacyValueDisallowContactsTypeID = 0xba52007
func (i InputPrivacyValueDisallowContacts ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueDisallowContacts {}
_ bin .Decoder = &InputPrivacyValueDisallowContacts {}
_ bin .BareEncoder = &InputPrivacyValueDisallowContacts {}
_ bin .BareDecoder = &InputPrivacyValueDisallowContacts {}
_ InputPrivacyRuleClass = &InputPrivacyValueDisallowContacts {}
)
func (i *InputPrivacyValueDisallowContacts ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyValueDisallowContacts ) String () string {
if i == nil {
return "InputPrivacyValueDisallowContacts(nil)"
}
type Alias InputPrivacyValueDisallowContacts
return fmt .Sprintf ("InputPrivacyValueDisallowContacts%+v" , Alias (*i ))
}
func (*InputPrivacyValueDisallowContacts ) TypeID () uint32 {
return InputPrivacyValueDisallowContactsTypeID
}
func (*InputPrivacyValueDisallowContacts ) TypeName () string {
return "inputPrivacyValueDisallowContacts"
}
func (i *InputPrivacyValueDisallowContacts ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueDisallowContacts" ,
ID : InputPrivacyValueDisallowContactsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyValueDisallowContacts ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowContacts#ba52007 as nil" )
}
b .PutID (InputPrivacyValueDisallowContactsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueDisallowContacts ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowContacts#ba52007 as nil" )
}
return nil
}
func (i *InputPrivacyValueDisallowContacts ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowContacts#ba52007 to nil" )
}
if err := b .ConsumeID (InputPrivacyValueDisallowContactsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowContacts#ba52007: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueDisallowContacts ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowContacts#ba52007 to nil" )
}
return nil
}
type InputPrivacyValueDisallowAll struct {
}
const InputPrivacyValueDisallowAllTypeID = 0xd66b66c9
func (i InputPrivacyValueDisallowAll ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueDisallowAll {}
_ bin .Decoder = &InputPrivacyValueDisallowAll {}
_ bin .BareEncoder = &InputPrivacyValueDisallowAll {}
_ bin .BareDecoder = &InputPrivacyValueDisallowAll {}
_ InputPrivacyRuleClass = &InputPrivacyValueDisallowAll {}
)
func (i *InputPrivacyValueDisallowAll ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyValueDisallowAll ) String () string {
if i == nil {
return "InputPrivacyValueDisallowAll(nil)"
}
type Alias InputPrivacyValueDisallowAll
return fmt .Sprintf ("InputPrivacyValueDisallowAll%+v" , Alias (*i ))
}
func (*InputPrivacyValueDisallowAll ) TypeID () uint32 {
return InputPrivacyValueDisallowAllTypeID
}
func (*InputPrivacyValueDisallowAll ) TypeName () string {
return "inputPrivacyValueDisallowAll"
}
func (i *InputPrivacyValueDisallowAll ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueDisallowAll" ,
ID : InputPrivacyValueDisallowAllTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyValueDisallowAll ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowAll#d66b66c9 as nil" )
}
b .PutID (InputPrivacyValueDisallowAllTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueDisallowAll ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowAll#d66b66c9 as nil" )
}
return nil
}
func (i *InputPrivacyValueDisallowAll ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowAll#d66b66c9 to nil" )
}
if err := b .ConsumeID (InputPrivacyValueDisallowAllTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowAll#d66b66c9: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueDisallowAll ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowAll#d66b66c9 to nil" )
}
return nil
}
type InputPrivacyValueDisallowUsers struct {
Users []InputUserClass
}
const InputPrivacyValueDisallowUsersTypeID = 0x90110467
func (i InputPrivacyValueDisallowUsers ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueDisallowUsers {}
_ bin .Decoder = &InputPrivacyValueDisallowUsers {}
_ bin .BareEncoder = &InputPrivacyValueDisallowUsers {}
_ bin .BareDecoder = &InputPrivacyValueDisallowUsers {}
_ InputPrivacyRuleClass = &InputPrivacyValueDisallowUsers {}
)
func (i *InputPrivacyValueDisallowUsers ) Zero () bool {
if i == nil {
return true
}
if !(i .Users == nil ) {
return false
}
return true
}
func (i *InputPrivacyValueDisallowUsers ) String () string {
if i == nil {
return "InputPrivacyValueDisallowUsers(nil)"
}
type Alias InputPrivacyValueDisallowUsers
return fmt .Sprintf ("InputPrivacyValueDisallowUsers%+v" , Alias (*i ))
}
func (i *InputPrivacyValueDisallowUsers ) FillFrom (from interface {
GetUsers () (value []InputUserClass )
}) {
i .Users = from .GetUsers ()
}
func (*InputPrivacyValueDisallowUsers ) TypeID () uint32 {
return InputPrivacyValueDisallowUsersTypeID
}
func (*InputPrivacyValueDisallowUsers ) TypeName () string {
return "inputPrivacyValueDisallowUsers"
}
func (i *InputPrivacyValueDisallowUsers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueDisallowUsers" ,
ID : InputPrivacyValueDisallowUsersTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Users" ,
SchemaName : "users" ,
},
}
return typ
}
func (i *InputPrivacyValueDisallowUsers ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowUsers#90110467 as nil" )
}
b .PutID (InputPrivacyValueDisallowUsersTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueDisallowUsers ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowUsers#90110467 as nil" )
}
b .PutVectorHeader (len (i .Users ))
for idx , v := range i .Users {
if v == nil {
return fmt .Errorf ("unable to encode inputPrivacyValueDisallowUsers#90110467: field users element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPrivacyValueDisallowUsers#90110467: field users element with index %d: %w" , idx , err )
}
}
return nil
}
func (i *InputPrivacyValueDisallowUsers ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowUsers#90110467 to nil" )
}
if err := b .ConsumeID (InputPrivacyValueDisallowUsersTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowUsers#90110467: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueDisallowUsers ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowUsers#90110467 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowUsers#90110467: field users: %w" , err )
}
if headerLen > 0 {
i .Users = make ([]InputUserClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowUsers#90110467: field users: %w" , err )
}
i .Users = append (i .Users , value )
}
}
return nil
}
func (i *InputPrivacyValueDisallowUsers ) GetUsers () (value []InputUserClass ) {
if i == nil {
return
}
return i .Users
}
func (i *InputPrivacyValueDisallowUsers ) MapUsers () (value InputUserClassArray ) {
return InputUserClassArray (i .Users )
}
type InputPrivacyValueAllowChatParticipants struct {
Chats []int64
}
const InputPrivacyValueAllowChatParticipantsTypeID = 0x840649cf
func (i InputPrivacyValueAllowChatParticipants ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueAllowChatParticipants {}
_ bin .Decoder = &InputPrivacyValueAllowChatParticipants {}
_ bin .BareEncoder = &InputPrivacyValueAllowChatParticipants {}
_ bin .BareDecoder = &InputPrivacyValueAllowChatParticipants {}
_ InputPrivacyRuleClass = &InputPrivacyValueAllowChatParticipants {}
)
func (i *InputPrivacyValueAllowChatParticipants ) Zero () bool {
if i == nil {
return true
}
if !(i .Chats == nil ) {
return false
}
return true
}
func (i *InputPrivacyValueAllowChatParticipants ) String () string {
if i == nil {
return "InputPrivacyValueAllowChatParticipants(nil)"
}
type Alias InputPrivacyValueAllowChatParticipants
return fmt .Sprintf ("InputPrivacyValueAllowChatParticipants%+v" , Alias (*i ))
}
func (i *InputPrivacyValueAllowChatParticipants ) FillFrom (from interface {
GetChats () (value []int64 )
}) {
i .Chats = from .GetChats ()
}
func (*InputPrivacyValueAllowChatParticipants ) TypeID () uint32 {
return InputPrivacyValueAllowChatParticipantsTypeID
}
func (*InputPrivacyValueAllowChatParticipants ) TypeName () string {
return "inputPrivacyValueAllowChatParticipants"
}
func (i *InputPrivacyValueAllowChatParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueAllowChatParticipants" ,
ID : InputPrivacyValueAllowChatParticipantsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chats" ,
SchemaName : "chats" ,
},
}
return typ
}
func (i *InputPrivacyValueAllowChatParticipants ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowChatParticipants#840649cf as nil" )
}
b .PutID (InputPrivacyValueAllowChatParticipantsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueAllowChatParticipants ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowChatParticipants#840649cf as nil" )
}
b .PutVectorHeader (len (i .Chats ))
for _ , v := range i .Chats {
b .PutLong (v )
}
return nil
}
func (i *InputPrivacyValueAllowChatParticipants ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowChatParticipants#840649cf to nil" )
}
if err := b .ConsumeID (InputPrivacyValueAllowChatParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowChatParticipants#840649cf: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueAllowChatParticipants ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowChatParticipants#840649cf to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowChatParticipants#840649cf: field chats: %w" , err )
}
if headerLen > 0 {
i .Chats = 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 inputPrivacyValueAllowChatParticipants#840649cf: field chats: %w" , err )
}
i .Chats = append (i .Chats , value )
}
}
return nil
}
func (i *InputPrivacyValueAllowChatParticipants ) GetChats () (value []int64 ) {
if i == nil {
return
}
return i .Chats
}
type InputPrivacyValueDisallowChatParticipants struct {
Chats []int64
}
const InputPrivacyValueDisallowChatParticipantsTypeID = 0xe94f0f86
func (i InputPrivacyValueDisallowChatParticipants ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueDisallowChatParticipants {}
_ bin .Decoder = &InputPrivacyValueDisallowChatParticipants {}
_ bin .BareEncoder = &InputPrivacyValueDisallowChatParticipants {}
_ bin .BareDecoder = &InputPrivacyValueDisallowChatParticipants {}
_ InputPrivacyRuleClass = &InputPrivacyValueDisallowChatParticipants {}
)
func (i *InputPrivacyValueDisallowChatParticipants ) Zero () bool {
if i == nil {
return true
}
if !(i .Chats == nil ) {
return false
}
return true
}
func (i *InputPrivacyValueDisallowChatParticipants ) String () string {
if i == nil {
return "InputPrivacyValueDisallowChatParticipants(nil)"
}
type Alias InputPrivacyValueDisallowChatParticipants
return fmt .Sprintf ("InputPrivacyValueDisallowChatParticipants%+v" , Alias (*i ))
}
func (i *InputPrivacyValueDisallowChatParticipants ) FillFrom (from interface {
GetChats () (value []int64 )
}) {
i .Chats = from .GetChats ()
}
func (*InputPrivacyValueDisallowChatParticipants ) TypeID () uint32 {
return InputPrivacyValueDisallowChatParticipantsTypeID
}
func (*InputPrivacyValueDisallowChatParticipants ) TypeName () string {
return "inputPrivacyValueDisallowChatParticipants"
}
func (i *InputPrivacyValueDisallowChatParticipants ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueDisallowChatParticipants" ,
ID : InputPrivacyValueDisallowChatParticipantsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chats" ,
SchemaName : "chats" ,
},
}
return typ
}
func (i *InputPrivacyValueDisallowChatParticipants ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowChatParticipants#e94f0f86 as nil" )
}
b .PutID (InputPrivacyValueDisallowChatParticipantsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueDisallowChatParticipants ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueDisallowChatParticipants#e94f0f86 as nil" )
}
b .PutVectorHeader (len (i .Chats ))
for _ , v := range i .Chats {
b .PutLong (v )
}
return nil
}
func (i *InputPrivacyValueDisallowChatParticipants ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowChatParticipants#e94f0f86 to nil" )
}
if err := b .ConsumeID (InputPrivacyValueDisallowChatParticipantsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowChatParticipants#e94f0f86: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueDisallowChatParticipants ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueDisallowChatParticipants#e94f0f86 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueDisallowChatParticipants#e94f0f86: field chats: %w" , err )
}
if headerLen > 0 {
i .Chats = 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 inputPrivacyValueDisallowChatParticipants#e94f0f86: field chats: %w" , err )
}
i .Chats = append (i .Chats , value )
}
}
return nil
}
func (i *InputPrivacyValueDisallowChatParticipants ) GetChats () (value []int64 ) {
if i == nil {
return
}
return i .Chats
}
type InputPrivacyValueAllowCloseFriends struct {
}
const InputPrivacyValueAllowCloseFriendsTypeID = 0x2f453e49
func (i InputPrivacyValueAllowCloseFriends ) construct () InputPrivacyRuleClass { return &i }
var (
_ bin .Encoder = &InputPrivacyValueAllowCloseFriends {}
_ bin .Decoder = &InputPrivacyValueAllowCloseFriends {}
_ bin .BareEncoder = &InputPrivacyValueAllowCloseFriends {}
_ bin .BareDecoder = &InputPrivacyValueAllowCloseFriends {}
_ InputPrivacyRuleClass = &InputPrivacyValueAllowCloseFriends {}
)
func (i *InputPrivacyValueAllowCloseFriends ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPrivacyValueAllowCloseFriends ) String () string {
if i == nil {
return "InputPrivacyValueAllowCloseFriends(nil)"
}
type Alias InputPrivacyValueAllowCloseFriends
return fmt .Sprintf ("InputPrivacyValueAllowCloseFriends%+v" , Alias (*i ))
}
func (*InputPrivacyValueAllowCloseFriends ) TypeID () uint32 {
return InputPrivacyValueAllowCloseFriendsTypeID
}
func (*InputPrivacyValueAllowCloseFriends ) TypeName () string {
return "inputPrivacyValueAllowCloseFriends"
}
func (i *InputPrivacyValueAllowCloseFriends ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPrivacyValueAllowCloseFriends" ,
ID : InputPrivacyValueAllowCloseFriendsTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPrivacyValueAllowCloseFriends ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowCloseFriends#2f453e49 as nil" )
}
b .PutID (InputPrivacyValueAllowCloseFriendsTypeID )
return i .EncodeBare (b )
}
func (i *InputPrivacyValueAllowCloseFriends ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPrivacyValueAllowCloseFriends#2f453e49 as nil" )
}
return nil
}
func (i *InputPrivacyValueAllowCloseFriends ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowCloseFriends#2f453e49 to nil" )
}
if err := b .ConsumeID (InputPrivacyValueAllowCloseFriendsTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPrivacyValueAllowCloseFriends#2f453e49: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPrivacyValueAllowCloseFriends ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPrivacyValueAllowCloseFriends#2f453e49 to nil" )
}
return nil
}
const InputPrivacyRuleClassName = "InputPrivacyRule"
type InputPrivacyRuleClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputPrivacyRuleClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeInputPrivacyRule (buf *bin .Buffer ) (InputPrivacyRuleClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputPrivacyValueAllowContactsTypeID :
v := InputPrivacyValueAllowContacts {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueAllowAllTypeID :
v := InputPrivacyValueAllowAll {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueAllowUsersTypeID :
v := InputPrivacyValueAllowUsers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueDisallowContactsTypeID :
v := InputPrivacyValueDisallowContacts {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueDisallowAllTypeID :
v := InputPrivacyValueDisallowAll {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueDisallowUsersTypeID :
v := InputPrivacyValueDisallowUsers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueAllowChatParticipantsTypeID :
v := InputPrivacyValueAllowChatParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueDisallowChatParticipantsTypeID :
v := InputPrivacyValueDisallowChatParticipants {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
case InputPrivacyValueAllowCloseFriendsTypeID :
v := InputPrivacyValueAllowCloseFriends {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputPrivacyRuleClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputPrivacyRuleBox struct {
InputPrivacyRule InputPrivacyRuleClass
}
func (b *InputPrivacyRuleBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputPrivacyRuleBox to nil" )
}
v , err := DecodeInputPrivacyRule (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputPrivacyRule = v
return nil
}
func (b *InputPrivacyRuleBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputPrivacyRule == nil {
return fmt .Errorf ("unable to encode InputPrivacyRuleClass as nil" )
}
return b .InputPrivacyRule .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 .