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 PhoneEditGroupCallTitleRequest struct {
Call InputGroupCall
Title string
}
const PhoneEditGroupCallTitleRequestTypeID = 0x1ca6ac0a
var (
_ bin .Encoder = &PhoneEditGroupCallTitleRequest {}
_ bin .Decoder = &PhoneEditGroupCallTitleRequest {}
_ bin .BareEncoder = &PhoneEditGroupCallTitleRequest {}
_ bin .BareDecoder = &PhoneEditGroupCallTitleRequest {}
)
func (e *PhoneEditGroupCallTitleRequest ) Zero () bool {
if e == nil {
return true
}
if !(e .Call .Zero ()) {
return false
}
if !(e .Title == "" ) {
return false
}
return true
}
func (e *PhoneEditGroupCallTitleRequest ) String () string {
if e == nil {
return "PhoneEditGroupCallTitleRequest(nil)"
}
type Alias PhoneEditGroupCallTitleRequest
return fmt .Sprintf ("PhoneEditGroupCallTitleRequest%+v" , Alias (*e ))
}
func (e *PhoneEditGroupCallTitleRequest ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetTitle () (value string )
}) {
e .Call = from .GetCall ()
e .Title = from .GetTitle ()
}
func (*PhoneEditGroupCallTitleRequest ) TypeID () uint32 {
return PhoneEditGroupCallTitleRequestTypeID
}
func (*PhoneEditGroupCallTitleRequest ) TypeName () string {
return "phone.editGroupCallTitle"
}
func (e *PhoneEditGroupCallTitleRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.editGroupCallTitle" ,
ID : PhoneEditGroupCallTitleRequestTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (e *PhoneEditGroupCallTitleRequest ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode phone.editGroupCallTitle#1ca6ac0a as nil" )
}
b .PutID (PhoneEditGroupCallTitleRequestTypeID )
return e .EncodeBare (b )
}
func (e *PhoneEditGroupCallTitleRequest ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode phone.editGroupCallTitle#1ca6ac0a as nil" )
}
if err := e .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.editGroupCallTitle#1ca6ac0a: field call: %w" , err )
}
b .PutString (e .Title )
return nil
}
func (e *PhoneEditGroupCallTitleRequest ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode phone.editGroupCallTitle#1ca6ac0a to nil" )
}
if err := b .ConsumeID (PhoneEditGroupCallTitleRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.editGroupCallTitle#1ca6ac0a: %w" , err )
}
return e .DecodeBare (b )
}
func (e *PhoneEditGroupCallTitleRequest ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode phone.editGroupCallTitle#1ca6ac0a to nil" )
}
{
if err := e .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.editGroupCallTitle#1ca6ac0a: field call: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode phone.editGroupCallTitle#1ca6ac0a: field title: %w" , err )
}
e .Title = value
}
return nil
}
func (e *PhoneEditGroupCallTitleRequest ) GetCall () (value InputGroupCall ) {
if e == nil {
return
}
return e .Call
}
func (e *PhoneEditGroupCallTitleRequest ) GetTitle () (value string ) {
if e == nil {
return
}
return e .Title
}
func (c *Client ) PhoneEditGroupCallTitle (ctx context .Context , request *PhoneEditGroupCallTitleRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , 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 .