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