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 InvokeWithBusinessConnectionRequest struct {
ConnectionID string
Query bin .Object
}
const InvokeWithBusinessConnectionRequestTypeID = 0xdd289f8e
var (
_ bin .Encoder = &InvokeWithBusinessConnectionRequest {}
_ bin .Decoder = &InvokeWithBusinessConnectionRequest {}
_ bin .BareEncoder = &InvokeWithBusinessConnectionRequest {}
_ bin .BareDecoder = &InvokeWithBusinessConnectionRequest {}
)
func (i *InvokeWithBusinessConnectionRequest ) Zero () bool {
if i == nil {
return true
}
if !(i .ConnectionID == "" ) {
return false
}
if !(i .Query == nil ) {
return false
}
return true
}
func (i *InvokeWithBusinessConnectionRequest ) String () string {
if i == nil {
return "InvokeWithBusinessConnectionRequest(nil)"
}
type Alias InvokeWithBusinessConnectionRequest
return fmt .Sprintf ("InvokeWithBusinessConnectionRequest%+v" , Alias (*i ))
}
func (i *InvokeWithBusinessConnectionRequest ) FillFrom (from interface {
GetConnectionID () (value string )
GetQuery () (value bin .Object )
}) {
i .ConnectionID = from .GetConnectionID ()
i .Query = from .GetQuery ()
}
func (*InvokeWithBusinessConnectionRequest ) TypeID () uint32 {
return InvokeWithBusinessConnectionRequestTypeID
}
func (*InvokeWithBusinessConnectionRequest ) TypeName () string {
return "invokeWithBusinessConnection"
}
func (i *InvokeWithBusinessConnectionRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "invokeWithBusinessConnection" ,
ID : InvokeWithBusinessConnectionRequestTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ConnectionID" ,
SchemaName : "connection_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
}
return typ
}
func (i *InvokeWithBusinessConnectionRequest ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithBusinessConnection#dd289f8e as nil" )
}
b .PutID (InvokeWithBusinessConnectionRequestTypeID )
return i .EncodeBare (b )
}
func (i *InvokeWithBusinessConnectionRequest ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeWithBusinessConnection#dd289f8e as nil" )
}
b .PutString (i .ConnectionID )
if err := i .Query .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode invokeWithBusinessConnection#dd289f8e: field query: %w" , err )
}
return nil
}
func (i *InvokeWithBusinessConnectionRequest ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithBusinessConnection#dd289f8e to nil" )
}
if err := b .ConsumeID (InvokeWithBusinessConnectionRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode invokeWithBusinessConnection#dd289f8e: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InvokeWithBusinessConnectionRequest ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeWithBusinessConnection#dd289f8e to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode invokeWithBusinessConnection#dd289f8e: field connection_id: %w" , err )
}
i .ConnectionID = value
}
{
if err := i .Query .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode invokeWithBusinessConnection#dd289f8e: field query: %w" , err )
}
}
return nil
}
func (i *InvokeWithBusinessConnectionRequest ) GetConnectionID () (value string ) {
if i == nil {
return
}
return i .ConnectionID
}
func (i *InvokeWithBusinessConnectionRequest ) GetQuery () (value bin .Object ) {
if i == nil {
return
}
return i .Query
}
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 .