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 PaymentsGetConnectedStarRefBotRequest struct {
Peer InputPeerClass
Bot InputUserClass
}
const PaymentsGetConnectedStarRefBotRequestTypeID = 0xb7d998f0
var (
_ bin .Encoder = &PaymentsGetConnectedStarRefBotRequest {}
_ bin .Decoder = &PaymentsGetConnectedStarRefBotRequest {}
_ bin .BareEncoder = &PaymentsGetConnectedStarRefBotRequest {}
_ bin .BareDecoder = &PaymentsGetConnectedStarRefBotRequest {}
)
func (g *PaymentsGetConnectedStarRefBotRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Peer == nil ) {
return false
}
if !(g .Bot == nil ) {
return false
}
return true
}
func (g *PaymentsGetConnectedStarRefBotRequest ) String () string {
if g == nil {
return "PaymentsGetConnectedStarRefBotRequest(nil)"
}
type Alias PaymentsGetConnectedStarRefBotRequest
return fmt .Sprintf ("PaymentsGetConnectedStarRefBotRequest%+v" , Alias (*g ))
}
func (g *PaymentsGetConnectedStarRefBotRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetBot () (value InputUserClass )
}) {
g .Peer = from .GetPeer ()
g .Bot = from .GetBot ()
}
func (*PaymentsGetConnectedStarRefBotRequest ) TypeID () uint32 {
return PaymentsGetConnectedStarRefBotRequestTypeID
}
func (*PaymentsGetConnectedStarRefBotRequest ) TypeName () string {
return "payments.getConnectedStarRefBot"
}
func (g *PaymentsGetConnectedStarRefBotRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "payments.getConnectedStarRefBot" ,
ID : PaymentsGetConnectedStarRefBotRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Bot" ,
SchemaName : "bot" ,
},
}
return typ
}
func (g *PaymentsGetConnectedStarRefBotRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode payments.getConnectedStarRefBot#b7d998f0 as nil" )
}
b .PutID (PaymentsGetConnectedStarRefBotRequestTypeID )
return g .EncodeBare (b )
}
func (g *PaymentsGetConnectedStarRefBotRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode payments.getConnectedStarRefBot#b7d998f0 as nil" )
}
if g .Peer == nil {
return fmt .Errorf ("unable to encode payments.getConnectedStarRefBot#b7d998f0: field peer is nil" )
}
if err := g .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode payments.getConnectedStarRefBot#b7d998f0: field peer: %w" , err )
}
if g .Bot == nil {
return fmt .Errorf ("unable to encode payments.getConnectedStarRefBot#b7d998f0: field bot is nil" )
}
if err := g .Bot .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode payments.getConnectedStarRefBot#b7d998f0: field bot: %w" , err )
}
return nil
}
func (g *PaymentsGetConnectedStarRefBotRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode payments.getConnectedStarRefBot#b7d998f0 to nil" )
}
if err := b .ConsumeID (PaymentsGetConnectedStarRefBotRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode payments.getConnectedStarRefBot#b7d998f0: %w" , err )
}
return g .DecodeBare (b )
}
func (g *PaymentsGetConnectedStarRefBotRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode payments.getConnectedStarRefBot#b7d998f0 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode payments.getConnectedStarRefBot#b7d998f0: field peer: %w" , err )
}
g .Peer = value
}
{
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode payments.getConnectedStarRefBot#b7d998f0: field bot: %w" , err )
}
g .Bot = value
}
return nil
}
func (g *PaymentsGetConnectedStarRefBotRequest ) GetPeer () (value InputPeerClass ) {
if g == nil {
return
}
return g .Peer
}
func (g *PaymentsGetConnectedStarRefBotRequest ) GetBot () (value InputUserClass ) {
if g == nil {
return
}
return g .Bot
}
func (c *Client ) PaymentsGetConnectedStarRefBot (ctx context .Context , request *PaymentsGetConnectedStarRefBotRequest ) (*PaymentsConnectedStarRefBots , error ) {
var result PaymentsConnectedStarRefBots
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 .