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 PaymentsGetStarsStatusRequest struct {
Flags bin .Fields
Ton bool
Peer InputPeerClass
}
const PaymentsGetStarsStatusRequestTypeID = 0x4ea9b3bf
var (
_ bin .Encoder = &PaymentsGetStarsStatusRequest {}
_ bin .Decoder = &PaymentsGetStarsStatusRequest {}
_ bin .BareEncoder = &PaymentsGetStarsStatusRequest {}
_ bin .BareDecoder = &PaymentsGetStarsStatusRequest {}
)
func (g *PaymentsGetStarsStatusRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Flags .Zero ()) {
return false
}
if !(g .Ton == false ) {
return false
}
if !(g .Peer == nil ) {
return false
}
return true
}
func (g *PaymentsGetStarsStatusRequest ) String () string {
if g == nil {
return "PaymentsGetStarsStatusRequest(nil)"
}
type Alias PaymentsGetStarsStatusRequest
return fmt .Sprintf ("PaymentsGetStarsStatusRequest%+v" , Alias (*g ))
}
func (g *PaymentsGetStarsStatusRequest ) FillFrom (from interface {
GetTon () (value bool )
GetPeer () (value InputPeerClass )
}) {
g .Ton = from .GetTon ()
g .Peer = from .GetPeer ()
}
func (*PaymentsGetStarsStatusRequest ) TypeID () uint32 {
return PaymentsGetStarsStatusRequestTypeID
}
func (*PaymentsGetStarsStatusRequest ) TypeName () string {
return "payments.getStarsStatus"
}
func (g *PaymentsGetStarsStatusRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "payments.getStarsStatus" ,
ID : PaymentsGetStarsStatusRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Ton" ,
SchemaName : "ton" ,
Null : !g .Flags .Has (0 ),
},
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (g *PaymentsGetStarsStatusRequest ) SetFlags () {
if !(g .Ton == false ) {
g .Flags .Set (0 )
}
}
func (g *PaymentsGetStarsStatusRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode payments.getStarsStatus#4ea9b3bf as nil" )
}
b .PutID (PaymentsGetStarsStatusRequestTypeID )
return g .EncodeBare (b )
}
func (g *PaymentsGetStarsStatusRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode payments.getStarsStatus#4ea9b3bf as nil" )
}
g .SetFlags ()
if err := g .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode payments.getStarsStatus#4ea9b3bf: field flags: %w" , err )
}
if g .Peer == nil {
return fmt .Errorf ("unable to encode payments.getStarsStatus#4ea9b3bf: field peer is nil" )
}
if err := g .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode payments.getStarsStatus#4ea9b3bf: field peer: %w" , err )
}
return nil
}
func (g *PaymentsGetStarsStatusRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode payments.getStarsStatus#4ea9b3bf to nil" )
}
if err := b .ConsumeID (PaymentsGetStarsStatusRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode payments.getStarsStatus#4ea9b3bf: %w" , err )
}
return g .DecodeBare (b )
}
func (g *PaymentsGetStarsStatusRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode payments.getStarsStatus#4ea9b3bf to nil" )
}
{
if err := g .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode payments.getStarsStatus#4ea9b3bf: field flags: %w" , err )
}
}
g .Ton = g .Flags .Has (0 )
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode payments.getStarsStatus#4ea9b3bf: field peer: %w" , err )
}
g .Peer = value
}
return nil
}
func (g *PaymentsGetStarsStatusRequest ) SetTon (value bool ) {
if value {
g .Flags .Set (0 )
g .Ton = true
} else {
g .Flags .Unset (0 )
g .Ton = false
}
}
func (g *PaymentsGetStarsStatusRequest ) GetTon () (value bool ) {
if g == nil {
return
}
return g .Flags .Has (0 )
}
func (g *PaymentsGetStarsStatusRequest ) GetPeer () (value InputPeerClass ) {
if g == nil {
return
}
return g .Peer
}
func (c *Client ) PaymentsGetStarsStatus (ctx context .Context , request *PaymentsGetStarsStatusRequest ) (*PaymentsStarsStatus , error ) {
var result PaymentsStarsStatus
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , nil
}
The pages are generated with Golds v0.8.4 . (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 .