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 ChatlistsCheckChatlistInviteRequest struct {
Slug string
}
const ChatlistsCheckChatlistInviteRequestTypeID = 0x41c10fff
var (
_ bin .Encoder = &ChatlistsCheckChatlistInviteRequest {}
_ bin .Decoder = &ChatlistsCheckChatlistInviteRequest {}
_ bin .BareEncoder = &ChatlistsCheckChatlistInviteRequest {}
_ bin .BareDecoder = &ChatlistsCheckChatlistInviteRequest {}
)
func (c *ChatlistsCheckChatlistInviteRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Slug == "" ) {
return false
}
return true
}
func (c *ChatlistsCheckChatlistInviteRequest ) String () string {
if c == nil {
return "ChatlistsCheckChatlistInviteRequest(nil)"
}
type Alias ChatlistsCheckChatlistInviteRequest
return fmt .Sprintf ("ChatlistsCheckChatlistInviteRequest%+v" , Alias (*c ))
}
func (c *ChatlistsCheckChatlistInviteRequest ) FillFrom (from interface {
GetSlug () (value string )
}) {
c .Slug = from .GetSlug ()
}
func (*ChatlistsCheckChatlistInviteRequest ) TypeID () uint32 {
return ChatlistsCheckChatlistInviteRequestTypeID
}
func (*ChatlistsCheckChatlistInviteRequest ) TypeName () string {
return "chatlists.checkChatlistInvite"
}
func (c *ChatlistsCheckChatlistInviteRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "chatlists.checkChatlistInvite" ,
ID : ChatlistsCheckChatlistInviteRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Slug" ,
SchemaName : "slug" ,
},
}
return typ
}
func (c *ChatlistsCheckChatlistInviteRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode chatlists.checkChatlistInvite#41c10fff as nil" )
}
b .PutID (ChatlistsCheckChatlistInviteRequestTypeID )
return c .EncodeBare (b )
}
func (c *ChatlistsCheckChatlistInviteRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode chatlists.checkChatlistInvite#41c10fff as nil" )
}
b .PutString (c .Slug )
return nil
}
func (c *ChatlistsCheckChatlistInviteRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode chatlists.checkChatlistInvite#41c10fff to nil" )
}
if err := b .ConsumeID (ChatlistsCheckChatlistInviteRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode chatlists.checkChatlistInvite#41c10fff: %w" , err )
}
return c .DecodeBare (b )
}
func (c *ChatlistsCheckChatlistInviteRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode chatlists.checkChatlistInvite#41c10fff to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode chatlists.checkChatlistInvite#41c10fff: field slug: %w" , err )
}
c .Slug = value
}
return nil
}
func (c *ChatlistsCheckChatlistInviteRequest ) GetSlug () (value string ) {
if c == nil {
return
}
return c .Slug
}
func (c *Client ) ChatlistsCheckChatlistInvite (ctx context .Context , slug string ) (ChatlistsChatlistInviteClass , error ) {
var result ChatlistsChatlistInviteBox
request := &ChatlistsCheckChatlistInviteRequest {
Slug : slug ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .ChatlistInvite , 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 .