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 AccountGetDefaultEmojiStatusesRequest struct {
Hash int64
}
const AccountGetDefaultEmojiStatusesRequestTypeID = 0xd6753386
var (
_ bin .Encoder = &AccountGetDefaultEmojiStatusesRequest {}
_ bin .Decoder = &AccountGetDefaultEmojiStatusesRequest {}
_ bin .BareEncoder = &AccountGetDefaultEmojiStatusesRequest {}
_ bin .BareDecoder = &AccountGetDefaultEmojiStatusesRequest {}
)
func (g *AccountGetDefaultEmojiStatusesRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Hash == 0 ) {
return false
}
return true
}
func (g *AccountGetDefaultEmojiStatusesRequest ) String () string {
if g == nil {
return "AccountGetDefaultEmojiStatusesRequest(nil)"
}
type Alias AccountGetDefaultEmojiStatusesRequest
return fmt .Sprintf ("AccountGetDefaultEmojiStatusesRequest%+v" , Alias (*g ))
}
func (g *AccountGetDefaultEmojiStatusesRequest ) FillFrom (from interface {
GetHash () (value int64 )
}) {
g .Hash = from .GetHash ()
}
func (*AccountGetDefaultEmojiStatusesRequest ) TypeID () uint32 {
return AccountGetDefaultEmojiStatusesRequestTypeID
}
func (*AccountGetDefaultEmojiStatusesRequest ) TypeName () string {
return "account.getDefaultEmojiStatuses"
}
func (g *AccountGetDefaultEmojiStatusesRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.getDefaultEmojiStatuses" ,
ID : AccountGetDefaultEmojiStatusesRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Hash" ,
SchemaName : "hash" ,
},
}
return typ
}
func (g *AccountGetDefaultEmojiStatusesRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode account.getDefaultEmojiStatuses#d6753386 as nil" )
}
b .PutID (AccountGetDefaultEmojiStatusesRequestTypeID )
return g .EncodeBare (b )
}
func (g *AccountGetDefaultEmojiStatusesRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode account.getDefaultEmojiStatuses#d6753386 as nil" )
}
b .PutLong (g .Hash )
return nil
}
func (g *AccountGetDefaultEmojiStatusesRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode account.getDefaultEmojiStatuses#d6753386 to nil" )
}
if err := b .ConsumeID (AccountGetDefaultEmojiStatusesRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.getDefaultEmojiStatuses#d6753386: %w" , err )
}
return g .DecodeBare (b )
}
func (g *AccountGetDefaultEmojiStatusesRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode account.getDefaultEmojiStatuses#d6753386 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode account.getDefaultEmojiStatuses#d6753386: field hash: %w" , err )
}
g .Hash = value
}
return nil
}
func (g *AccountGetDefaultEmojiStatusesRequest ) GetHash () (value int64 ) {
if g == nil {
return
}
return g .Hash
}
func (c *Client ) AccountGetDefaultEmojiStatuses (ctx context .Context , hash int64 ) (AccountEmojiStatusesClass , error ) {
var result AccountEmojiStatusesBox
request := &AccountGetDefaultEmojiStatusesRequest {
Hash : hash ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .EmojiStatuses , 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 .