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 AccountUpdateBusinessIntroRequest struct {
Flags bin .Fields
Intro InputBusinessIntro
}
const AccountUpdateBusinessIntroRequestTypeID = 0xa614d034
var (
_ bin .Encoder = &AccountUpdateBusinessIntroRequest {}
_ bin .Decoder = &AccountUpdateBusinessIntroRequest {}
_ bin .BareEncoder = &AccountUpdateBusinessIntroRequest {}
_ bin .BareDecoder = &AccountUpdateBusinessIntroRequest {}
)
func (u *AccountUpdateBusinessIntroRequest ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Intro .Zero ()) {
return false
}
return true
}
func (u *AccountUpdateBusinessIntroRequest ) String () string {
if u == nil {
return "AccountUpdateBusinessIntroRequest(nil)"
}
type Alias AccountUpdateBusinessIntroRequest
return fmt .Sprintf ("AccountUpdateBusinessIntroRequest%+v" , Alias (*u ))
}
func (u *AccountUpdateBusinessIntroRequest ) FillFrom (from interface {
GetIntro () (value InputBusinessIntro , ok bool )
}) {
if val , ok := from .GetIntro (); ok {
u .Intro = val
}
}
func (*AccountUpdateBusinessIntroRequest ) TypeID () uint32 {
return AccountUpdateBusinessIntroRequestTypeID
}
func (*AccountUpdateBusinessIntroRequest ) TypeName () string {
return "account.updateBusinessIntro"
}
func (u *AccountUpdateBusinessIntroRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "account.updateBusinessIntro" ,
ID : AccountUpdateBusinessIntroRequestTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Intro" ,
SchemaName : "intro" ,
Null : !u .Flags .Has (0 ),
},
}
return typ
}
func (u *AccountUpdateBusinessIntroRequest ) SetFlags () {
if !(u .Intro .Zero ()) {
u .Flags .Set (0 )
}
}
func (u *AccountUpdateBusinessIntroRequest ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode account.updateBusinessIntro#a614d034 as nil" )
}
b .PutID (AccountUpdateBusinessIntroRequestTypeID )
return u .EncodeBare (b )
}
func (u *AccountUpdateBusinessIntroRequest ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode account.updateBusinessIntro#a614d034 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode account.updateBusinessIntro#a614d034: field flags: %w" , err )
}
if u .Flags .Has (0 ) {
if err := u .Intro .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode account.updateBusinessIntro#a614d034: field intro: %w" , err )
}
}
return nil
}
func (u *AccountUpdateBusinessIntroRequest ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode account.updateBusinessIntro#a614d034 to nil" )
}
if err := b .ConsumeID (AccountUpdateBusinessIntroRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode account.updateBusinessIntro#a614d034: %w" , err )
}
return u .DecodeBare (b )
}
func (u *AccountUpdateBusinessIntroRequest ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode account.updateBusinessIntro#a614d034 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode account.updateBusinessIntro#a614d034: field flags: %w" , err )
}
}
if u .Flags .Has (0 ) {
if err := u .Intro .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode account.updateBusinessIntro#a614d034: field intro: %w" , err )
}
}
return nil
}
func (u *AccountUpdateBusinessIntroRequest ) SetIntro (value InputBusinessIntro ) {
u .Flags .Set (0 )
u .Intro = value
}
func (u *AccountUpdateBusinessIntroRequest ) GetIntro () (value InputBusinessIntro , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (0 ) {
return value , false
}
return u .Intro , true
}
func (c *Client ) AccountUpdateBusinessIntro (ctx context .Context , request *AccountUpdateBusinessIntroRequest ) (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.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 .