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 PaymentSavedCredentialsCard struct {
ID string
Title string
}
const PaymentSavedCredentialsCardTypeID = 0xcdc27a1f
var (
_ bin .Encoder = &PaymentSavedCredentialsCard {}
_ bin .Decoder = &PaymentSavedCredentialsCard {}
_ bin .BareEncoder = &PaymentSavedCredentialsCard {}
_ bin .BareDecoder = &PaymentSavedCredentialsCard {}
)
func (p *PaymentSavedCredentialsCard ) Zero () bool {
if p == nil {
return true
}
if !(p .ID == "" ) {
return false
}
if !(p .Title == "" ) {
return false
}
return true
}
func (p *PaymentSavedCredentialsCard ) String () string {
if p == nil {
return "PaymentSavedCredentialsCard(nil)"
}
type Alias PaymentSavedCredentialsCard
return fmt .Sprintf ("PaymentSavedCredentialsCard%+v" , Alias (*p ))
}
func (p *PaymentSavedCredentialsCard ) FillFrom (from interface {
GetID () (value string )
GetTitle () (value string )
}) {
p .ID = from .GetID ()
p .Title = from .GetTitle ()
}
func (*PaymentSavedCredentialsCard ) TypeID () uint32 {
return PaymentSavedCredentialsCardTypeID
}
func (*PaymentSavedCredentialsCard ) TypeName () string {
return "paymentSavedCredentialsCard"
}
func (p *PaymentSavedCredentialsCard ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "paymentSavedCredentialsCard" ,
ID : PaymentSavedCredentialsCardTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (p *PaymentSavedCredentialsCard ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode paymentSavedCredentialsCard#cdc27a1f as nil" )
}
b .PutID (PaymentSavedCredentialsCardTypeID )
return p .EncodeBare (b )
}
func (p *PaymentSavedCredentialsCard ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode paymentSavedCredentialsCard#cdc27a1f as nil" )
}
b .PutString (p .ID )
b .PutString (p .Title )
return nil
}
func (p *PaymentSavedCredentialsCard ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode paymentSavedCredentialsCard#cdc27a1f to nil" )
}
if err := b .ConsumeID (PaymentSavedCredentialsCardTypeID ); err != nil {
return fmt .Errorf ("unable to decode paymentSavedCredentialsCard#cdc27a1f: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PaymentSavedCredentialsCard ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode paymentSavedCredentialsCard#cdc27a1f to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode paymentSavedCredentialsCard#cdc27a1f: field id: %w" , err )
}
p .ID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode paymentSavedCredentialsCard#cdc27a1f: field title: %w" , err )
}
p .Title = value
}
return nil
}
func (p *PaymentSavedCredentialsCard ) GetID () (value string ) {
if p == nil {
return
}
return p .ID
}
func (p *PaymentSavedCredentialsCard ) GetTitle () (value string ) {
if p == nil {
return
}
return p .Title
}
The pages are generated with Golds v0.6.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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .