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 InputGroupCall struct {
ID int64
AccessHash int64
}
const InputGroupCallTypeID = 0xd8aa840f
var (
_ bin .Encoder = &InputGroupCall {}
_ bin .Decoder = &InputGroupCall {}
_ bin .BareEncoder = &InputGroupCall {}
_ bin .BareDecoder = &InputGroupCall {}
)
func (i *InputGroupCall ) Zero () bool {
if i == nil {
return true
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputGroupCall ) String () string {
if i == nil {
return "InputGroupCall(nil)"
}
type Alias InputGroupCall
return fmt .Sprintf ("InputGroupCall%+v" , Alias (*i ))
}
func (i *InputGroupCall ) FillFrom (from interface {
GetID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputGroupCall ) TypeID () uint32 {
return InputGroupCallTypeID
}
func (*InputGroupCall ) TypeName () string {
return "inputGroupCall"
}
func (i *InputGroupCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputGroupCall" ,
ID : InputGroupCallTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputGroupCall ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputGroupCall#d8aa840f as nil" )
}
b .PutID (InputGroupCallTypeID )
return i .EncodeBare (b )
}
func (i *InputGroupCall ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputGroupCall#d8aa840f as nil" )
}
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputGroupCall ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputGroupCall#d8aa840f to nil" )
}
if err := b .ConsumeID (InputGroupCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputGroupCall#d8aa840f: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputGroupCall ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputGroupCall#d8aa840f to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCall#d8aa840f: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputGroupCall#d8aa840f: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputGroupCall ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputGroupCall ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
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 .