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 WalletTransactionPeerUser struct {
Flags bin .Fields
UserID int64
Address string
Domain string
}
const WalletTransactionPeerUserTypeID = 0xd4ea706d
func (w WalletTransactionPeerUser ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerUser {}
_ bin .Decoder = &WalletTransactionPeerUser {}
_ bin .BareEncoder = &WalletTransactionPeerUser {}
_ bin .BareDecoder = &WalletTransactionPeerUser {}
_ WalletTransactionPeerClass = &WalletTransactionPeerUser {}
)
func (w *WalletTransactionPeerUser ) Zero () bool {
if w == nil {
return true
}
if !(w .Flags .Zero ()) {
return false
}
if !(w .UserID == 0 ) {
return false
}
if !(w .Address == "" ) {
return false
}
if !(w .Domain == "" ) {
return false
}
return true
}
func (w *WalletTransactionPeerUser ) String () string {
if w == nil {
return "WalletTransactionPeerUser(nil)"
}
type Alias WalletTransactionPeerUser
return fmt .Sprintf ("WalletTransactionPeerUser%+v" , Alias (*w ))
}
func (w *WalletTransactionPeerUser ) FillFrom (from interface {
GetUserID () (value int64 )
GetAddress () (value string )
GetDomain () (value string , ok bool )
}) {
w .UserID = from .GetUserID ()
w .Address = from .GetAddress ()
if val , ok := from .GetDomain (); ok {
w .Domain = val
}
}
func (*WalletTransactionPeerUser ) TypeID () uint32 {
return WalletTransactionPeerUserTypeID
}
func (*WalletTransactionPeerUser ) TypeName () string {
return "walletTransactionPeerUser"
}
func (w *WalletTransactionPeerUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerUser" ,
ID : WalletTransactionPeerUserTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Address" ,
SchemaName : "address" ,
},
{
Name : "Domain" ,
SchemaName : "domain" ,
Null : !w .Flags .Has (0 ),
},
}
return typ
}
func (w *WalletTransactionPeerUser ) SetFlags () {
if !(w .Domain == "" ) {
w .Flags .Set (0 )
}
}
func (w *WalletTransactionPeerUser ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerUser#d4ea706d as nil" )
}
b .PutID (WalletTransactionPeerUserTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerUser ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerUser#d4ea706d as nil" )
}
w .SetFlags ()
if err := w .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode walletTransactionPeerUser#d4ea706d: field flags: %w" , err )
}
b .PutLong (w .UserID )
b .PutString (w .Address )
if w .Flags .Has (0 ) {
b .PutString (w .Domain )
}
return nil
}
func (w *WalletTransactionPeerUser ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerUser#d4ea706d to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUser#d4ea706d: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerUser ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerUser#d4ea706d to nil" )
}
{
if err := w .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUser#d4ea706d: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUser#d4ea706d: field user_id: %w" , err )
}
w .UserID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUser#d4ea706d: field address: %w" , err )
}
w .Address = value
}
if w .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUser#d4ea706d: field domain: %w" , err )
}
w .Domain = value
}
return nil
}
func (w *WalletTransactionPeerUser ) GetUserID () (value int64 ) {
if w == nil {
return
}
return w .UserID
}
func (w *WalletTransactionPeerUser ) GetAddress () (value string ) {
if w == nil {
return
}
return w .Address
}
func (w *WalletTransactionPeerUser ) SetDomain (value string ) {
w .Flags .Set (0 )
w .Domain = value
}
func (w *WalletTransactionPeerUser ) GetDomain () (value string , ok bool ) {
if w == nil {
return
}
if !w .Flags .Has (0 ) {
return value , false
}
return w .Domain , true
}
type WalletTransactionPeerAddress struct {
Flags bin .Fields
Address string
Domain string
}
const WalletTransactionPeerAddressTypeID = 0x62cc1bc
func (w WalletTransactionPeerAddress ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerAddress {}
_ bin .Decoder = &WalletTransactionPeerAddress {}
_ bin .BareEncoder = &WalletTransactionPeerAddress {}
_ bin .BareDecoder = &WalletTransactionPeerAddress {}
_ WalletTransactionPeerClass = &WalletTransactionPeerAddress {}
)
func (w *WalletTransactionPeerAddress ) Zero () bool {
if w == nil {
return true
}
if !(w .Flags .Zero ()) {
return false
}
if !(w .Address == "" ) {
return false
}
if !(w .Domain == "" ) {
return false
}
return true
}
func (w *WalletTransactionPeerAddress ) String () string {
if w == nil {
return "WalletTransactionPeerAddress(nil)"
}
type Alias WalletTransactionPeerAddress
return fmt .Sprintf ("WalletTransactionPeerAddress%+v" , Alias (*w ))
}
func (w *WalletTransactionPeerAddress ) FillFrom (from interface {
GetAddress () (value string )
GetDomain () (value string , ok bool )
}) {
w .Address = from .GetAddress ()
if val , ok := from .GetDomain (); ok {
w .Domain = val
}
}
func (*WalletTransactionPeerAddress ) TypeID () uint32 {
return WalletTransactionPeerAddressTypeID
}
func (*WalletTransactionPeerAddress ) TypeName () string {
return "walletTransactionPeerAddress"
}
func (w *WalletTransactionPeerAddress ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerAddress" ,
ID : WalletTransactionPeerAddressTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Address" ,
SchemaName : "address" ,
},
{
Name : "Domain" ,
SchemaName : "domain" ,
Null : !w .Flags .Has (0 ),
},
}
return typ
}
func (w *WalletTransactionPeerAddress ) SetFlags () {
if !(w .Domain == "" ) {
w .Flags .Set (0 )
}
}
func (w *WalletTransactionPeerAddress ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerAddress#62cc1bc as nil" )
}
b .PutID (WalletTransactionPeerAddressTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerAddress ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerAddress#62cc1bc as nil" )
}
w .SetFlags ()
if err := w .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode walletTransactionPeerAddress#62cc1bc: field flags: %w" , err )
}
b .PutString (w .Address )
if w .Flags .Has (0 ) {
b .PutString (w .Domain )
}
return nil
}
func (w *WalletTransactionPeerAddress ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerAddress#62cc1bc to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerAddressTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerAddress#62cc1bc: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerAddress ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerAddress#62cc1bc to nil" )
}
{
if err := w .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerAddress#62cc1bc: field flags: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerAddress#62cc1bc: field address: %w" , err )
}
w .Address = value
}
if w .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerAddress#62cc1bc: field domain: %w" , err )
}
w .Domain = value
}
return nil
}
func (w *WalletTransactionPeerAddress ) GetAddress () (value string ) {
if w == nil {
return
}
return w .Address
}
func (w *WalletTransactionPeerAddress ) SetDomain (value string ) {
w .Flags .Set (0 )
w .Domain = value
}
func (w *WalletTransactionPeerAddress ) GetDomain () (value string , ok bool ) {
if w == nil {
return
}
if !w .Flags .Has (0 ) {
return value , false
}
return w .Domain , true
}
type WalletTransactionPeerOnramp struct {
Flags bin .Fields
Address string
Domain string
ProviderName string
}
const WalletTransactionPeerOnrampTypeID = 0xe595186e
func (w WalletTransactionPeerOnramp ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerOnramp {}
_ bin .Decoder = &WalletTransactionPeerOnramp {}
_ bin .BareEncoder = &WalletTransactionPeerOnramp {}
_ bin .BareDecoder = &WalletTransactionPeerOnramp {}
_ WalletTransactionPeerClass = &WalletTransactionPeerOnramp {}
)
func (w *WalletTransactionPeerOnramp ) Zero () bool {
if w == nil {
return true
}
if !(w .Flags .Zero ()) {
return false
}
if !(w .Address == "" ) {
return false
}
if !(w .Domain == "" ) {
return false
}
if !(w .ProviderName == "" ) {
return false
}
return true
}
func (w *WalletTransactionPeerOnramp ) String () string {
if w == nil {
return "WalletTransactionPeerOnramp(nil)"
}
type Alias WalletTransactionPeerOnramp
return fmt .Sprintf ("WalletTransactionPeerOnramp%+v" , Alias (*w ))
}
func (w *WalletTransactionPeerOnramp ) FillFrom (from interface {
GetAddress () (value string )
GetDomain () (value string , ok bool )
GetProviderName () (value string )
}) {
w .Address = from .GetAddress ()
if val , ok := from .GetDomain (); ok {
w .Domain = val
}
w .ProviderName = from .GetProviderName ()
}
func (*WalletTransactionPeerOnramp ) TypeID () uint32 {
return WalletTransactionPeerOnrampTypeID
}
func (*WalletTransactionPeerOnramp ) TypeName () string {
return "walletTransactionPeerOnramp"
}
func (w *WalletTransactionPeerOnramp ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerOnramp" ,
ID : WalletTransactionPeerOnrampTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Address" ,
SchemaName : "address" ,
},
{
Name : "Domain" ,
SchemaName : "domain" ,
Null : !w .Flags .Has (0 ),
},
{
Name : "ProviderName" ,
SchemaName : "provider_name" ,
},
}
return typ
}
func (w *WalletTransactionPeerOnramp ) SetFlags () {
if !(w .Domain == "" ) {
w .Flags .Set (0 )
}
}
func (w *WalletTransactionPeerOnramp ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerOnramp#e595186e as nil" )
}
b .PutID (WalletTransactionPeerOnrampTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerOnramp ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerOnramp#e595186e as nil" )
}
w .SetFlags ()
if err := w .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode walletTransactionPeerOnramp#e595186e: field flags: %w" , err )
}
b .PutString (w .Address )
if w .Flags .Has (0 ) {
b .PutString (w .Domain )
}
b .PutString (w .ProviderName )
return nil
}
func (w *WalletTransactionPeerOnramp ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerOnramp#e595186e to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerOnrampTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerOnramp#e595186e: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerOnramp ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerOnramp#e595186e to nil" )
}
{
if err := w .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerOnramp#e595186e: field flags: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerOnramp#e595186e: field address: %w" , err )
}
w .Address = value
}
if w .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerOnramp#e595186e: field domain: %w" , err )
}
w .Domain = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerOnramp#e595186e: field provider_name: %w" , err )
}
w .ProviderName = value
}
return nil
}
func (w *WalletTransactionPeerOnramp ) GetAddress () (value string ) {
if w == nil {
return
}
return w .Address
}
func (w *WalletTransactionPeerOnramp ) SetDomain (value string ) {
w .Flags .Set (0 )
w .Domain = value
}
func (w *WalletTransactionPeerOnramp ) GetDomain () (value string , ok bool ) {
if w == nil {
return
}
if !w .Flags .Has (0 ) {
return value , false
}
return w .Domain , true
}
func (w *WalletTransactionPeerOnramp ) GetProviderName () (value string ) {
if w == nil {
return
}
return w .ProviderName
}
type WalletTransactionPeerUnsupported struct {
}
const WalletTransactionPeerUnsupportedTypeID = 0x728bed5a
func (w WalletTransactionPeerUnsupported ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerUnsupported {}
_ bin .Decoder = &WalletTransactionPeerUnsupported {}
_ bin .BareEncoder = &WalletTransactionPeerUnsupported {}
_ bin .BareDecoder = &WalletTransactionPeerUnsupported {}
_ WalletTransactionPeerClass = &WalletTransactionPeerUnsupported {}
)
func (w *WalletTransactionPeerUnsupported ) Zero () bool {
if w == nil {
return true
}
return true
}
func (w *WalletTransactionPeerUnsupported ) String () string {
if w == nil {
return "WalletTransactionPeerUnsupported(nil)"
}
type Alias WalletTransactionPeerUnsupported
return fmt .Sprintf ("WalletTransactionPeerUnsupported%+v" , Alias (*w ))
}
func (*WalletTransactionPeerUnsupported ) TypeID () uint32 {
return WalletTransactionPeerUnsupportedTypeID
}
func (*WalletTransactionPeerUnsupported ) TypeName () string {
return "walletTransactionPeerUnsupported"
}
func (w *WalletTransactionPeerUnsupported ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerUnsupported" ,
ID : WalletTransactionPeerUnsupportedTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (w *WalletTransactionPeerUnsupported ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerUnsupported#728bed5a as nil" )
}
b .PutID (WalletTransactionPeerUnsupportedTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerUnsupported ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerUnsupported#728bed5a as nil" )
}
return nil
}
func (w *WalletTransactionPeerUnsupported ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerUnsupported#728bed5a to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerUnsupportedTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerUnsupported#728bed5a: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerUnsupported ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerUnsupported#728bed5a to nil" )
}
return nil
}
type WalletTransactionPeerChannel struct {
Flags bin .Fields
ChannelID int64
Address string
Domain string
}
const WalletTransactionPeerChannelTypeID = 0x54e70c31
func (w WalletTransactionPeerChannel ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerChannel {}
_ bin .Decoder = &WalletTransactionPeerChannel {}
_ bin .BareEncoder = &WalletTransactionPeerChannel {}
_ bin .BareDecoder = &WalletTransactionPeerChannel {}
_ WalletTransactionPeerClass = &WalletTransactionPeerChannel {}
)
func (w *WalletTransactionPeerChannel ) Zero () bool {
if w == nil {
return true
}
if !(w .Flags .Zero ()) {
return false
}
if !(w .ChannelID == 0 ) {
return false
}
if !(w .Address == "" ) {
return false
}
if !(w .Domain == "" ) {
return false
}
return true
}
func (w *WalletTransactionPeerChannel ) String () string {
if w == nil {
return "WalletTransactionPeerChannel(nil)"
}
type Alias WalletTransactionPeerChannel
return fmt .Sprintf ("WalletTransactionPeerChannel%+v" , Alias (*w ))
}
func (w *WalletTransactionPeerChannel ) FillFrom (from interface {
GetChannelID () (value int64 )
GetAddress () (value string )
GetDomain () (value string , ok bool )
}) {
w .ChannelID = from .GetChannelID ()
w .Address = from .GetAddress ()
if val , ok := from .GetDomain (); ok {
w .Domain = val
}
}
func (*WalletTransactionPeerChannel ) TypeID () uint32 {
return WalletTransactionPeerChannelTypeID
}
func (*WalletTransactionPeerChannel ) TypeName () string {
return "walletTransactionPeerChannel"
}
func (w *WalletTransactionPeerChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerChannel" ,
ID : WalletTransactionPeerChannelTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "Address" ,
SchemaName : "address" ,
},
{
Name : "Domain" ,
SchemaName : "domain" ,
Null : !w .Flags .Has (0 ),
},
}
return typ
}
func (w *WalletTransactionPeerChannel ) SetFlags () {
if !(w .Domain == "" ) {
w .Flags .Set (0 )
}
}
func (w *WalletTransactionPeerChannel ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerChannel#54e70c31 as nil" )
}
b .PutID (WalletTransactionPeerChannelTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerChannel ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerChannel#54e70c31 as nil" )
}
w .SetFlags ()
if err := w .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode walletTransactionPeerChannel#54e70c31: field flags: %w" , err )
}
b .PutLong (w .ChannelID )
b .PutString (w .Address )
if w .Flags .Has (0 ) {
b .PutString (w .Domain )
}
return nil
}
func (w *WalletTransactionPeerChannel ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerChannel#54e70c31 to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerChannel#54e70c31: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerChannel ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerChannel#54e70c31 to nil" )
}
{
if err := w .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerChannel#54e70c31: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerChannel#54e70c31: field channel_id: %w" , err )
}
w .ChannelID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerChannel#54e70c31: field address: %w" , err )
}
w .Address = value
}
if w .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerChannel#54e70c31: field domain: %w" , err )
}
w .Domain = value
}
return nil
}
func (w *WalletTransactionPeerChannel ) GetChannelID () (value int64 ) {
if w == nil {
return
}
return w .ChannelID
}
func (w *WalletTransactionPeerChannel ) GetAddress () (value string ) {
if w == nil {
return
}
return w .Address
}
func (w *WalletTransactionPeerChannel ) SetDomain (value string ) {
w .Flags .Set (0 )
w .Domain = value
}
func (w *WalletTransactionPeerChannel ) GetDomain () (value string , ok bool ) {
if w == nil {
return
}
if !w .Flags .Has (0 ) {
return value , false
}
return w .Domain , true
}
type WalletTransactionPeerTelegramGift struct {
Flags bin .Fields
OwnProfile bool
}
const WalletTransactionPeerTelegramGiftTypeID = 0xf4729499
func (w WalletTransactionPeerTelegramGift ) construct () WalletTransactionPeerClass { return &w }
var (
_ bin .Encoder = &WalletTransactionPeerTelegramGift {}
_ bin .Decoder = &WalletTransactionPeerTelegramGift {}
_ bin .BareEncoder = &WalletTransactionPeerTelegramGift {}
_ bin .BareDecoder = &WalletTransactionPeerTelegramGift {}
_ WalletTransactionPeerClass = &WalletTransactionPeerTelegramGift {}
)
func (w *WalletTransactionPeerTelegramGift ) Zero () bool {
if w == nil {
return true
}
if !(w .Flags .Zero ()) {
return false
}
if !(w .OwnProfile == false ) {
return false
}
return true
}
func (w *WalletTransactionPeerTelegramGift ) String () string {
if w == nil {
return "WalletTransactionPeerTelegramGift(nil)"
}
type Alias WalletTransactionPeerTelegramGift
return fmt .Sprintf ("WalletTransactionPeerTelegramGift%+v" , Alias (*w ))
}
func (w *WalletTransactionPeerTelegramGift ) FillFrom (from interface {
GetOwnProfile () (value bool )
}) {
w .OwnProfile = from .GetOwnProfile ()
}
func (*WalletTransactionPeerTelegramGift ) TypeID () uint32 {
return WalletTransactionPeerTelegramGiftTypeID
}
func (*WalletTransactionPeerTelegramGift ) TypeName () string {
return "walletTransactionPeerTelegramGift"
}
func (w *WalletTransactionPeerTelegramGift ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "walletTransactionPeerTelegramGift" ,
ID : WalletTransactionPeerTelegramGiftTypeID ,
}
if w == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "OwnProfile" ,
SchemaName : "own_profile" ,
Null : !w .Flags .Has (0 ),
},
}
return typ
}
func (w *WalletTransactionPeerTelegramGift ) SetFlags () {
if !(w .OwnProfile == false ) {
w .Flags .Set (0 )
}
}
func (w *WalletTransactionPeerTelegramGift ) Encode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerTelegramGift#f4729499 as nil" )
}
b .PutID (WalletTransactionPeerTelegramGiftTypeID )
return w .EncodeBare (b )
}
func (w *WalletTransactionPeerTelegramGift ) EncodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't encode walletTransactionPeerTelegramGift#f4729499 as nil" )
}
w .SetFlags ()
if err := w .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode walletTransactionPeerTelegramGift#f4729499: field flags: %w" , err )
}
return nil
}
func (w *WalletTransactionPeerTelegramGift ) Decode (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerTelegramGift#f4729499 to nil" )
}
if err := b .ConsumeID (WalletTransactionPeerTelegramGiftTypeID ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerTelegramGift#f4729499: %w" , err )
}
return w .DecodeBare (b )
}
func (w *WalletTransactionPeerTelegramGift ) DecodeBare (b *bin .Buffer ) error {
if w == nil {
return fmt .Errorf ("can't decode walletTransactionPeerTelegramGift#f4729499 to nil" )
}
{
if err := w .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode walletTransactionPeerTelegramGift#f4729499: field flags: %w" , err )
}
}
w .OwnProfile = w .Flags .Has (0 )
return nil
}
func (w *WalletTransactionPeerTelegramGift ) SetOwnProfile (value bool ) {
if value {
w .Flags .Set (0 )
w .OwnProfile = true
} else {
w .Flags .Unset (0 )
w .OwnProfile = false
}
}
func (w *WalletTransactionPeerTelegramGift ) GetOwnProfile () (value bool ) {
if w == nil {
return
}
return w .Flags .Has (0 )
}
const WalletTransactionPeerClassName = "WalletTransactionPeer"
type WalletTransactionPeerClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () WalletTransactionPeerClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeWalletTransactionPeer (buf *bin .Buffer ) (WalletTransactionPeerClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case WalletTransactionPeerUserTypeID :
v := WalletTransactionPeerUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
case WalletTransactionPeerAddressTypeID :
v := WalletTransactionPeerAddress {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
case WalletTransactionPeerOnrampTypeID :
v := WalletTransactionPeerOnramp {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
case WalletTransactionPeerUnsupportedTypeID :
v := WalletTransactionPeerUnsupported {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
case WalletTransactionPeerChannelTypeID :
v := WalletTransactionPeerChannel {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
case WalletTransactionPeerTelegramGiftTypeID :
v := WalletTransactionPeerTelegramGift {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode WalletTransactionPeerClass: %w" , bin .NewUnexpectedID (id ))
}
}
type WalletTransactionPeerBox struct {
WalletTransactionPeer WalletTransactionPeerClass
}
func (b *WalletTransactionPeerBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode WalletTransactionPeerBox to nil" )
}
v , err := DecodeWalletTransactionPeer (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .WalletTransactionPeer = v
return nil
}
func (b *WalletTransactionPeerBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .WalletTransactionPeer == nil {
return fmt .Errorf ("unable to encode WalletTransactionPeerClass as nil" )
}
return b .WalletTransactionPeer .Encode (buf )
}
The pages are generated with Golds v0.8.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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .