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 MessagesDeletePhoneCallHistoryRequest struct {
Flags bin .Fields
Revoke bool
}
const MessagesDeletePhoneCallHistoryRequestTypeID = 0xf9cbe409
var (
_ bin .Encoder = &MessagesDeletePhoneCallHistoryRequest {}
_ bin .Decoder = &MessagesDeletePhoneCallHistoryRequest {}
_ bin .BareEncoder = &MessagesDeletePhoneCallHistoryRequest {}
_ bin .BareDecoder = &MessagesDeletePhoneCallHistoryRequest {}
)
func (d *MessagesDeletePhoneCallHistoryRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Flags .Zero ()) {
return false
}
if !(d .Revoke == false ) {
return false
}
return true
}
func (d *MessagesDeletePhoneCallHistoryRequest ) String () string {
if d == nil {
return "MessagesDeletePhoneCallHistoryRequest(nil)"
}
type Alias MessagesDeletePhoneCallHistoryRequest
return fmt .Sprintf ("MessagesDeletePhoneCallHistoryRequest%+v" , Alias (*d ))
}
func (d *MessagesDeletePhoneCallHistoryRequest ) FillFrom (from interface {
GetRevoke () (value bool )
}) {
d .Revoke = from .GetRevoke ()
}
func (*MessagesDeletePhoneCallHistoryRequest ) TypeID () uint32 {
return MessagesDeletePhoneCallHistoryRequestTypeID
}
func (*MessagesDeletePhoneCallHistoryRequest ) TypeName () string {
return "messages.deletePhoneCallHistory"
}
func (d *MessagesDeletePhoneCallHistoryRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.deletePhoneCallHistory" ,
ID : MessagesDeletePhoneCallHistoryRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Revoke" ,
SchemaName : "revoke" ,
Null : !d .Flags .Has (0 ),
},
}
return typ
}
func (d *MessagesDeletePhoneCallHistoryRequest ) SetFlags () {
if !(d .Revoke == false ) {
d .Flags .Set (0 )
}
}
func (d *MessagesDeletePhoneCallHistoryRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deletePhoneCallHistory#f9cbe409 as nil" )
}
b .PutID (MessagesDeletePhoneCallHistoryRequestTypeID )
return d .EncodeBare (b )
}
func (d *MessagesDeletePhoneCallHistoryRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deletePhoneCallHistory#f9cbe409 as nil" )
}
d .SetFlags ()
if err := d .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deletePhoneCallHistory#f9cbe409: field flags: %w" , err )
}
return nil
}
func (d *MessagesDeletePhoneCallHistoryRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deletePhoneCallHistory#f9cbe409 to nil" )
}
if err := b .ConsumeID (MessagesDeletePhoneCallHistoryRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.deletePhoneCallHistory#f9cbe409: %w" , err )
}
return d .DecodeBare (b )
}
func (d *MessagesDeletePhoneCallHistoryRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deletePhoneCallHistory#f9cbe409 to nil" )
}
{
if err := d .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messages.deletePhoneCallHistory#f9cbe409: field flags: %w" , err )
}
}
d .Revoke = d .Flags .Has (0 )
return nil
}
func (d *MessagesDeletePhoneCallHistoryRequest ) SetRevoke (value bool ) {
if value {
d .Flags .Set (0 )
d .Revoke = true
} else {
d .Flags .Unset (0 )
d .Revoke = false
}
}
func (d *MessagesDeletePhoneCallHistoryRequest ) GetRevoke () (value bool ) {
if d == nil {
return
}
return d .Flags .Has (0 )
}
func (c *Client ) MessagesDeletePhoneCallHistory (ctx context .Context , request *MessagesDeletePhoneCallHistoryRequest ) (*MessagesAffectedFoundMessages , error ) {
var result MessagesAffectedFoundMessages
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 .