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 GroupCallStreamChannel struct {
Channel int
Scale int
LastTimestampMs int64
}
const GroupCallStreamChannelTypeID = 0x80eb48af
var (
_ bin .Encoder = &GroupCallStreamChannel {}
_ bin .Decoder = &GroupCallStreamChannel {}
_ bin .BareEncoder = &GroupCallStreamChannel {}
_ bin .BareDecoder = &GroupCallStreamChannel {}
)
func (g *GroupCallStreamChannel ) Zero () bool {
if g == nil {
return true
}
if !(g .Channel == 0 ) {
return false
}
if !(g .Scale == 0 ) {
return false
}
if !(g .LastTimestampMs == 0 ) {
return false
}
return true
}
func (g *GroupCallStreamChannel ) String () string {
if g == nil {
return "GroupCallStreamChannel(nil)"
}
type Alias GroupCallStreamChannel
return fmt .Sprintf ("GroupCallStreamChannel%+v" , Alias (*g ))
}
func (g *GroupCallStreamChannel ) FillFrom (from interface {
GetChannel () (value int )
GetScale () (value int )
GetLastTimestampMs () (value int64 )
}) {
g .Channel = from .GetChannel ()
g .Scale = from .GetScale ()
g .LastTimestampMs = from .GetLastTimestampMs ()
}
func (*GroupCallStreamChannel ) TypeID () uint32 {
return GroupCallStreamChannelTypeID
}
func (*GroupCallStreamChannel ) TypeName () string {
return "groupCallStreamChannel"
}
func (g *GroupCallStreamChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "groupCallStreamChannel" ,
ID : GroupCallStreamChannelTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Channel" ,
SchemaName : "channel" ,
},
{
Name : "Scale" ,
SchemaName : "scale" ,
},
{
Name : "LastTimestampMs" ,
SchemaName : "last_timestamp_ms" ,
},
}
return typ
}
func (g *GroupCallStreamChannel ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode groupCallStreamChannel#80eb48af as nil" )
}
b .PutID (GroupCallStreamChannelTypeID )
return g .EncodeBare (b )
}
func (g *GroupCallStreamChannel ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode groupCallStreamChannel#80eb48af as nil" )
}
b .PutInt (g .Channel )
b .PutInt (g .Scale )
b .PutLong (g .LastTimestampMs )
return nil
}
func (g *GroupCallStreamChannel ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode groupCallStreamChannel#80eb48af to nil" )
}
if err := b .ConsumeID (GroupCallStreamChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode groupCallStreamChannel#80eb48af: %w" , err )
}
return g .DecodeBare (b )
}
func (g *GroupCallStreamChannel ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode groupCallStreamChannel#80eb48af to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode groupCallStreamChannel#80eb48af: field channel: %w" , err )
}
g .Channel = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode groupCallStreamChannel#80eb48af: field scale: %w" , err )
}
g .Scale = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode groupCallStreamChannel#80eb48af: field last_timestamp_ms: %w" , err )
}
g .LastTimestampMs = value
}
return nil
}
func (g *GroupCallStreamChannel ) GetChannel () (value int ) {
if g == nil {
return
}
return g .Channel
}
func (g *GroupCallStreamChannel ) GetScale () (value int ) {
if g == nil {
return
}
return g .Scale
}
func (g *GroupCallStreamChannel ) GetLastTimestampMs () (value int64 ) {
if g == nil {
return
}
return g .LastTimestampMs
}
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 .