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 HelpGetDeepLinkInfoRequest struct {
Path string
}
const HelpGetDeepLinkInfoRequestTypeID = 0x3fedc75f
var (
_ bin .Encoder = &HelpGetDeepLinkInfoRequest {}
_ bin .Decoder = &HelpGetDeepLinkInfoRequest {}
_ bin .BareEncoder = &HelpGetDeepLinkInfoRequest {}
_ bin .BareDecoder = &HelpGetDeepLinkInfoRequest {}
)
func (g *HelpGetDeepLinkInfoRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Path == "" ) {
return false
}
return true
}
func (g *HelpGetDeepLinkInfoRequest ) String () string {
if g == nil {
return "HelpGetDeepLinkInfoRequest(nil)"
}
type Alias HelpGetDeepLinkInfoRequest
return fmt .Sprintf ("HelpGetDeepLinkInfoRequest%+v" , Alias (*g ))
}
func (g *HelpGetDeepLinkInfoRequest ) FillFrom (from interface {
GetPath () (value string )
}) {
g .Path = from .GetPath ()
}
func (*HelpGetDeepLinkInfoRequest ) TypeID () uint32 {
return HelpGetDeepLinkInfoRequestTypeID
}
func (*HelpGetDeepLinkInfoRequest ) TypeName () string {
return "help.getDeepLinkInfo"
}
func (g *HelpGetDeepLinkInfoRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "help.getDeepLinkInfo" ,
ID : HelpGetDeepLinkInfoRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Path" ,
SchemaName : "path" ,
},
}
return typ
}
func (g *HelpGetDeepLinkInfoRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode help.getDeepLinkInfo#3fedc75f as nil" )
}
b .PutID (HelpGetDeepLinkInfoRequestTypeID )
return g .EncodeBare (b )
}
func (g *HelpGetDeepLinkInfoRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode help.getDeepLinkInfo#3fedc75f as nil" )
}
b .PutString (g .Path )
return nil
}
func (g *HelpGetDeepLinkInfoRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode help.getDeepLinkInfo#3fedc75f to nil" )
}
if err := b .ConsumeID (HelpGetDeepLinkInfoRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode help.getDeepLinkInfo#3fedc75f: %w" , err )
}
return g .DecodeBare (b )
}
func (g *HelpGetDeepLinkInfoRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode help.getDeepLinkInfo#3fedc75f to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode help.getDeepLinkInfo#3fedc75f: field path: %w" , err )
}
g .Path = value
}
return nil
}
func (g *HelpGetDeepLinkInfoRequest ) GetPath () (value string ) {
if g == nil {
return
}
return g .Path
}
func (c *Client ) HelpGetDeepLinkInfo (ctx context .Context , path string ) (HelpDeepLinkInfoClass , error ) {
var result HelpDeepLinkInfoBox
request := &HelpGetDeepLinkInfoRequest {
Path : path ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .DeepLinkInfo , nil
}
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 .