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 WalletTonConnectSubmitResponseRequest struct {
Flags bin .Fields
SessionID int64
MsgID int
Body []byte
TraceID string
}
const WalletTonConnectSubmitResponseRequestTypeID = 0xfac67d3c
var (
_ bin .Encoder = &WalletTonConnectSubmitResponseRequest {}
_ bin .Decoder = &WalletTonConnectSubmitResponseRequest {}
_ bin .BareEncoder = &WalletTonConnectSubmitResponseRequest {}
_ bin .BareDecoder = &WalletTonConnectSubmitResponseRequest {}
)
func (t *WalletTonConnectSubmitResponseRequest ) Zero () bool {
if t == nil {
return true
}
if !(t .Flags .Zero ()) {
return false
}
if !(t .SessionID == 0 ) {
return false
}
if !(t .MsgID == 0 ) {
return false
}
if !(t .Body == nil ) {
return false
}
if !(t .TraceID == "" ) {
return false
}
return true
}
func (t *WalletTonConnectSubmitResponseRequest ) String () string {
if t == nil {
return "WalletTonConnectSubmitResponseRequest(nil)"
}
type Alias WalletTonConnectSubmitResponseRequest
return fmt .Sprintf ("WalletTonConnectSubmitResponseRequest%+v" , Alias (*t ))
}
func (t *WalletTonConnectSubmitResponseRequest ) FillFrom (from interface {
GetSessionID () (value int64 )
GetMsgID () (value int )
GetBody () (value []byte )
GetTraceID () (value string , ok bool )
}) {
t .SessionID = from .GetSessionID ()
t .MsgID = from .GetMsgID ()
t .Body = from .GetBody ()
if val , ok := from .GetTraceID (); ok {
t .TraceID = val
}
}
func (*WalletTonConnectSubmitResponseRequest ) TypeID () uint32 {
return WalletTonConnectSubmitResponseRequestTypeID
}
func (*WalletTonConnectSubmitResponseRequest ) TypeName () string {
return "wallet.tonConnectSubmitResponse"
}
func (t *WalletTonConnectSubmitResponseRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "wallet.tonConnectSubmitResponse" ,
ID : WalletTonConnectSubmitResponseRequestTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "SessionID" ,
SchemaName : "session_id" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "Body" ,
SchemaName : "body" ,
},
{
Name : "TraceID" ,
SchemaName : "trace_id" ,
Null : !t .Flags .Has (0 ),
},
}
return typ
}
func (t *WalletTonConnectSubmitResponseRequest ) SetFlags () {
if !(t .TraceID == "" ) {
t .Flags .Set (0 )
}
}
func (t *WalletTonConnectSubmitResponseRequest ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode wallet.tonConnectSubmitResponse#fac67d3c as nil" )
}
b .PutID (WalletTonConnectSubmitResponseRequestTypeID )
return t .EncodeBare (b )
}
func (t *WalletTonConnectSubmitResponseRequest ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode wallet.tonConnectSubmitResponse#fac67d3c as nil" )
}
t .SetFlags ()
if err := t .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode wallet.tonConnectSubmitResponse#fac67d3c: field flags: %w" , err )
}
b .PutLong (t .SessionID )
b .PutInt (t .MsgID )
b .PutBytes (t .Body )
if t .Flags .Has (0 ) {
b .PutString (t .TraceID )
}
return nil
}
func (t *WalletTonConnectSubmitResponseRequest ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode wallet.tonConnectSubmitResponse#fac67d3c to nil" )
}
if err := b .ConsumeID (WalletTonConnectSubmitResponseRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: %w" , err )
}
return t .DecodeBare (b )
}
func (t *WalletTonConnectSubmitResponseRequest ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode wallet.tonConnectSubmitResponse#fac67d3c to nil" )
}
{
if err := t .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: field session_id: %w" , err )
}
t .SessionID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: field msg_id: %w" , err )
}
t .MsgID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: field body: %w" , err )
}
t .Body = value
}
if t .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode wallet.tonConnectSubmitResponse#fac67d3c: field trace_id: %w" , err )
}
t .TraceID = value
}
return nil
}
func (t *WalletTonConnectSubmitResponseRequest ) GetSessionID () (value int64 ) {
if t == nil {
return
}
return t .SessionID
}
func (t *WalletTonConnectSubmitResponseRequest ) GetMsgID () (value int ) {
if t == nil {
return
}
return t .MsgID
}
func (t *WalletTonConnectSubmitResponseRequest ) GetBody () (value []byte ) {
if t == nil {
return
}
return t .Body
}
func (t *WalletTonConnectSubmitResponseRequest ) SetTraceID (value string ) {
t .Flags .Set (0 )
t .TraceID = value
}
func (t *WalletTonConnectSubmitResponseRequest ) GetTraceID () (value string , ok bool ) {
if t == nil {
return
}
if !t .Flags .Has (0 ) {
return value , false
}
return t .TraceID , true
}
func (c *Client ) WalletTonConnectSubmitResponse (ctx context .Context , request *WalletTonConnectSubmitResponseRequest ) (bool , error ) {
var result BoolBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , nil
}
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 .