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 SecureValueErrorData struct {
Type SecureValueTypeClass
DataHash []byte
Field string
Text string
}
const SecureValueErrorDataTypeID = 0xe8a40bd9
func (s SecureValueErrorData ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorData {}
_ bin .Decoder = &SecureValueErrorData {}
_ bin .BareEncoder = &SecureValueErrorData {}
_ bin .BareDecoder = &SecureValueErrorData {}
_ SecureValueErrorClass = &SecureValueErrorData {}
)
func (s *SecureValueErrorData ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .DataHash == nil ) {
return false
}
if !(s .Field == "" ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorData ) String () string {
if s == nil {
return "SecureValueErrorData(nil)"
}
type Alias SecureValueErrorData
return fmt .Sprintf ("SecureValueErrorData%+v" , Alias (*s ))
}
func (s *SecureValueErrorData ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetDataHash () (value []byte )
GetField () (value string )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .DataHash = from .GetDataHash ()
s .Field = from .GetField ()
s .Text = from .GetText ()
}
func (*SecureValueErrorData ) TypeID () uint32 {
return SecureValueErrorDataTypeID
}
func (*SecureValueErrorData ) TypeName () string {
return "secureValueErrorData"
}
func (s *SecureValueErrorData ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorData" ,
ID : SecureValueErrorDataTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "DataHash" ,
SchemaName : "data_hash" ,
},
{
Name : "Field" ,
SchemaName : "field" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorData ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorData#e8a40bd9 as nil" )
}
b .PutID (SecureValueErrorDataTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorData ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorData#e8a40bd9 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorData#e8a40bd9: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorData#e8a40bd9: field type: %w" , err )
}
b .PutBytes (s .DataHash )
b .PutString (s .Field )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorData ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorData#e8a40bd9 to nil" )
}
if err := b .ConsumeID (SecureValueErrorDataTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorData#e8a40bd9: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorData ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorData#e8a40bd9 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorData#e8a40bd9: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorData#e8a40bd9: field data_hash: %w" , err )
}
s .DataHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorData#e8a40bd9: field field: %w" , err )
}
s .Field = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorData#e8a40bd9: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorData ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorData ) GetDataHash () (value []byte ) {
if s == nil {
return
}
return s .DataHash
}
func (s *SecureValueErrorData ) GetField () (value string ) {
if s == nil {
return
}
return s .Field
}
func (s *SecureValueErrorData ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorFrontSide struct {
Type SecureValueTypeClass
FileHash []byte
Text string
}
const SecureValueErrorFrontSideTypeID = 0xbe3dfa
func (s SecureValueErrorFrontSide ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorFrontSide {}
_ bin .Decoder = &SecureValueErrorFrontSide {}
_ bin .BareEncoder = &SecureValueErrorFrontSide {}
_ bin .BareDecoder = &SecureValueErrorFrontSide {}
_ SecureValueErrorClass = &SecureValueErrorFrontSide {}
)
func (s *SecureValueErrorFrontSide ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorFrontSide ) String () string {
if s == nil {
return "SecureValueErrorFrontSide(nil)"
}
type Alias SecureValueErrorFrontSide
return fmt .Sprintf ("SecureValueErrorFrontSide%+v" , Alias (*s ))
}
func (s *SecureValueErrorFrontSide ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorFrontSide ) TypeID () uint32 {
return SecureValueErrorFrontSideTypeID
}
func (*SecureValueErrorFrontSide ) TypeName () string {
return "secureValueErrorFrontSide"
}
func (s *SecureValueErrorFrontSide ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorFrontSide" ,
ID : SecureValueErrorFrontSideTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorFrontSide ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFrontSide#be3dfa as nil" )
}
b .PutID (SecureValueErrorFrontSideTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorFrontSide ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFrontSide#be3dfa as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorFrontSide#be3dfa: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorFrontSide#be3dfa: field type: %w" , err )
}
b .PutBytes (s .FileHash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorFrontSide ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFrontSide#be3dfa to nil" )
}
if err := b .ConsumeID (SecureValueErrorFrontSideTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFrontSide#be3dfa: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorFrontSide ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFrontSide#be3dfa to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFrontSide#be3dfa: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFrontSide#be3dfa: field file_hash: %w" , err )
}
s .FileHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFrontSide#be3dfa: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorFrontSide ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorFrontSide ) GetFileHash () (value []byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorFrontSide ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorReverseSide struct {
Type SecureValueTypeClass
FileHash []byte
Text string
}
const SecureValueErrorReverseSideTypeID = 0x868a2aa5
func (s SecureValueErrorReverseSide ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorReverseSide {}
_ bin .Decoder = &SecureValueErrorReverseSide {}
_ bin .BareEncoder = &SecureValueErrorReverseSide {}
_ bin .BareDecoder = &SecureValueErrorReverseSide {}
_ SecureValueErrorClass = &SecureValueErrorReverseSide {}
)
func (s *SecureValueErrorReverseSide ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorReverseSide ) String () string {
if s == nil {
return "SecureValueErrorReverseSide(nil)"
}
type Alias SecureValueErrorReverseSide
return fmt .Sprintf ("SecureValueErrorReverseSide%+v" , Alias (*s ))
}
func (s *SecureValueErrorReverseSide ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorReverseSide ) TypeID () uint32 {
return SecureValueErrorReverseSideTypeID
}
func (*SecureValueErrorReverseSide ) TypeName () string {
return "secureValueErrorReverseSide"
}
func (s *SecureValueErrorReverseSide ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorReverseSide" ,
ID : SecureValueErrorReverseSideTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorReverseSide ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorReverseSide#868a2aa5 as nil" )
}
b .PutID (SecureValueErrorReverseSideTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorReverseSide ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorReverseSide#868a2aa5 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorReverseSide#868a2aa5: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorReverseSide#868a2aa5: field type: %w" , err )
}
b .PutBytes (s .FileHash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorReverseSide ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorReverseSide#868a2aa5 to nil" )
}
if err := b .ConsumeID (SecureValueErrorReverseSideTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorReverseSide#868a2aa5: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorReverseSide ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorReverseSide#868a2aa5 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorReverseSide#868a2aa5: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorReverseSide#868a2aa5: field file_hash: %w" , err )
}
s .FileHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorReverseSide#868a2aa5: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorReverseSide ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorReverseSide ) GetFileHash () (value []byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorReverseSide ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorSelfie struct {
Type SecureValueTypeClass
FileHash []byte
Text string
}
const SecureValueErrorSelfieTypeID = 0xe537ced6
func (s SecureValueErrorSelfie ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorSelfie {}
_ bin .Decoder = &SecureValueErrorSelfie {}
_ bin .BareEncoder = &SecureValueErrorSelfie {}
_ bin .BareDecoder = &SecureValueErrorSelfie {}
_ SecureValueErrorClass = &SecureValueErrorSelfie {}
)
func (s *SecureValueErrorSelfie ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorSelfie ) String () string {
if s == nil {
return "SecureValueErrorSelfie(nil)"
}
type Alias SecureValueErrorSelfie
return fmt .Sprintf ("SecureValueErrorSelfie%+v" , Alias (*s ))
}
func (s *SecureValueErrorSelfie ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorSelfie ) TypeID () uint32 {
return SecureValueErrorSelfieTypeID
}
func (*SecureValueErrorSelfie ) TypeName () string {
return "secureValueErrorSelfie"
}
func (s *SecureValueErrorSelfie ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorSelfie" ,
ID : SecureValueErrorSelfieTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorSelfie ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorSelfie#e537ced6 as nil" )
}
b .PutID (SecureValueErrorSelfieTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorSelfie ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorSelfie#e537ced6 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorSelfie#e537ced6: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorSelfie#e537ced6: field type: %w" , err )
}
b .PutBytes (s .FileHash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorSelfie ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorSelfie#e537ced6 to nil" )
}
if err := b .ConsumeID (SecureValueErrorSelfieTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorSelfie#e537ced6: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorSelfie ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorSelfie#e537ced6 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorSelfie#e537ced6: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorSelfie#e537ced6: field file_hash: %w" , err )
}
s .FileHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorSelfie#e537ced6: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorSelfie ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorSelfie ) GetFileHash () (value []byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorSelfie ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorFile struct {
Type SecureValueTypeClass
FileHash []byte
Text string
}
const SecureValueErrorFileTypeID = 0x7a700873
func (s SecureValueErrorFile ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorFile {}
_ bin .Decoder = &SecureValueErrorFile {}
_ bin .BareEncoder = &SecureValueErrorFile {}
_ bin .BareDecoder = &SecureValueErrorFile {}
_ SecureValueErrorClass = &SecureValueErrorFile {}
)
func (s *SecureValueErrorFile ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorFile ) String () string {
if s == nil {
return "SecureValueErrorFile(nil)"
}
type Alias SecureValueErrorFile
return fmt .Sprintf ("SecureValueErrorFile%+v" , Alias (*s ))
}
func (s *SecureValueErrorFile ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorFile ) TypeID () uint32 {
return SecureValueErrorFileTypeID
}
func (*SecureValueErrorFile ) TypeName () string {
return "secureValueErrorFile"
}
func (s *SecureValueErrorFile ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorFile" ,
ID : SecureValueErrorFileTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorFile ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFile#7a700873 as nil" )
}
b .PutID (SecureValueErrorFileTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorFile ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFile#7a700873 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorFile#7a700873: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorFile#7a700873: field type: %w" , err )
}
b .PutBytes (s .FileHash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorFile ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFile#7a700873 to nil" )
}
if err := b .ConsumeID (SecureValueErrorFileTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFile#7a700873: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorFile ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFile#7a700873 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFile#7a700873: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFile#7a700873: field file_hash: %w" , err )
}
s .FileHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFile#7a700873: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorFile ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorFile ) GetFileHash () (value []byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorFile ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorFiles struct {
Type SecureValueTypeClass
FileHash [][]byte
Text string
}
const SecureValueErrorFilesTypeID = 0x666220e9
func (s SecureValueErrorFiles ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorFiles {}
_ bin .Decoder = &SecureValueErrorFiles {}
_ bin .BareEncoder = &SecureValueErrorFiles {}
_ bin .BareDecoder = &SecureValueErrorFiles {}
_ SecureValueErrorClass = &SecureValueErrorFiles {}
)
func (s *SecureValueErrorFiles ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorFiles ) String () string {
if s == nil {
return "SecureValueErrorFiles(nil)"
}
type Alias SecureValueErrorFiles
return fmt .Sprintf ("SecureValueErrorFiles%+v" , Alias (*s ))
}
func (s *SecureValueErrorFiles ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value [][]byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorFiles ) TypeID () uint32 {
return SecureValueErrorFilesTypeID
}
func (*SecureValueErrorFiles ) TypeName () string {
return "secureValueErrorFiles"
}
func (s *SecureValueErrorFiles ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorFiles" ,
ID : SecureValueErrorFilesTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorFiles ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFiles#666220e9 as nil" )
}
b .PutID (SecureValueErrorFilesTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorFiles ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorFiles#666220e9 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorFiles#666220e9: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorFiles#666220e9: field type: %w" , err )
}
b .PutVectorHeader (len (s .FileHash ))
for _ , v := range s .FileHash {
b .PutBytes (v )
}
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorFiles ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFiles#666220e9 to nil" )
}
if err := b .ConsumeID (SecureValueErrorFilesTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFiles#666220e9: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorFiles ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorFiles#666220e9 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFiles#666220e9: field type: %w" , err )
}
s .Type = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFiles#666220e9: field file_hash: %w" , err )
}
if headerLen > 0 {
s .FileHash = make ([][]byte , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFiles#666220e9: field file_hash: %w" , err )
}
s .FileHash = append (s .FileHash , value )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorFiles#666220e9: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorFiles ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorFiles ) GetFileHash () (value [][]byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorFiles ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueError struct {
Type SecureValueTypeClass
Hash []byte
Text string
}
const SecureValueErrorTypeID = 0x869d758f
func (s SecureValueError ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueError {}
_ bin .Decoder = &SecureValueError {}
_ bin .BareEncoder = &SecureValueError {}
_ bin .BareDecoder = &SecureValueError {}
_ SecureValueErrorClass = &SecureValueError {}
)
func (s *SecureValueError ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .Hash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueError ) String () string {
if s == nil {
return "SecureValueError(nil)"
}
type Alias SecureValueError
return fmt .Sprintf ("SecureValueError%+v" , Alias (*s ))
}
func (s *SecureValueError ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .Hash = from .GetHash ()
s .Text = from .GetText ()
}
func (*SecureValueError ) TypeID () uint32 {
return SecureValueErrorTypeID
}
func (*SecureValueError ) TypeName () string {
return "secureValueError"
}
func (s *SecureValueError ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueError" ,
ID : SecureValueErrorTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "Hash" ,
SchemaName : "hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueError ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueError#869d758f as nil" )
}
b .PutID (SecureValueErrorTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueError ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueError#869d758f as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueError#869d758f: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueError#869d758f: field type: %w" , err )
}
b .PutBytes (s .Hash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueError ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueError#869d758f to nil" )
}
if err := b .ConsumeID (SecureValueErrorTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueError#869d758f: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueError ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueError#869d758f to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueError#869d758f: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueError#869d758f: field hash: %w" , err )
}
s .Hash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueError#869d758f: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueError ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueError ) GetHash () (value []byte ) {
if s == nil {
return
}
return s .Hash
}
func (s *SecureValueError ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorTranslationFile struct {
Type SecureValueTypeClass
FileHash []byte
Text string
}
const SecureValueErrorTranslationFileTypeID = 0xa1144770
func (s SecureValueErrorTranslationFile ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorTranslationFile {}
_ bin .Decoder = &SecureValueErrorTranslationFile {}
_ bin .BareEncoder = &SecureValueErrorTranslationFile {}
_ bin .BareDecoder = &SecureValueErrorTranslationFile {}
_ SecureValueErrorClass = &SecureValueErrorTranslationFile {}
)
func (s *SecureValueErrorTranslationFile ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorTranslationFile ) String () string {
if s == nil {
return "SecureValueErrorTranslationFile(nil)"
}
type Alias SecureValueErrorTranslationFile
return fmt .Sprintf ("SecureValueErrorTranslationFile%+v" , Alias (*s ))
}
func (s *SecureValueErrorTranslationFile ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value []byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorTranslationFile ) TypeID () uint32 {
return SecureValueErrorTranslationFileTypeID
}
func (*SecureValueErrorTranslationFile ) TypeName () string {
return "secureValueErrorTranslationFile"
}
func (s *SecureValueErrorTranslationFile ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorTranslationFile" ,
ID : SecureValueErrorTranslationFileTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorTranslationFile ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorTranslationFile#a1144770 as nil" )
}
b .PutID (SecureValueErrorTranslationFileTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorTranslationFile ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorTranslationFile#a1144770 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorTranslationFile#a1144770: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorTranslationFile#a1144770: field type: %w" , err )
}
b .PutBytes (s .FileHash )
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorTranslationFile ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorTranslationFile#a1144770 to nil" )
}
if err := b .ConsumeID (SecureValueErrorTranslationFileTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFile#a1144770: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorTranslationFile ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorTranslationFile#a1144770 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFile#a1144770: field type: %w" , err )
}
s .Type = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFile#a1144770: field file_hash: %w" , err )
}
s .FileHash = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFile#a1144770: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorTranslationFile ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorTranslationFile ) GetFileHash () (value []byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorTranslationFile ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
type SecureValueErrorTranslationFiles struct {
Type SecureValueTypeClass
FileHash [][]byte
Text string
}
const SecureValueErrorTranslationFilesTypeID = 0x34636dd8
func (s SecureValueErrorTranslationFiles ) construct () SecureValueErrorClass { return &s }
var (
_ bin .Encoder = &SecureValueErrorTranslationFiles {}
_ bin .Decoder = &SecureValueErrorTranslationFiles {}
_ bin .BareEncoder = &SecureValueErrorTranslationFiles {}
_ bin .BareDecoder = &SecureValueErrorTranslationFiles {}
_ SecureValueErrorClass = &SecureValueErrorTranslationFiles {}
)
func (s *SecureValueErrorTranslationFiles ) Zero () bool {
if s == nil {
return true
}
if !(s .Type == nil ) {
return false
}
if !(s .FileHash == nil ) {
return false
}
if !(s .Text == "" ) {
return false
}
return true
}
func (s *SecureValueErrorTranslationFiles ) String () string {
if s == nil {
return "SecureValueErrorTranslationFiles(nil)"
}
type Alias SecureValueErrorTranslationFiles
return fmt .Sprintf ("SecureValueErrorTranslationFiles%+v" , Alias (*s ))
}
func (s *SecureValueErrorTranslationFiles ) FillFrom (from interface {
GetType () (value SecureValueTypeClass )
GetFileHash () (value [][]byte )
GetText () (value string )
}) {
s .Type = from .GetType ()
s .FileHash = from .GetFileHash ()
s .Text = from .GetText ()
}
func (*SecureValueErrorTranslationFiles ) TypeID () uint32 {
return SecureValueErrorTranslationFilesTypeID
}
func (*SecureValueErrorTranslationFiles ) TypeName () string {
return "secureValueErrorTranslationFiles"
}
func (s *SecureValueErrorTranslationFiles ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "secureValueErrorTranslationFiles" ,
ID : SecureValueErrorTranslationFilesTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Type" ,
SchemaName : "type" ,
},
{
Name : "FileHash" ,
SchemaName : "file_hash" ,
},
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (s *SecureValueErrorTranslationFiles ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorTranslationFiles#34636dd8 as nil" )
}
b .PutID (SecureValueErrorTranslationFilesTypeID )
return s .EncodeBare (b )
}
func (s *SecureValueErrorTranslationFiles ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode secureValueErrorTranslationFiles#34636dd8 as nil" )
}
if s .Type == nil {
return fmt .Errorf ("unable to encode secureValueErrorTranslationFiles#34636dd8: field type is nil" )
}
if err := s .Type .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode secureValueErrorTranslationFiles#34636dd8: field type: %w" , err )
}
b .PutVectorHeader (len (s .FileHash ))
for _ , v := range s .FileHash {
b .PutBytes (v )
}
b .PutString (s .Text )
return nil
}
func (s *SecureValueErrorTranslationFiles ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorTranslationFiles#34636dd8 to nil" )
}
if err := b .ConsumeID (SecureValueErrorTranslationFilesTypeID ); err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFiles#34636dd8: %w" , err )
}
return s .DecodeBare (b )
}
func (s *SecureValueErrorTranslationFiles ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode secureValueErrorTranslationFiles#34636dd8 to nil" )
}
{
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFiles#34636dd8: field type: %w" , err )
}
s .Type = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFiles#34636dd8: field file_hash: %w" , err )
}
if headerLen > 0 {
s .FileHash = make ([][]byte , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFiles#34636dd8: field file_hash: %w" , err )
}
s .FileHash = append (s .FileHash , value )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode secureValueErrorTranslationFiles#34636dd8: field text: %w" , err )
}
s .Text = value
}
return nil
}
func (s *SecureValueErrorTranslationFiles ) GetType () (value SecureValueTypeClass ) {
if s == nil {
return
}
return s .Type
}
func (s *SecureValueErrorTranslationFiles ) GetFileHash () (value [][]byte ) {
if s == nil {
return
}
return s .FileHash
}
func (s *SecureValueErrorTranslationFiles ) GetText () (value string ) {
if s == nil {
return
}
return s .Text
}
const SecureValueErrorClassName = "SecureValueError"
type SecureValueErrorClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () SecureValueErrorClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
GetType () (value SecureValueTypeClass )
GetText () (value string )
}
func DecodeSecureValueError (buf *bin .Buffer ) (SecureValueErrorClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case SecureValueErrorDataTypeID :
v := SecureValueErrorData {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorFrontSideTypeID :
v := SecureValueErrorFrontSide {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorReverseSideTypeID :
v := SecureValueErrorReverseSide {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorSelfieTypeID :
v := SecureValueErrorSelfie {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorFileTypeID :
v := SecureValueErrorFile {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorFilesTypeID :
v := SecureValueErrorFiles {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorTypeID :
v := SecureValueError {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorTranslationFileTypeID :
v := SecureValueErrorTranslationFile {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
case SecureValueErrorTranslationFilesTypeID :
v := SecureValueErrorTranslationFiles {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode SecureValueErrorClass: %w" , bin .NewUnexpectedID (id ))
}
}
type SecureValueErrorBox struct {
SecureValueError SecureValueErrorClass
}
func (b *SecureValueErrorBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode SecureValueErrorBox to nil" )
}
v , err := DecodeSecureValueError (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .SecureValueError = v
return nil
}
func (b *SecureValueErrorBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .SecureValueError == nil {
return fmt .Errorf ("unable to encode SecureValueErrorClass as nil" )
}
return b .SecureValueError .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 .