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 StatsGetStoryPublicForwardsRequest struct {
Peer InputPeerClass
ID int
Offset string
Limit int
}
const StatsGetStoryPublicForwardsRequestTypeID = 0xa6437ef6
var (
_ bin .Encoder = &StatsGetStoryPublicForwardsRequest {}
_ bin .Decoder = &StatsGetStoryPublicForwardsRequest {}
_ bin .BareEncoder = &StatsGetStoryPublicForwardsRequest {}
_ bin .BareDecoder = &StatsGetStoryPublicForwardsRequest {}
)
func (g *StatsGetStoryPublicForwardsRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Peer == nil ) {
return false
}
if !(g .ID == 0 ) {
return false
}
if !(g .Offset == "" ) {
return false
}
if !(g .Limit == 0 ) {
return false
}
return true
}
func (g *StatsGetStoryPublicForwardsRequest ) String () string {
if g == nil {
return "StatsGetStoryPublicForwardsRequest(nil)"
}
type Alias StatsGetStoryPublicForwardsRequest
return fmt .Sprintf ("StatsGetStoryPublicForwardsRequest%+v" , Alias (*g ))
}
func (g *StatsGetStoryPublicForwardsRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetID () (value int )
GetOffset () (value string )
GetLimit () (value int )
}) {
g .Peer = from .GetPeer ()
g .ID = from .GetID ()
g .Offset = from .GetOffset ()
g .Limit = from .GetLimit ()
}
func (*StatsGetStoryPublicForwardsRequest ) TypeID () uint32 {
return StatsGetStoryPublicForwardsRequestTypeID
}
func (*StatsGetStoryPublicForwardsRequest ) TypeName () string {
return "stats.getStoryPublicForwards"
}
func (g *StatsGetStoryPublicForwardsRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "stats.getStoryPublicForwards" ,
ID : StatsGetStoryPublicForwardsRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Offset" ,
SchemaName : "offset" ,
},
{
Name : "Limit" ,
SchemaName : "limit" ,
},
}
return typ
}
func (g *StatsGetStoryPublicForwardsRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode stats.getStoryPublicForwards#a6437ef6 as nil" )
}
b .PutID (StatsGetStoryPublicForwardsRequestTypeID )
return g .EncodeBare (b )
}
func (g *StatsGetStoryPublicForwardsRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode stats.getStoryPublicForwards#a6437ef6 as nil" )
}
if g .Peer == nil {
return fmt .Errorf ("unable to encode stats.getStoryPublicForwards#a6437ef6: field peer is nil" )
}
if err := g .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode stats.getStoryPublicForwards#a6437ef6: field peer: %w" , err )
}
b .PutInt (g .ID )
b .PutString (g .Offset )
b .PutInt (g .Limit )
return nil
}
func (g *StatsGetStoryPublicForwardsRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode stats.getStoryPublicForwards#a6437ef6 to nil" )
}
if err := b .ConsumeID (StatsGetStoryPublicForwardsRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode stats.getStoryPublicForwards#a6437ef6: %w" , err )
}
return g .DecodeBare (b )
}
func (g *StatsGetStoryPublicForwardsRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode stats.getStoryPublicForwards#a6437ef6 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode stats.getStoryPublicForwards#a6437ef6: field peer: %w" , err )
}
g .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode stats.getStoryPublicForwards#a6437ef6: field id: %w" , err )
}
g .ID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode stats.getStoryPublicForwards#a6437ef6: field offset: %w" , err )
}
g .Offset = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode stats.getStoryPublicForwards#a6437ef6: field limit: %w" , err )
}
g .Limit = value
}
return nil
}
func (g *StatsGetStoryPublicForwardsRequest ) GetPeer () (value InputPeerClass ) {
if g == nil {
return
}
return g .Peer
}
func (g *StatsGetStoryPublicForwardsRequest ) GetID () (value int ) {
if g == nil {
return
}
return g .ID
}
func (g *StatsGetStoryPublicForwardsRequest ) GetOffset () (value string ) {
if g == nil {
return
}
return g .Offset
}
func (g *StatsGetStoryPublicForwardsRequest ) GetLimit () (value int ) {
if g == nil {
return
}
return g .Limit
}
func (c *Client ) StatsGetStoryPublicForwards (ctx context .Context , request *StatsGetStoryPublicForwardsRequest ) (*StatsPublicForwards , error ) {
var result StatsPublicForwards
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 .