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