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 AccountCreateBusinessChatLinkRequest struct {
Link InputBusinessChatLink
}
const AccountCreateBusinessChatLinkRequestTypeID = 0x8851e68e
var (
_ bin .Encoder = &AccountCreateBusinessChatLinkRequest {}
_ bin .Decoder = &AccountCreateBusinessChatLinkRequest {}
_ bin .BareEncoder = &AccountCreateBusinessChatLinkRequest {}
_ bin .BareDecoder = &AccountCreateBusinessChatLinkRequest {}
)
func (c *AccountCreateBusinessChatLinkRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Link .Zero ()) {
return false
}
return true
}
func (c *AccountCreateBusinessChatLinkRequest ) String () string {
if c == nil {
return "AccountCreateBusinessChatLinkRequest(nil)"
}
type Alias AccountCreateBusinessChatLinkRequest
return fmt .Sprintf ("AccountCreateBusinessChatLinkRequest%+v" , Alias (*c ))
}
func (c *AccountCreateBusinessChatLinkRequest ) FillFrom (from interface {
GetLink () (value InputBusinessChatLink )
}) {
c .Link = from .GetLink ()
}
func (*AccountCreateBusinessChatLinkRequest ) TypeID () uint32 {
return AccountCreateBusinessChatLinkRequestTypeID
}
func (*AccountCreateBusinessChatLinkRequest ) TypeName () string {
return "account.createBusinessChatLink"
}
func (c *AccountCreateBusinessChatLinkRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.createBusinessChatLink" ,
ID : AccountCreateBusinessChatLinkRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Link" ,
SchemaName : "link" ,
},
}
return typ
}
func (c *AccountCreateBusinessChatLinkRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode account.createBusinessChatLink#8851e68e as nil" )
}
b .PutID (AccountCreateBusinessChatLinkRequestTypeID )
return c .EncodeBare (b )
}
func (c *AccountCreateBusinessChatLinkRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode account.createBusinessChatLink#8851e68e as nil" )
}
if err := c .Link .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode account.createBusinessChatLink#8851e68e: field link: %w" , err )
}
return nil
}
func (c *AccountCreateBusinessChatLinkRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode account.createBusinessChatLink#8851e68e to nil" )
}
if err := b .ConsumeID (AccountCreateBusinessChatLinkRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.createBusinessChatLink#8851e68e: %w" , err )
}
return c .DecodeBare (b )
}
func (c *AccountCreateBusinessChatLinkRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode account.createBusinessChatLink#8851e68e to nil" )
}
{
if err := c .Link .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode account.createBusinessChatLink#8851e68e: field link: %w" , err )
}
}
return nil
}
func (c *AccountCreateBusinessChatLinkRequest ) GetLink () (value InputBusinessChatLink ) {
if c == nil {
return
}
return c .Link
}
func (c *Client ) AccountCreateBusinessChatLink (ctx context .Context , link InputBusinessChatLink ) (*BusinessChatLink , error ) {
var result BusinessChatLink
request := &AccountCreateBusinessChatLinkRequest {
Link : link ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , 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 .