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