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