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 OnrampLimits struct {
BaseCurrency string
BaseMinAmount string
BaseMaxAmount string
CryptoMinAmount string
CryptoMaxAmount string
PaymentMethod string
}
const OnrampLimitsTypeID = 0x7be2677e
var (
_ bin .Encoder = &OnrampLimits {}
_ bin .Decoder = &OnrampLimits {}
_ bin .BareEncoder = &OnrampLimits {}
_ bin .BareDecoder = &OnrampLimits {}
)
func (o *OnrampLimits ) Zero () bool {
if o == nil {
return true
}
if !(o .BaseCurrency == "" ) {
return false
}
if !(o .BaseMinAmount == "" ) {
return false
}
if !(o .BaseMaxAmount == "" ) {
return false
}
if !(o .CryptoMinAmount == "" ) {
return false
}
if !(o .CryptoMaxAmount == "" ) {
return false
}
if !(o .PaymentMethod == "" ) {
return false
}
return true
}
func (o *OnrampLimits ) String () string {
if o == nil {
return "OnrampLimits(nil)"
}
type Alias OnrampLimits
return fmt .Sprintf ("OnrampLimits%+v" , Alias (*o ))
}
func (o *OnrampLimits ) FillFrom (from interface {
GetBaseCurrency () (value string )
GetBaseMinAmount () (value string )
GetBaseMaxAmount () (value string )
GetCryptoMinAmount () (value string )
GetCryptoMaxAmount () (value string )
GetPaymentMethod () (value string )
}) {
o .BaseCurrency = from .GetBaseCurrency ()
o .BaseMinAmount = from .GetBaseMinAmount ()
o .BaseMaxAmount = from .GetBaseMaxAmount ()
o .CryptoMinAmount = from .GetCryptoMinAmount ()
o .CryptoMaxAmount = from .GetCryptoMaxAmount ()
o .PaymentMethod = from .GetPaymentMethod ()
}
func (*OnrampLimits ) TypeID () uint32 {
return OnrampLimitsTypeID
}
func (*OnrampLimits ) TypeName () string {
return "onrampLimits"
}
func (o *OnrampLimits ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "onrampLimits" ,
ID : OnrampLimitsTypeID ,
}
if o == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "BaseCurrency" ,
SchemaName : "base_currency" ,
},
{
Name : "BaseMinAmount" ,
SchemaName : "base_min_amount" ,
},
{
Name : "BaseMaxAmount" ,
SchemaName : "base_max_amount" ,
},
{
Name : "CryptoMinAmount" ,
SchemaName : "crypto_min_amount" ,
},
{
Name : "CryptoMaxAmount" ,
SchemaName : "crypto_max_amount" ,
},
{
Name : "PaymentMethod" ,
SchemaName : "payment_method" ,
},
}
return typ
}
func (o *OnrampLimits ) Encode (b *bin .Buffer ) error {
if o == nil {
return fmt .Errorf ("can't encode onrampLimits#7be2677e as nil" )
}
b .PutID (OnrampLimitsTypeID )
return o .EncodeBare (b )
}
func (o *OnrampLimits ) EncodeBare (b *bin .Buffer ) error {
if o == nil {
return fmt .Errorf ("can't encode onrampLimits#7be2677e as nil" )
}
b .PutString (o .BaseCurrency )
b .PutString (o .BaseMinAmount )
b .PutString (o .BaseMaxAmount )
b .PutString (o .CryptoMinAmount )
b .PutString (o .CryptoMaxAmount )
b .PutString (o .PaymentMethod )
return nil
}
func (o *OnrampLimits ) Decode (b *bin .Buffer ) error {
if o == nil {
return fmt .Errorf ("can't decode onrampLimits#7be2677e to nil" )
}
if err := b .ConsumeID (OnrampLimitsTypeID ); err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: %w" , err )
}
return o .DecodeBare (b )
}
func (o *OnrampLimits ) DecodeBare (b *bin .Buffer ) error {
if o == nil {
return fmt .Errorf ("can't decode onrampLimits#7be2677e to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field base_currency: %w" , err )
}
o .BaseCurrency = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field base_min_amount: %w" , err )
}
o .BaseMinAmount = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field base_max_amount: %w" , err )
}
o .BaseMaxAmount = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field crypto_min_amount: %w" , err )
}
o .CryptoMinAmount = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field crypto_max_amount: %w" , err )
}
o .CryptoMaxAmount = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode onrampLimits#7be2677e: field payment_method: %w" , err )
}
o .PaymentMethod = value
}
return nil
}
func (o *OnrampLimits ) GetBaseCurrency () (value string ) {
if o == nil {
return
}
return o .BaseCurrency
}
func (o *OnrampLimits ) GetBaseMinAmount () (value string ) {
if o == nil {
return
}
return o .BaseMinAmount
}
func (o *OnrampLimits ) GetBaseMaxAmount () (value string ) {
if o == nil {
return
}
return o .BaseMaxAmount
}
func (o *OnrampLimits ) GetCryptoMinAmount () (value string ) {
if o == nil {
return
}
return o .CryptoMinAmount
}
func (o *OnrampLimits ) GetCryptoMaxAmount () (value string ) {
if o == nil {
return
}
return o .CryptoMaxAmount
}
func (o *OnrampLimits ) GetPaymentMethod () (value string ) {
if o == nil {
return
}
return o .PaymentMethod
}
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 .