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