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 ChannelsUpdateEmojiStatusRequest struct {
Channel InputChannelClass
EmojiStatus EmojiStatusClass
}
const ChannelsUpdateEmojiStatusRequestTypeID = 0xf0d3e6a8
var (
_ bin .Encoder = &ChannelsUpdateEmojiStatusRequest {}
_ bin .Decoder = &ChannelsUpdateEmojiStatusRequest {}
_ bin .BareEncoder = &ChannelsUpdateEmojiStatusRequest {}
_ bin .BareDecoder = &ChannelsUpdateEmojiStatusRequest {}
)
func (u *ChannelsUpdateEmojiStatusRequest ) Zero () bool {
if u == nil {
return true
}
if !(u .Channel == nil ) {
return false
}
if !(u .EmojiStatus == nil ) {
return false
}
return true
}
func (u *ChannelsUpdateEmojiStatusRequest ) String () string {
if u == nil {
return "ChannelsUpdateEmojiStatusRequest(nil)"
}
type Alias ChannelsUpdateEmojiStatusRequest
return fmt .Sprintf ("ChannelsUpdateEmojiStatusRequest%+v" , Alias (*u ))
}
func (u *ChannelsUpdateEmojiStatusRequest ) FillFrom (from interface {
GetChannel () (value InputChannelClass )
GetEmojiStatus () (value EmojiStatusClass )
}) {
u .Channel = from .GetChannel ()
u .EmojiStatus = from .GetEmojiStatus ()
}
func (*ChannelsUpdateEmojiStatusRequest ) TypeID () uint32 {
return ChannelsUpdateEmojiStatusRequestTypeID
}
func (*ChannelsUpdateEmojiStatusRequest ) TypeName () string {
return "channels.updateEmojiStatus"
}
func (u *ChannelsUpdateEmojiStatusRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "channels.updateEmojiStatus" ,
ID : ChannelsUpdateEmojiStatusRequestTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Channel" ,
SchemaName : "channel" ,
},
{
Name : "EmojiStatus" ,
SchemaName : "emoji_status" ,
},
}
return typ
}
func (u *ChannelsUpdateEmojiStatusRequest ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode channels.updateEmojiStatus#f0d3e6a8 as nil" )
}
b .PutID (ChannelsUpdateEmojiStatusRequestTypeID )
return u .EncodeBare (b )
}
func (u *ChannelsUpdateEmojiStatusRequest ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode channels.updateEmojiStatus#f0d3e6a8 as nil" )
}
if u .Channel == nil {
return fmt .Errorf ("unable to encode channels.updateEmojiStatus#f0d3e6a8: field channel is nil" )
}
if err := u .Channel .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channels.updateEmojiStatus#f0d3e6a8: field channel: %w" , err )
}
if u .EmojiStatus == nil {
return fmt .Errorf ("unable to encode channels.updateEmojiStatus#f0d3e6a8: field emoji_status is nil" )
}
if err := u .EmojiStatus .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channels.updateEmojiStatus#f0d3e6a8: field emoji_status: %w" , err )
}
return nil
}
func (u *ChannelsUpdateEmojiStatusRequest ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode channels.updateEmojiStatus#f0d3e6a8 to nil" )
}
if err := b .ConsumeID (ChannelsUpdateEmojiStatusRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode channels.updateEmojiStatus#f0d3e6a8: %w" , err )
}
return u .DecodeBare (b )
}
func (u *ChannelsUpdateEmojiStatusRequest ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode channels.updateEmojiStatus#f0d3e6a8 to nil" )
}
{
value , err := DecodeInputChannel (b )
if err != nil {
return fmt .Errorf ("unable to decode channels.updateEmojiStatus#f0d3e6a8: field channel: %w" , err )
}
u .Channel = value
}
{
value , err := DecodeEmojiStatus (b )
if err != nil {
return fmt .Errorf ("unable to decode channels.updateEmojiStatus#f0d3e6a8: field emoji_status: %w" , err )
}
u .EmojiStatus = value
}
return nil
}
func (u *ChannelsUpdateEmojiStatusRequest ) GetChannel () (value InputChannelClass ) {
if u == nil {
return
}
return u .Channel
}
func (u *ChannelsUpdateEmojiStatusRequest ) GetEmojiStatus () (value EmojiStatusClass ) {
if u == nil {
return
}
return u .EmojiStatus
}
func (u *ChannelsUpdateEmojiStatusRequest ) GetChannelAsNotEmpty () (NotEmptyInputChannel , bool ) {
return u .Channel .AsNotEmpty ()
}
func (u *ChannelsUpdateEmojiStatusRequest ) GetEmojiStatusAsNotEmpty () (NotEmptyEmojiStatus , bool ) {
return u .EmojiStatus .AsNotEmpty ()
}
func (c *Client ) ChannelsUpdateEmojiStatus (ctx context .Context , request *ChannelsUpdateEmojiStatusRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , 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 .