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 UsersGetFullUserRequest struct {
ID InputUserClass
}
const UsersGetFullUserRequestTypeID = 0xb60f5918
var (
_ bin .Encoder = &UsersGetFullUserRequest {}
_ bin .Decoder = &UsersGetFullUserRequest {}
_ bin .BareEncoder = &UsersGetFullUserRequest {}
_ bin .BareDecoder = &UsersGetFullUserRequest {}
)
func (g *UsersGetFullUserRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .ID == nil ) {
return false
}
return true
}
func (g *UsersGetFullUserRequest ) String () string {
if g == nil {
return "UsersGetFullUserRequest(nil)"
}
type Alias UsersGetFullUserRequest
return fmt .Sprintf ("UsersGetFullUserRequest%+v" , Alias (*g ))
}
func (g *UsersGetFullUserRequest ) FillFrom (from interface {
GetID () (value InputUserClass )
}) {
g .ID = from .GetID ()
}
func (*UsersGetFullUserRequest ) TypeID () uint32 {
return UsersGetFullUserRequestTypeID
}
func (*UsersGetFullUserRequest ) TypeName () string {
return "users.getFullUser"
}
func (g *UsersGetFullUserRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "users.getFullUser" ,
ID : UsersGetFullUserRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
}
return typ
}
func (g *UsersGetFullUserRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode users.getFullUser#b60f5918 as nil" )
}
b .PutID (UsersGetFullUserRequestTypeID )
return g .EncodeBare (b )
}
func (g *UsersGetFullUserRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode users.getFullUser#b60f5918 as nil" )
}
if g .ID == nil {
return fmt .Errorf ("unable to encode users.getFullUser#b60f5918: field id is nil" )
}
if err := g .ID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode users.getFullUser#b60f5918: field id: %w" , err )
}
return nil
}
func (g *UsersGetFullUserRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode users.getFullUser#b60f5918 to nil" )
}
if err := b .ConsumeID (UsersGetFullUserRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode users.getFullUser#b60f5918: %w" , err )
}
return g .DecodeBare (b )
}
func (g *UsersGetFullUserRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode users.getFullUser#b60f5918 to nil" )
}
{
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode users.getFullUser#b60f5918: field id: %w" , err )
}
g .ID = value
}
return nil
}
func (g *UsersGetFullUserRequest ) GetID () (value InputUserClass ) {
if g == nil {
return
}
return g .ID
}
func (c *Client ) UsersGetFullUser (ctx context .Context , id InputUserClass ) (*UsersUserFull , error ) {
var result UsersUserFull
request := &UsersGetFullUserRequest {
ID : id ,
}
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 .