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 AccountDeleteBusinessChatLinkRequest struct {
Slug string
}
const AccountDeleteBusinessChatLinkRequestTypeID = 0x60073674
var (
_ bin .Encoder = &AccountDeleteBusinessChatLinkRequest {}
_ bin .Decoder = &AccountDeleteBusinessChatLinkRequest {}
_ bin .BareEncoder = &AccountDeleteBusinessChatLinkRequest {}
_ bin .BareDecoder = &AccountDeleteBusinessChatLinkRequest {}
)
func (d *AccountDeleteBusinessChatLinkRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Slug == "" ) {
return false
}
return true
}
func (d *AccountDeleteBusinessChatLinkRequest ) String () string {
if d == nil {
return "AccountDeleteBusinessChatLinkRequest(nil)"
}
type Alias AccountDeleteBusinessChatLinkRequest
return fmt .Sprintf ("AccountDeleteBusinessChatLinkRequest%+v" , Alias (*d ))
}
func (d *AccountDeleteBusinessChatLinkRequest ) FillFrom (from interface {
GetSlug () (value string )
}) {
d .Slug = from .GetSlug ()
}
func (*AccountDeleteBusinessChatLinkRequest ) TypeID () uint32 {
return AccountDeleteBusinessChatLinkRequestTypeID
}
func (*AccountDeleteBusinessChatLinkRequest ) TypeName () string {
return "account.deleteBusinessChatLink"
}
func (d *AccountDeleteBusinessChatLinkRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.deleteBusinessChatLink" ,
ID : AccountDeleteBusinessChatLinkRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Slug" ,
SchemaName : "slug" ,
},
}
return typ
}
func (d *AccountDeleteBusinessChatLinkRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode account.deleteBusinessChatLink#60073674 as nil" )
}
b .PutID (AccountDeleteBusinessChatLinkRequestTypeID )
return d .EncodeBare (b )
}
func (d *AccountDeleteBusinessChatLinkRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode account.deleteBusinessChatLink#60073674 as nil" )
}
b .PutString (d .Slug )
return nil
}
func (d *AccountDeleteBusinessChatLinkRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode account.deleteBusinessChatLink#60073674 to nil" )
}
if err := b .ConsumeID (AccountDeleteBusinessChatLinkRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.deleteBusinessChatLink#60073674: %w" , err )
}
return d .DecodeBare (b )
}
func (d *AccountDeleteBusinessChatLinkRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode account.deleteBusinessChatLink#60073674 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode account.deleteBusinessChatLink#60073674: field slug: %w" , err )
}
d .Slug = value
}
return nil
}
func (d *AccountDeleteBusinessChatLinkRequest ) GetSlug () (value string ) {
if d == nil {
return
}
return d .Slug
}
func (c *Client ) AccountDeleteBusinessChatLink (ctx context .Context , slug string ) (bool , error ) {
var result BoolBox
request := &AccountDeleteBusinessChatLinkRequest {
Slug : slug ,
}
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.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .