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 PhoneSaveCallDebugRequest struct {
Peer InputPhoneCall
Debug DataJSON
}
const PhoneSaveCallDebugRequestTypeID = 0x277add7e
var (
_ bin .Encoder = &PhoneSaveCallDebugRequest {}
_ bin .Decoder = &PhoneSaveCallDebugRequest {}
_ bin .BareEncoder = &PhoneSaveCallDebugRequest {}
_ bin .BareDecoder = &PhoneSaveCallDebugRequest {}
)
func (s *PhoneSaveCallDebugRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .Peer .Zero ()) {
return false
}
if !(s .Debug .Zero ()) {
return false
}
return true
}
func (s *PhoneSaveCallDebugRequest ) String () string {
if s == nil {
return "PhoneSaveCallDebugRequest(nil)"
}
type Alias PhoneSaveCallDebugRequest
return fmt .Sprintf ("PhoneSaveCallDebugRequest%+v" , Alias (*s ))
}
func (s *PhoneSaveCallDebugRequest ) FillFrom (from interface {
GetPeer () (value InputPhoneCall )
GetDebug () (value DataJSON )
}) {
s .Peer = from .GetPeer ()
s .Debug = from .GetDebug ()
}
func (*PhoneSaveCallDebugRequest ) TypeID () uint32 {
return PhoneSaveCallDebugRequestTypeID
}
func (*PhoneSaveCallDebugRequest ) TypeName () string {
return "phone.saveCallDebug"
}
func (s *PhoneSaveCallDebugRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.saveCallDebug" ,
ID : PhoneSaveCallDebugRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Debug" ,
SchemaName : "debug" ,
},
}
return typ
}
func (s *PhoneSaveCallDebugRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode phone.saveCallDebug#277add7e as nil" )
}
b .PutID (PhoneSaveCallDebugRequestTypeID )
return s .EncodeBare (b )
}
func (s *PhoneSaveCallDebugRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode phone.saveCallDebug#277add7e as nil" )
}
if err := s .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.saveCallDebug#277add7e: field peer: %w" , err )
}
if err := s .Debug .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.saveCallDebug#277add7e: field debug: %w" , err )
}
return nil
}
func (s *PhoneSaveCallDebugRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode phone.saveCallDebug#277add7e to nil" )
}
if err := b .ConsumeID (PhoneSaveCallDebugRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.saveCallDebug#277add7e: %w" , err )
}
return s .DecodeBare (b )
}
func (s *PhoneSaveCallDebugRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode phone.saveCallDebug#277add7e to nil" )
}
{
if err := s .Peer .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.saveCallDebug#277add7e: field peer: %w" , err )
}
}
{
if err := s .Debug .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode phone.saveCallDebug#277add7e: field debug: %w" , err )
}
}
return nil
}
func (s *PhoneSaveCallDebugRequest ) GetPeer () (value InputPhoneCall ) {
if s == nil {
return
}
return s .Peer
}
func (s *PhoneSaveCallDebugRequest ) GetDebug () (value DataJSON ) {
if s == nil {
return
}
return s .Debug
}
func (c *Client ) PhoneSaveCallDebug (ctx context .Context , request *PhoneSaveCallDebugRequest ) (bool , error ) {
var result BoolBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , 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 .