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 PhoneGetGroupCallStreamRtmpURLRequest struct {
Peer InputPeerClass
Revoke bool
}
const PhoneGetGroupCallStreamRtmpURLRequestTypeID = 0xdeb3abbf
var (
_ bin .Encoder = &PhoneGetGroupCallStreamRtmpURLRequest {}
_ bin .Decoder = &PhoneGetGroupCallStreamRtmpURLRequest {}
_ bin .BareEncoder = &PhoneGetGroupCallStreamRtmpURLRequest {}
_ bin .BareDecoder = &PhoneGetGroupCallStreamRtmpURLRequest {}
)
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Peer == nil ) {
return false
}
if !(g .Revoke == false ) {
return false
}
return true
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) String () string {
if g == nil {
return "PhoneGetGroupCallStreamRtmpURLRequest(nil)"
}
type Alias PhoneGetGroupCallStreamRtmpURLRequest
return fmt .Sprintf ("PhoneGetGroupCallStreamRtmpURLRequest%+v" , Alias (*g ))
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetRevoke () (value bool )
}) {
g .Peer = from .GetPeer ()
g .Revoke = from .GetRevoke ()
}
func (*PhoneGetGroupCallStreamRtmpURLRequest ) TypeID () uint32 {
return PhoneGetGroupCallStreamRtmpURLRequestTypeID
}
func (*PhoneGetGroupCallStreamRtmpURLRequest ) TypeName () string {
return "phone.getGroupCallStreamRtmpUrl"
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.getGroupCallStreamRtmpUrl" ,
ID : PhoneGetGroupCallStreamRtmpURLRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Revoke" ,
SchemaName : "revoke" ,
},
}
return typ
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCallStreamRtmpUrl#deb3abbf as nil" )
}
b .PutID (PhoneGetGroupCallStreamRtmpURLRequestTypeID )
return g .EncodeBare (b )
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCallStreamRtmpUrl#deb3abbf as nil" )
}
if g .Peer == nil {
return fmt .Errorf ("unable to encode phone.getGroupCallStreamRtmpUrl#deb3abbf: field peer is nil" )
}
if err := g .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.getGroupCallStreamRtmpUrl#deb3abbf: field peer: %w" , err )
}
b .PutBool (g .Revoke )
return nil
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCallStreamRtmpUrl#deb3abbf to nil" )
}
if err := b .ConsumeID (PhoneGetGroupCallStreamRtmpURLRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallStreamRtmpUrl#deb3abbf: %w" , err )
}
return g .DecodeBare (b )
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCallStreamRtmpUrl#deb3abbf to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallStreamRtmpUrl#deb3abbf: field peer: %w" , err )
}
g .Peer = value
}
{
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallStreamRtmpUrl#deb3abbf: field revoke: %w" , err )
}
g .Revoke = value
}
return nil
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) GetPeer () (value InputPeerClass ) {
if g == nil {
return
}
return g .Peer
}
func (g *PhoneGetGroupCallStreamRtmpURLRequest ) GetRevoke () (value bool ) {
if g == nil {
return
}
return g .Revoke
}
func (c *Client ) PhoneGetGroupCallStreamRtmpURL (ctx context .Context , request *PhoneGetGroupCallStreamRtmpURLRequest ) (*PhoneGroupCallStreamRtmpURL , error ) {
var result PhoneGroupCallStreamRtmpURL
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 .