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 MessagesDeleteExportedChatInviteRequest struct {
Peer InputPeerClass
Link string
}
const MessagesDeleteExportedChatInviteRequestTypeID = 0xd464a42b
var (
_ bin .Encoder = &MessagesDeleteExportedChatInviteRequest {}
_ bin .Decoder = &MessagesDeleteExportedChatInviteRequest {}
_ bin .BareEncoder = &MessagesDeleteExportedChatInviteRequest {}
_ bin .BareDecoder = &MessagesDeleteExportedChatInviteRequest {}
)
func (d *MessagesDeleteExportedChatInviteRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Peer == nil ) {
return false
}
if !(d .Link == "" ) {
return false
}
return true
}
func (d *MessagesDeleteExportedChatInviteRequest ) String () string {
if d == nil {
return "MessagesDeleteExportedChatInviteRequest(nil)"
}
type Alias MessagesDeleteExportedChatInviteRequest
return fmt .Sprintf ("MessagesDeleteExportedChatInviteRequest%+v" , Alias (*d ))
}
func (d *MessagesDeleteExportedChatInviteRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetLink () (value string )
}) {
d .Peer = from .GetPeer ()
d .Link = from .GetLink ()
}
func (*MessagesDeleteExportedChatInviteRequest ) TypeID () uint32 {
return MessagesDeleteExportedChatInviteRequestTypeID
}
func (*MessagesDeleteExportedChatInviteRequest ) TypeName () string {
return "messages.deleteExportedChatInvite"
}
func (d *MessagesDeleteExportedChatInviteRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.deleteExportedChatInvite" ,
ID : MessagesDeleteExportedChatInviteRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Link" ,
SchemaName : "link" ,
},
}
return typ
}
func (d *MessagesDeleteExportedChatInviteRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteExportedChatInvite#d464a42b as nil" )
}
b .PutID (MessagesDeleteExportedChatInviteRequestTypeID )
return d .EncodeBare (b )
}
func (d *MessagesDeleteExportedChatInviteRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteExportedChatInvite#d464a42b as nil" )
}
if d .Peer == nil {
return fmt .Errorf ("unable to encode messages.deleteExportedChatInvite#d464a42b: field peer is nil" )
}
if err := d .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deleteExportedChatInvite#d464a42b: field peer: %w" , err )
}
b .PutString (d .Link )
return nil
}
func (d *MessagesDeleteExportedChatInviteRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteExportedChatInvite#d464a42b to nil" )
}
if err := b .ConsumeID (MessagesDeleteExportedChatInviteRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.deleteExportedChatInvite#d464a42b: %w" , err )
}
return d .DecodeBare (b )
}
func (d *MessagesDeleteExportedChatInviteRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteExportedChatInvite#d464a42b to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteExportedChatInvite#d464a42b: field peer: %w" , err )
}
d .Peer = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteExportedChatInvite#d464a42b: field link: %w" , err )
}
d .Link = value
}
return nil
}
func (d *MessagesDeleteExportedChatInviteRequest ) GetPeer () (value InputPeerClass ) {
if d == nil {
return
}
return d .Peer
}
func (d *MessagesDeleteExportedChatInviteRequest ) GetLink () (value string ) {
if d == nil {
return
}
return d .Link
}
func (c *Client ) MessagesDeleteExportedChatInvite (ctx context .Context , request *MessagesDeleteExportedChatInviteRequest ) (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 .