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 MessagesUninstallStickerSetRequest struct {
Stickerset InputStickerSetClass
}
const MessagesUninstallStickerSetRequestTypeID = 0xf96e55de
var (
_ bin .Encoder = &MessagesUninstallStickerSetRequest {}
_ bin .Decoder = &MessagesUninstallStickerSetRequest {}
_ bin .BareEncoder = &MessagesUninstallStickerSetRequest {}
_ bin .BareDecoder = &MessagesUninstallStickerSetRequest {}
)
func (u *MessagesUninstallStickerSetRequest ) Zero () bool {
if u == nil {
return true
}
if !(u .Stickerset == nil ) {
return false
}
return true
}
func (u *MessagesUninstallStickerSetRequest ) String () string {
if u == nil {
return "MessagesUninstallStickerSetRequest(nil)"
}
type Alias MessagesUninstallStickerSetRequest
return fmt .Sprintf ("MessagesUninstallStickerSetRequest%+v" , Alias (*u ))
}
func (u *MessagesUninstallStickerSetRequest ) FillFrom (from interface {
GetStickerset () (value InputStickerSetClass )
}) {
u .Stickerset = from .GetStickerset ()
}
func (*MessagesUninstallStickerSetRequest ) TypeID () uint32 {
return MessagesUninstallStickerSetRequestTypeID
}
func (*MessagesUninstallStickerSetRequest ) TypeName () string {
return "messages.uninstallStickerSet"
}
func (u *MessagesUninstallStickerSetRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.uninstallStickerSet" ,
ID : MessagesUninstallStickerSetRequestTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
}
return typ
}
func (u *MessagesUninstallStickerSetRequest ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode messages.uninstallStickerSet#f96e55de as nil" )
}
b .PutID (MessagesUninstallStickerSetRequestTypeID )
return u .EncodeBare (b )
}
func (u *MessagesUninstallStickerSetRequest ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode messages.uninstallStickerSet#f96e55de as nil" )
}
if u .Stickerset == nil {
return fmt .Errorf ("unable to encode messages.uninstallStickerSet#f96e55de: field stickerset is nil" )
}
if err := u .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.uninstallStickerSet#f96e55de: field stickerset: %w" , err )
}
return nil
}
func (u *MessagesUninstallStickerSetRequest ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode messages.uninstallStickerSet#f96e55de to nil" )
}
if err := b .ConsumeID (MessagesUninstallStickerSetRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.uninstallStickerSet#f96e55de: %w" , err )
}
return u .DecodeBare (b )
}
func (u *MessagesUninstallStickerSetRequest ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode messages.uninstallStickerSet#f96e55de to nil" )
}
{
value , err := DecodeInputStickerSet (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.uninstallStickerSet#f96e55de: field stickerset: %w" , err )
}
u .Stickerset = value
}
return nil
}
func (u *MessagesUninstallStickerSetRequest ) GetStickerset () (value InputStickerSetClass ) {
if u == nil {
return
}
return u .Stickerset
}
func (c *Client ) MessagesUninstallStickerSet (ctx context .Context , stickerset InputStickerSetClass ) (bool , error ) {
var result BoolBox
request := &MessagesUninstallStickerSetRequest {
Stickerset : stickerset ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , 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 .