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 MessagesClearRecentStickersRequest struct {
Flags bin .Fields
Attached bool
}
const MessagesClearRecentStickersRequestTypeID = 0x8999602d
var (
_ bin .Encoder = &MessagesClearRecentStickersRequest {}
_ bin .Decoder = &MessagesClearRecentStickersRequest {}
_ bin .BareEncoder = &MessagesClearRecentStickersRequest {}
_ bin .BareDecoder = &MessagesClearRecentStickersRequest {}
)
func (c *MessagesClearRecentStickersRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Flags .Zero ()) {
return false
}
if !(c .Attached == false ) {
return false
}
return true
}
func (c *MessagesClearRecentStickersRequest ) String () string {
if c == nil {
return "MessagesClearRecentStickersRequest(nil)"
}
type Alias MessagesClearRecentStickersRequest
return fmt .Sprintf ("MessagesClearRecentStickersRequest%+v" , Alias (*c ))
}
func (c *MessagesClearRecentStickersRequest ) FillFrom (from interface {
GetAttached () (value bool )
}) {
c .Attached = from .GetAttached ()
}
func (*MessagesClearRecentStickersRequest ) TypeID () uint32 {
return MessagesClearRecentStickersRequestTypeID
}
func (*MessagesClearRecentStickersRequest ) TypeName () string {
return "messages.clearRecentStickers"
}
func (c *MessagesClearRecentStickersRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.clearRecentStickers" ,
ID : MessagesClearRecentStickersRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Attached" ,
SchemaName : "attached" ,
Null : !c .Flags .Has (0 ),
},
}
return typ
}
func (c *MessagesClearRecentStickersRequest ) SetFlags () {
if !(c .Attached == false ) {
c .Flags .Set (0 )
}
}
func (c *MessagesClearRecentStickersRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.clearRecentStickers#8999602d as nil" )
}
b .PutID (MessagesClearRecentStickersRequestTypeID )
return c .EncodeBare (b )
}
func (c *MessagesClearRecentStickersRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.clearRecentStickers#8999602d as nil" )
}
c .SetFlags ()
if err := c .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.clearRecentStickers#8999602d: field flags: %w" , err )
}
return nil
}
func (c *MessagesClearRecentStickersRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.clearRecentStickers#8999602d to nil" )
}
if err := b .ConsumeID (MessagesClearRecentStickersRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.clearRecentStickers#8999602d: %w" , err )
}
return c .DecodeBare (b )
}
func (c *MessagesClearRecentStickersRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.clearRecentStickers#8999602d to nil" )
}
{
if err := c .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messages.clearRecentStickers#8999602d: field flags: %w" , err )
}
}
c .Attached = c .Flags .Has (0 )
return nil
}
func (c *MessagesClearRecentStickersRequest ) SetAttached (value bool ) {
if value {
c .Flags .Set (0 )
c .Attached = true
} else {
c .Flags .Unset (0 )
c .Attached = false
}
}
func (c *MessagesClearRecentStickersRequest ) GetAttached () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (0 )
}
func (c *Client ) MessagesClearRecentStickers (ctx context .Context , request *MessagesClearRecentStickersRequest ) (bool , error ) {
var result BoolBox
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 .