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