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 PhoneDeleteGroupCallParticipantMessagesRequest struct {
Flags bin .Fields
ReportSpam bool
Call InputGroupCallClass
Participant InputPeerClass
}
const PhoneDeleteGroupCallParticipantMessagesRequestTypeID = 0x1dbfeca0
var (
_ bin .Encoder = &PhoneDeleteGroupCallParticipantMessagesRequest {}
_ bin .Decoder = &PhoneDeleteGroupCallParticipantMessagesRequest {}
_ bin .BareEncoder = &PhoneDeleteGroupCallParticipantMessagesRequest {}
_ bin .BareDecoder = &PhoneDeleteGroupCallParticipantMessagesRequest {}
)
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Flags .Zero ()) {
return false
}
if !(d .ReportSpam == false ) {
return false
}
if !(d .Call == nil ) {
return false
}
if !(d .Participant == nil ) {
return false
}
return true
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) String () string {
if d == nil {
return "PhoneDeleteGroupCallParticipantMessagesRequest(nil)"
}
type Alias PhoneDeleteGroupCallParticipantMessagesRequest
return fmt .Sprintf ("PhoneDeleteGroupCallParticipantMessagesRequest%+v" , Alias (*d ))
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) FillFrom (from interface {
GetReportSpam () (value bool )
GetCall () (value InputGroupCallClass )
GetParticipant () (value InputPeerClass )
}) {
d .ReportSpam = from .GetReportSpam ()
d .Call = from .GetCall ()
d .Participant = from .GetParticipant ()
}
func (*PhoneDeleteGroupCallParticipantMessagesRequest ) TypeID () uint32 {
return PhoneDeleteGroupCallParticipantMessagesRequestTypeID
}
func (*PhoneDeleteGroupCallParticipantMessagesRequest ) TypeName () string {
return "phone.deleteGroupCallParticipantMessages"
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.deleteGroupCallParticipantMessages" ,
ID : PhoneDeleteGroupCallParticipantMessagesRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ReportSpam" ,
SchemaName : "report_spam" ,
Null : !d .Flags .Has (0 ),
},
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Participant" ,
SchemaName : "participant" ,
},
}
return typ
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) SetFlags () {
if !(d .ReportSpam == false ) {
d .Flags .Set (0 )
}
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode phone.deleteGroupCallParticipantMessages#1dbfeca0 as nil" )
}
b .PutID (PhoneDeleteGroupCallParticipantMessagesRequestTypeID )
return d .EncodeBare (b )
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode phone.deleteGroupCallParticipantMessages#1dbfeca0 as nil" )
}
d .SetFlags ()
if err := d .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.deleteGroupCallParticipantMessages#1dbfeca0: field flags: %w" , err )
}
if d .Call == nil {
return fmt .Errorf ("unable to encode phone.deleteGroupCallParticipantMessages#1dbfeca0: field call is nil" )
}
if err := d .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.deleteGroupCallParticipantMessages#1dbfeca0: field call: %w" , err )
}
if d .Participant == nil {
return fmt .Errorf ("unable to encode phone.deleteGroupCallParticipantMessages#1dbfeca0: field participant is nil" )
}
if err := d .Participant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.deleteGroupCallParticipantMessages#1dbfeca0: field participant: %w" , err )
}
return nil
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode phone.deleteGroupCallParticipantMessages#1dbfeca0 to nil" )
}
if err := b .ConsumeID (PhoneDeleteGroupCallParticipantMessagesRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.deleteGroupCallParticipantMessages#1dbfeca0: %w" , err )
}
return d .DecodeBare (b )
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode phone.deleteGroupCallParticipantMessages#1dbfeca0 to nil" )
}
{
if err := d .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.deleteGroupCallParticipantMessages#1dbfeca0: field flags: %w" , err )
}
}
d .ReportSpam = d .Flags .Has (0 )
{
value , err := DecodeInputGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteGroupCallParticipantMessages#1dbfeca0: field call: %w" , err )
}
d .Call = value
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.deleteGroupCallParticipantMessages#1dbfeca0: field participant: %w" , err )
}
d .Participant = value
}
return nil
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) SetReportSpam (value bool ) {
if value {
d .Flags .Set (0 )
d .ReportSpam = true
} else {
d .Flags .Unset (0 )
d .ReportSpam = false
}
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) GetReportSpam () (value bool ) {
if d == nil {
return
}
return d .Flags .Has (0 )
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) GetCall () (value InputGroupCallClass ) {
if d == nil {
return
}
return d .Call
}
func (d *PhoneDeleteGroupCallParticipantMessagesRequest ) GetParticipant () (value InputPeerClass ) {
if d == nil {
return
}
return d .Participant
}
func (c *Client ) PhoneDeleteGroupCallParticipantMessages (ctx context .Context , request *PhoneDeleteGroupCallParticipantMessagesRequest ) (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 .