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 PhoneDeleteConferenceCallParticipantsRequest struct {
Flags bin .Fields
OnlyLeft bool
Kick bool
Call InputGroupCallClass
IDs []int64
Block []byte
}
const PhoneDeleteConferenceCallParticipantsRequestTypeID = 0x8ca60525
var (
_ bin .Encoder = &PhoneDeleteConferenceCallParticipantsRequest {}
_ bin .Decoder = &PhoneDeleteConferenceCallParticipantsRequest {}
_ bin .BareEncoder = &PhoneDeleteConferenceCallParticipantsRequest {}
_ bin .BareDecoder = &PhoneDeleteConferenceCallParticipantsRequest {}
)
func (d *PhoneDeleteConferenceCallParticipantsRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Flags .Zero ()) {
return false
}
if !(d .OnlyLeft == false ) {
return false
}
if !(d .Kick == false ) {
return false
}
if !(d .Call == nil ) {
return false
}
if !(d .IDs == nil ) {
return false
}
if !(d .Block == nil ) {
return false
}
return true
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) String () string {
if d == nil {
return "PhoneDeleteConferenceCallParticipantsRequest(nil)"
}
type Alias PhoneDeleteConferenceCallParticipantsRequest
return fmt .Sprintf ("PhoneDeleteConferenceCallParticipantsRequest%+v" , Alias (*d ))
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) FillFrom (from interface {
GetOnlyLeft () (value bool )
GetKick () (value bool )
GetCall () (value InputGroupCallClass )
GetIDs () (value []int64 )
GetBlock () (value []byte )
}) {
d .OnlyLeft = from .GetOnlyLeft ()
d .Kick = from .GetKick ()
d .Call = from .GetCall ()
d .IDs = from .GetIDs ()
d .Block = from .GetBlock ()
}
func (*PhoneDeleteConferenceCallParticipantsRequest ) TypeID () uint32 {
return PhoneDeleteConferenceCallParticipantsRequestTypeID
}
func (*PhoneDeleteConferenceCallParticipantsRequest ) TypeName () string {
return "phone.deleteConferenceCallParticipants"
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.deleteConferenceCallParticipants" ,
ID : PhoneDeleteConferenceCallParticipantsRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "OnlyLeft" ,
SchemaName : "only_left" ,
Null : !d .Flags .Has (0 ),
},
{
Name : "Kick" ,
SchemaName : "kick" ,
Null : !d .Flags .Has (1 ),
},
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "IDs" ,
SchemaName : "ids" ,
},
{
Name : "Block" ,
SchemaName : "block" ,
},
}
return typ
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) SetFlags () {
if !(d .OnlyLeft == false ) {
d .Flags .Set (0 )
}
if !(d .Kick == false ) {
d .Flags .Set (1 )
}
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode phone.deleteConferenceCallParticipants#8ca60525 as nil" )
}
b .PutID (PhoneDeleteConferenceCallParticipantsRequestTypeID )
return d .EncodeBare (b )
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode phone.deleteConferenceCallParticipants#8ca60525 as nil" )
}
d .SetFlags ()
if err := d .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field flags: %w" , err )
}
if d .Call == nil {
return fmt .Errorf ("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field call is nil" )
}
if err := d .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.deleteConferenceCallParticipants#8ca60525: field call: %w" , err )
}
b .PutVectorHeader (len (d .IDs ))
for _ , v := range d .IDs {
b .PutLong (v )
}
b .PutBytes (d .Block )
return nil
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode phone.deleteConferenceCallParticipants#8ca60525 to nil" )
}
if err := b .ConsumeID (PhoneDeleteConferenceCallParticipantsRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: %w" , err )
}
return d .DecodeBare (b )
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode phone.deleteConferenceCallParticipants#8ca60525 to nil" )
}
{
if err := d .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field flags: %w" , err )
}
}
d .OnlyLeft = d .Flags .Has (0 )
d .Kick = d .Flags .Has (1 )
{
value , err := DecodeInputGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field call: %w" , err )
}
d .Call = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field ids: %w" , err )
}
if headerLen > 0 {
d .IDs = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field ids: %w" , err )
}
d .IDs = append (d .IDs , value )
}
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteConferenceCallParticipants#8ca60525: field block: %w" , err )
}
d .Block = value
}
return nil
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) SetOnlyLeft (value bool ) {
if value {
d .Flags .Set (0 )
d .OnlyLeft = true
} else {
d .Flags .Unset (0 )
d .OnlyLeft = false
}
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) GetOnlyLeft () (value bool ) {
if d == nil {
return
}
return d .Flags .Has (0 )
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) SetKick (value bool ) {
if value {
d .Flags .Set (1 )
d .Kick = true
} else {
d .Flags .Unset (1 )
d .Kick = false
}
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) GetKick () (value bool ) {
if d == nil {
return
}
return d .Flags .Has (1 )
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) GetCall () (value InputGroupCallClass ) {
if d == nil {
return
}
return d .Call
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) GetIDs () (value []int64 ) {
if d == nil {
return
}
return d .IDs
}
func (d *PhoneDeleteConferenceCallParticipantsRequest ) GetBlock () (value []byte ) {
if d == nil {
return
}
return d .Block
}
func (c *Client ) PhoneDeleteConferenceCallParticipants (ctx context .Context , request *PhoneDeleteConferenceCallParticipantsRequest ) (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.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .