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