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 InputWalletCardSticker struct {
Coordinates MediaAreaCoordinates
NftAddress string
}
const InputWalletCardStickerTypeID = 0x57df45a7
var (
_ bin .Encoder = &InputWalletCardSticker {}
_ bin .Decoder = &InputWalletCardSticker {}
_ bin .BareEncoder = &InputWalletCardSticker {}
_ bin .BareDecoder = &InputWalletCardSticker {}
)
func (i *InputWalletCardSticker ) Zero () bool {
if i == nil {
return true
}
if !(i .Coordinates .Zero ()) {
return false
}
if !(i .NftAddress == "" ) {
return false
}
return true
}
func (i *InputWalletCardSticker ) String () string {
if i == nil {
return "InputWalletCardSticker(nil)"
}
type Alias InputWalletCardSticker
return fmt .Sprintf ("InputWalletCardSticker%+v" , Alias (*i ))
}
func (i *InputWalletCardSticker ) FillFrom (from interface {
GetCoordinates () (value MediaAreaCoordinates )
GetNftAddress () (value string )
}) {
i .Coordinates = from .GetCoordinates ()
i .NftAddress = from .GetNftAddress ()
}
func (*InputWalletCardSticker ) TypeID () uint32 {
return InputWalletCardStickerTypeID
}
func (*InputWalletCardSticker ) TypeName () string {
return "inputWalletCardSticker"
}
func (i *InputWalletCardSticker ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputWalletCardSticker" ,
ID : InputWalletCardStickerTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Coordinates" ,
SchemaName : "coordinates" ,
},
{
Name : "NftAddress" ,
SchemaName : "nft_address" ,
},
}
return typ
}
func (i *InputWalletCardSticker ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputWalletCardSticker#57df45a7 as nil" )
}
b .PutID (InputWalletCardStickerTypeID )
return i .EncodeBare (b )
}
func (i *InputWalletCardSticker ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputWalletCardSticker#57df45a7 as nil" )
}
if err := i .Coordinates .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputWalletCardSticker#57df45a7: field coordinates: %w" , err )
}
b .PutString (i .NftAddress )
return nil
}
func (i *InputWalletCardSticker ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputWalletCardSticker#57df45a7 to nil" )
}
if err := b .ConsumeID (InputWalletCardStickerTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputWalletCardSticker#57df45a7: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputWalletCardSticker ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputWalletCardSticker#57df45a7 to nil" )
}
{
if err := i .Coordinates .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode inputWalletCardSticker#57df45a7: field coordinates: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode inputWalletCardSticker#57df45a7: field nft_address: %w" , err )
}
i .NftAddress = value
}
return nil
}
func (i *InputWalletCardSticker ) GetCoordinates () (value MediaAreaCoordinates ) {
if i == nil {
return
}
return i .Coordinates
}
func (i *InputWalletCardSticker ) GetNftAddress () (value string ) {
if i == nil {
return
}
return i .NftAddress
}
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 .