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