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