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 ChatlistsHideChatlistUpdatesRequest struct {
Chatlist InputChatlistDialogFilter
}
const ChatlistsHideChatlistUpdatesRequestTypeID = 0x66e486fb
var (
_ bin .Encoder = &ChatlistsHideChatlistUpdatesRequest {}
_ bin .Decoder = &ChatlistsHideChatlistUpdatesRequest {}
_ bin .BareEncoder = &ChatlistsHideChatlistUpdatesRequest {}
_ bin .BareDecoder = &ChatlistsHideChatlistUpdatesRequest {}
)
func (h *ChatlistsHideChatlistUpdatesRequest ) Zero () bool {
if h == nil {
return true
}
if !(h .Chatlist .Zero ()) {
return false
}
return true
}
func (h *ChatlistsHideChatlistUpdatesRequest ) String () string {
if h == nil {
return "ChatlistsHideChatlistUpdatesRequest(nil)"
}
type Alias ChatlistsHideChatlistUpdatesRequest
return fmt .Sprintf ("ChatlistsHideChatlistUpdatesRequest%+v" , Alias (*h ))
}
func (h *ChatlistsHideChatlistUpdatesRequest ) FillFrom (from interface {
GetChatlist () (value InputChatlistDialogFilter )
}) {
h .Chatlist = from .GetChatlist ()
}
func (*ChatlistsHideChatlistUpdatesRequest ) TypeID () uint32 {
return ChatlistsHideChatlistUpdatesRequestTypeID
}
func (*ChatlistsHideChatlistUpdatesRequest ) TypeName () string {
return "chatlists.hideChatlistUpdates"
}
func (h *ChatlistsHideChatlistUpdatesRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "chatlists.hideChatlistUpdates" ,
ID : ChatlistsHideChatlistUpdatesRequestTypeID ,
}
if h == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Chatlist" ,
SchemaName : "chatlist" ,
},
}
return typ
}
func (h *ChatlistsHideChatlistUpdatesRequest ) Encode (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't encode chatlists.hideChatlistUpdates#66e486fb as nil" )
}
b .PutID (ChatlistsHideChatlistUpdatesRequestTypeID )
return h .EncodeBare (b )
}
func (h *ChatlistsHideChatlistUpdatesRequest ) EncodeBare (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't encode chatlists.hideChatlistUpdates#66e486fb as nil" )
}
if err := h .Chatlist .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatlists.hideChatlistUpdates#66e486fb: field chatlist: %w" , err )
}
return nil
}
func (h *ChatlistsHideChatlistUpdatesRequest ) Decode (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't decode chatlists.hideChatlistUpdates#66e486fb to nil" )
}
if err := b .ConsumeID (ChatlistsHideChatlistUpdatesRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode chatlists.hideChatlistUpdates#66e486fb: %w" , err )
}
return h .DecodeBare (b )
}
func (h *ChatlistsHideChatlistUpdatesRequest ) DecodeBare (b *bin .Buffer ) error {
if h == nil {
return fmt .Errorf ("can't decode chatlists.hideChatlistUpdates#66e486fb to nil" )
}
{
if err := h .Chatlist .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatlists.hideChatlistUpdates#66e486fb: field chatlist: %w" , err )
}
}
return nil
}
func (h *ChatlistsHideChatlistUpdatesRequest ) GetChatlist () (value InputChatlistDialogFilter ) {
if h == nil {
return
}
return h .Chatlist
}
func (c *Client ) ChatlistsHideChatlistUpdates (ctx context .Context , chatlist InputChatlistDialogFilter ) (bool , error ) {
var result BoolBox
request := &ChatlistsHideChatlistUpdatesRequest {
Chatlist : chatlist ,
}
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 .