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 AccountGetWallPaperRequest struct {
Wallpaper InputWallPaperClass
}
const AccountGetWallPaperRequestTypeID = 0xfc8ddbea
var (
_ bin .Encoder = &AccountGetWallPaperRequest {}
_ bin .Decoder = &AccountGetWallPaperRequest {}
_ bin .BareEncoder = &AccountGetWallPaperRequest {}
_ bin .BareDecoder = &AccountGetWallPaperRequest {}
)
func (g *AccountGetWallPaperRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Wallpaper == nil ) {
return false
}
return true
}
func (g *AccountGetWallPaperRequest ) String () string {
if g == nil {
return "AccountGetWallPaperRequest(nil)"
}
type Alias AccountGetWallPaperRequest
return fmt .Sprintf ("AccountGetWallPaperRequest%+v" , Alias (*g ))
}
func (g *AccountGetWallPaperRequest ) FillFrom (from interface {
GetWallpaper () (value InputWallPaperClass )
}) {
g .Wallpaper = from .GetWallpaper ()
}
func (*AccountGetWallPaperRequest ) TypeID () uint32 {
return AccountGetWallPaperRequestTypeID
}
func (*AccountGetWallPaperRequest ) TypeName () string {
return "account.getWallPaper"
}
func (g *AccountGetWallPaperRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.getWallPaper" ,
ID : AccountGetWallPaperRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Wallpaper" ,
SchemaName : "wallpaper" ,
},
}
return typ
}
func (g *AccountGetWallPaperRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode account.getWallPaper#fc8ddbea as nil" )
}
b .PutID (AccountGetWallPaperRequestTypeID )
return g .EncodeBare (b )
}
func (g *AccountGetWallPaperRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode account.getWallPaper#fc8ddbea as nil" )
}
if g .Wallpaper == nil {
return fmt .Errorf ("unable to encode account.getWallPaper#fc8ddbea: field wallpaper is nil" )
}
if err := g .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode account.getWallPaper#fc8ddbea: field wallpaper: %w" , err )
}
return nil
}
func (g *AccountGetWallPaperRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode account.getWallPaper#fc8ddbea to nil" )
}
if err := b .ConsumeID (AccountGetWallPaperRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.getWallPaper#fc8ddbea: %w" , err )
}
return g .DecodeBare (b )
}
func (g *AccountGetWallPaperRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode account.getWallPaper#fc8ddbea to nil" )
}
{
value , err := DecodeInputWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode account.getWallPaper#fc8ddbea: field wallpaper: %w" , err )
}
g .Wallpaper = value
}
return nil
}
func (g *AccountGetWallPaperRequest ) GetWallpaper () (value InputWallPaperClass ) {
if g == nil {
return
}
return g .Wallpaper
}
func (c *Client ) AccountGetWallPaper (ctx context .Context , wallpaper InputWallPaperClass ) (WallPaperClass , error ) {
var result WallPaperBox
request := &AccountGetWallPaperRequest {
Wallpaper : wallpaper ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .WallPaper , 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 .