// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// WalletCardSticker represents TL type `wallet.cardSticker#f3010cba`.
//
// See https://core.telegram.org/constructor/wallet.cardSticker for reference.
type WalletCardSticker struct {
	// Coordinates field of WalletCardSticker.
	Coordinates MediaAreaCoordinates
	// Nft field of WalletCardSticker.
	Nft WalletNftItem
}

// WalletCardStickerTypeID is TL type id of WalletCardSticker.
const WalletCardStickerTypeID = 0xf3010cba

// Ensuring interfaces in compile-time for WalletCardSticker.
var (
	_ bin.Encoder     = &WalletCardSticker{}
	_ bin.Decoder     = &WalletCardSticker{}
	_ bin.BareEncoder = &WalletCardSticker{}
	_ bin.BareDecoder = &WalletCardSticker{}
)

func ( *WalletCardSticker) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.Nft.Zero()) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *WalletCardSticker) () string {
	if  == nil {
		return "WalletCardSticker(nil)"
	}
	type  WalletCardSticker
	return fmt.Sprintf("WalletCardSticker%+v", (*))
}

// FillFrom fills WalletCardSticker from given interface.
func ( *WalletCardSticker) ( interface {
	() ( MediaAreaCoordinates)
	() ( WalletNftItem)
}) {
	.Coordinates = .()
	.Nft = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*WalletCardSticker) () uint32 {
	return WalletCardStickerTypeID
}

// TypeName returns name of type in TL schema.
func (*WalletCardSticker) () string {
	return "wallet.cardSticker"
}

// TypeInfo returns info about TL type.
func ( *WalletCardSticker) () tdp.Type {
	 := tdp.Type{
		Name: "wallet.cardSticker",
		ID:   WalletCardStickerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "Nft",
			SchemaName: "nft",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WalletCardSticker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode wallet.cardSticker#f3010cba as nil")
	}
	.PutID(WalletCardStickerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WalletCardSticker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode wallet.cardSticker#f3010cba as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode wallet.cardSticker#f3010cba: field coordinates: %w", )
	}
	if  := .Nft.Encode();  != nil {
		return fmt.Errorf("unable to encode wallet.cardSticker#f3010cba: field nft: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *WalletCardSticker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode wallet.cardSticker#f3010cba to nil")
	}
	if  := .ConsumeID(WalletCardStickerTypeID);  != nil {
		return fmt.Errorf("unable to decode wallet.cardSticker#f3010cba: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *WalletCardSticker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode wallet.cardSticker#f3010cba to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode wallet.cardSticker#f3010cba: field coordinates: %w", )
		}
	}
	{
		if  := .Nft.Decode();  != nil {
			return fmt.Errorf("unable to decode wallet.cardSticker#f3010cba: field nft: %w", )
		}
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *WalletCardSticker) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

// GetNft returns value of Nft field.
func ( *WalletCardSticker) () ( WalletNftItem) {
	if  == nil {
		return
	}
	return .Nft
}