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 PhoneJoinGroupCallPresentationRequest struct {
Call InputGroupCall
Params DataJSON
}
const PhoneJoinGroupCallPresentationRequestTypeID = 0xcbea6bc4
var (
_ bin .Encoder = &PhoneJoinGroupCallPresentationRequest {}
_ bin .Decoder = &PhoneJoinGroupCallPresentationRequest {}
_ bin .BareEncoder = &PhoneJoinGroupCallPresentationRequest {}
_ bin .BareDecoder = &PhoneJoinGroupCallPresentationRequest {}
)
func (j *PhoneJoinGroupCallPresentationRequest ) Zero () bool {
if j == nil {
return true
}
if !(j .Call .Zero ()) {
return false
}
if !(j .Params .Zero ()) {
return false
}
return true
}
func (j *PhoneJoinGroupCallPresentationRequest ) String () string {
if j == nil {
return "PhoneJoinGroupCallPresentationRequest(nil)"
}
type Alias PhoneJoinGroupCallPresentationRequest
return fmt .Sprintf ("PhoneJoinGroupCallPresentationRequest%+v" , Alias (*j ))
}
func (j *PhoneJoinGroupCallPresentationRequest ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetParams () (value DataJSON )
}) {
j .Call = from .GetCall ()
j .Params = from .GetParams ()
}
func (*PhoneJoinGroupCallPresentationRequest ) TypeID () uint32 {
return PhoneJoinGroupCallPresentationRequestTypeID
}
func (*PhoneJoinGroupCallPresentationRequest ) TypeName () string {
return "phone.joinGroupCallPresentation"
}
func (j *PhoneJoinGroupCallPresentationRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.joinGroupCallPresentation" ,
ID : PhoneJoinGroupCallPresentationRequestTypeID ,
}
if j == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Params" ,
SchemaName : "params" ,
},
}
return typ
}
func (j *PhoneJoinGroupCallPresentationRequest ) Encode (b *bin .Buffer ) error {
if j == nil {
return fmt .Errorf ("can't encode phone.joinGroupCallPresentation#cbea6bc4 as nil" )
}
b .PutID (PhoneJoinGroupCallPresentationRequestTypeID )
return j .EncodeBare (b )
}
func (j *PhoneJoinGroupCallPresentationRequest ) EncodeBare (b *bin .Buffer ) error {
if j == nil {
return fmt .Errorf ("can't encode phone.joinGroupCallPresentation#cbea6bc4 as nil" )
}
if err := j .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.joinGroupCallPresentation#cbea6bc4: field call: %w" , err )
}
if err := j .Params .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.joinGroupCallPresentation#cbea6bc4: field params: %w" , err )
}
return nil
}
func (j *PhoneJoinGroupCallPresentationRequest ) Decode (b *bin .Buffer ) error {
if j == nil {
return fmt .Errorf ("can't decode phone.joinGroupCallPresentation#cbea6bc4 to nil" )
}
if err := b .ConsumeID (PhoneJoinGroupCallPresentationRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.joinGroupCallPresentation#cbea6bc4: %w" , err )
}
return j .DecodeBare (b )
}
func (j *PhoneJoinGroupCallPresentationRequest ) DecodeBare (b *bin .Buffer ) error {
if j == nil {
return fmt .Errorf ("can't decode phone.joinGroupCallPresentation#cbea6bc4 to nil" )
}
{
if err := j .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.joinGroupCallPresentation#cbea6bc4: field call: %w" , err )
}
}
{
if err := j .Params .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.joinGroupCallPresentation#cbea6bc4: field params: %w" , err )
}
}
return nil
}
func (j *PhoneJoinGroupCallPresentationRequest ) GetCall () (value InputGroupCall ) {
if j == nil {
return
}
return j .Call
}
func (j *PhoneJoinGroupCallPresentationRequest ) GetParams () (value DataJSON ) {
if j == nil {
return
}
return j .Params
}
func (c *Client ) PhoneJoinGroupCallPresentation (ctx context .Context , request *PhoneJoinGroupCallPresentationRequest ) (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 .