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 StickersRenameStickerSetRequest struct {
Stickerset InputStickerSetClass
Title string
}
const StickersRenameStickerSetRequestTypeID = 0x124b1c00
var (
_ bin .Encoder = &StickersRenameStickerSetRequest {}
_ bin .Decoder = &StickersRenameStickerSetRequest {}
_ bin .BareEncoder = &StickersRenameStickerSetRequest {}
_ bin .BareDecoder = &StickersRenameStickerSetRequest {}
)
func (r *StickersRenameStickerSetRequest ) Zero () bool {
if r == nil {
return true
}
if !(r .Stickerset == nil ) {
return false
}
if !(r .Title == "" ) {
return false
}
return true
}
func (r *StickersRenameStickerSetRequest ) String () string {
if r == nil {
return "StickersRenameStickerSetRequest(nil)"
}
type Alias StickersRenameStickerSetRequest
return fmt .Sprintf ("StickersRenameStickerSetRequest%+v" , Alias (*r ))
}
func (r *StickersRenameStickerSetRequest ) FillFrom (from interface {
GetStickerset () (value InputStickerSetClass )
GetTitle () (value string )
}) {
r .Stickerset = from .GetStickerset ()
r .Title = from .GetTitle ()
}
func (*StickersRenameStickerSetRequest ) TypeID () uint32 {
return StickersRenameStickerSetRequestTypeID
}
func (*StickersRenameStickerSetRequest ) TypeName () string {
return "stickers.renameStickerSet"
}
func (r *StickersRenameStickerSetRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "stickers.renameStickerSet" ,
ID : StickersRenameStickerSetRequestTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
},
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (r *StickersRenameStickerSetRequest ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode stickers.renameStickerSet#124b1c00 as nil" )
}
b .PutID (StickersRenameStickerSetRequestTypeID )
return r .EncodeBare (b )
}
func (r *StickersRenameStickerSetRequest ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode stickers.renameStickerSet#124b1c00 as nil" )
}
if r .Stickerset == nil {
return fmt .Errorf ("unable to encode stickers.renameStickerSet#124b1c00: field stickerset is nil" )
}
if err := r .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode stickers.renameStickerSet#124b1c00: field stickerset: %w" , err )
}
b .PutString (r .Title )
return nil
}
func (r *StickersRenameStickerSetRequest ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode stickers.renameStickerSet#124b1c00 to nil" )
}
if err := b .ConsumeID (StickersRenameStickerSetRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode stickers.renameStickerSet#124b1c00: %w" , err )
}
return r .DecodeBare (b )
}
func (r *StickersRenameStickerSetRequest ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode stickers.renameStickerSet#124b1c00 to nil" )
}
{
value , err := DecodeInputStickerSet (b )
if err != nil {
return fmt .Errorf ("unable to decode stickers.renameStickerSet#124b1c00: field stickerset: %w" , err )
}
r .Stickerset = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode stickers.renameStickerSet#124b1c00: field title: %w" , err )
}
r .Title = value
}
return nil
}
func (r *StickersRenameStickerSetRequest ) GetStickerset () (value InputStickerSetClass ) {
if r == nil {
return
}
return r .Stickerset
}
func (r *StickersRenameStickerSetRequest ) GetTitle () (value string ) {
if r == nil {
return
}
return r .Title
}
func (c *Client ) StickersRenameStickerSet (ctx context .Context , request *StickersRenameStickerSetRequest ) (MessagesStickerSetClass , error ) {
var result MessagesStickerSetBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .StickerSet , 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 .