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 PhoneGetGroupCallChainBlocksRequest struct {
Call InputGroupCallClass
SubChainID int
Offset int
Limit int
}
const PhoneGetGroupCallChainBlocksRequestTypeID = 0xee9f88a6
var (
_ bin .Encoder = &PhoneGetGroupCallChainBlocksRequest {}
_ bin .Decoder = &PhoneGetGroupCallChainBlocksRequest {}
_ bin .BareEncoder = &PhoneGetGroupCallChainBlocksRequest {}
_ bin .BareDecoder = &PhoneGetGroupCallChainBlocksRequest {}
)
func (g *PhoneGetGroupCallChainBlocksRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Call == nil ) {
return false
}
if !(g .SubChainID == 0 ) {
return false
}
if !(g .Offset == 0 ) {
return false
}
if !(g .Limit == 0 ) {
return false
}
return true
}
func (g *PhoneGetGroupCallChainBlocksRequest ) String () string {
if g == nil {
return "PhoneGetGroupCallChainBlocksRequest(nil)"
}
type Alias PhoneGetGroupCallChainBlocksRequest
return fmt .Sprintf ("PhoneGetGroupCallChainBlocksRequest%+v" , Alias (*g ))
}
func (g *PhoneGetGroupCallChainBlocksRequest ) FillFrom (from interface {
GetCall () (value InputGroupCallClass )
GetSubChainID () (value int )
GetOffset () (value int )
GetLimit () (value int )
}) {
g .Call = from .GetCall ()
g .SubChainID = from .GetSubChainID ()
g .Offset = from .GetOffset ()
g .Limit = from .GetLimit ()
}
func (*PhoneGetGroupCallChainBlocksRequest ) TypeID () uint32 {
return PhoneGetGroupCallChainBlocksRequestTypeID
}
func (*PhoneGetGroupCallChainBlocksRequest ) TypeName () string {
return "phone.getGroupCallChainBlocks"
}
func (g *PhoneGetGroupCallChainBlocksRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "phone.getGroupCallChainBlocks" ,
ID : PhoneGetGroupCallChainBlocksRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "SubChainID" ,
SchemaName : "sub_chain_id" ,
},
{
Name : "Offset" ,
SchemaName : "offset" ,
},
{
Name : "Limit" ,
SchemaName : "limit" ,
},
}
return typ
}
func (g *PhoneGetGroupCallChainBlocksRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCallChainBlocks#ee9f88a6 as nil" )
}
b .PutID (PhoneGetGroupCallChainBlocksRequestTypeID )
return g .EncodeBare (b )
}
func (g *PhoneGetGroupCallChainBlocksRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode phone.getGroupCallChainBlocks#ee9f88a6 as nil" )
}
if g .Call == nil {
return fmt .Errorf ("unable to encode phone.getGroupCallChainBlocks#ee9f88a6: field call is nil" )
}
if err := g .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode phone.getGroupCallChainBlocks#ee9f88a6: field call: %w" , err )
}
b .PutInt (g .SubChainID )
b .PutInt (g .Offset )
b .PutInt (g .Limit )
return nil
}
func (g *PhoneGetGroupCallChainBlocksRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCallChainBlocks#ee9f88a6 to nil" )
}
if err := b .ConsumeID (PhoneGetGroupCallChainBlocksRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallChainBlocks#ee9f88a6: %w" , err )
}
return g .DecodeBare (b )
}
func (g *PhoneGetGroupCallChainBlocksRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode phone.getGroupCallChainBlocks#ee9f88a6 to nil" )
}
{
value , err := DecodeInputGroupCall (b )
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallChainBlocks#ee9f88a6: field call: %w" , err )
}
g .Call = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallChainBlocks#ee9f88a6: field sub_chain_id: %w" , err )
}
g .SubChainID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallChainBlocks#ee9f88a6: field offset: %w" , err )
}
g .Offset = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode phone.getGroupCallChainBlocks#ee9f88a6: field limit: %w" , err )
}
g .Limit = value
}
return nil
}
func (g *PhoneGetGroupCallChainBlocksRequest ) GetCall () (value InputGroupCallClass ) {
if g == nil {
return
}
return g .Call
}
func (g *PhoneGetGroupCallChainBlocksRequest ) GetSubChainID () (value int ) {
if g == nil {
return
}
return g .SubChainID
}
func (g *PhoneGetGroupCallChainBlocksRequest ) GetOffset () (value int ) {
if g == nil {
return
}
return g .Offset
}
func (g *PhoneGetGroupCallChainBlocksRequest ) GetLimit () (value int ) {
if g == nil {
return
}
return g .Limit
}
func (c *Client ) PhoneGetGroupCallChainBlocks (ctx context .Context , request *PhoneGetGroupCallChainBlocksRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , nil
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .