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 PhoneGetGroupCallRequest struct {
Call InputGroupCall
Limit int
}
const PhoneGetGroupCallRequestTypeID = 0x41845db
var (
_ bin .Encoder = &PhoneGetGroupCallRequest {}
_ bin .Decoder = &PhoneGetGroupCallRequest {}
_ bin .BareEncoder = &PhoneGetGroupCallRequest {}
_ bin .BareDecoder = &PhoneGetGroupCallRequest {}
)
func (g *PhoneGetGroupCallRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Call .Zero ()) {
return false
}
if !(g .Limit == 0 ) {
return false
}
return true
}
func (g *PhoneGetGroupCallRequest ) String () string {
if g == nil {
return "PhoneGetGroupCallRequest(nil)"
}
type Alias PhoneGetGroupCallRequest
return fmt .Sprintf ("PhoneGetGroupCallRequest%+v" , Alias (*g ))
}
func (g *PhoneGetGroupCallRequest ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetLimit () (value int )
}) {
g .Call = from .GetCall ()
g .Limit = from .GetLimit ()
}
func (*PhoneGetGroupCallRequest ) TypeID () uint32 {
return PhoneGetGroupCallRequestTypeID
}
func (*PhoneGetGroupCallRequest ) TypeName () string {
return "phone.getGroupCall"
}
func (g *PhoneGetGroupCallRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.getGroupCall" ,
ID : PhoneGetGroupCallRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Limit" ,
SchemaName : "limit" ,
},
}
return typ
}
func (g *PhoneGetGroupCallRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCall#41845db as nil" )
}
b .PutID (PhoneGetGroupCallRequestTypeID )
return g .EncodeBare (b )
}
func (g *PhoneGetGroupCallRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCall#41845db as nil" )
}
if err := g .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.getGroupCall#41845db: field call: %w" , err )
}
b .PutInt (g .Limit )
return nil
}
func (g *PhoneGetGroupCallRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCall#41845db to nil" )
}
if err := b .ConsumeID (PhoneGetGroupCallRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCall#41845db: %w" , err )
}
return g .DecodeBare (b )
}
func (g *PhoneGetGroupCallRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCall#41845db to nil" )
}
{
if err := g .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCall#41845db: field call: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCall#41845db: field limit: %w" , err )
}
g .Limit = value
}
return nil
}
func (g *PhoneGetGroupCallRequest ) GetCall () (value InputGroupCall ) {
if g == nil {
return
}
return g .Call
}
func (g *PhoneGetGroupCallRequest ) GetLimit () (value int ) {
if g == nil {
return
}
return g .Limit
}
func (c *Client ) PhoneGetGroupCall (ctx context .Context , request *PhoneGetGroupCallRequest ) (*PhoneGroupCall , error ) {
var result PhoneGroupCall
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , 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 .