// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// MessagesGetOldFeaturedStickersRequest represents TL type `messages.getOldFeaturedStickers#7ed094a1`.
// Method for fetching previously featured stickers
//
// See https://core.telegram.org/method/messages.getOldFeaturedStickers for reference.
type MessagesGetOldFeaturedStickersRequest struct {
	// Offset
	Offset int
	// Maximum number of results to return, see paginationĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets
	Limit int
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int64
}

// MessagesGetOldFeaturedStickersRequestTypeID is TL type id of MessagesGetOldFeaturedStickersRequest.
const MessagesGetOldFeaturedStickersRequestTypeID = 0x7ed094a1

// Ensuring interfaces in compile-time for MessagesGetOldFeaturedStickersRequest.
var (
	_ bin.Encoder     = &MessagesGetOldFeaturedStickersRequest{}
	_ bin.Decoder     = &MessagesGetOldFeaturedStickersRequest{}
	_ bin.BareEncoder = &MessagesGetOldFeaturedStickersRequest{}
	_ bin.BareDecoder = &MessagesGetOldFeaturedStickersRequest{}
)

func ( *MessagesGetOldFeaturedStickersRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Limit == 0) {
		return false
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessagesGetOldFeaturedStickersRequest) () string {
	if  == nil {
		return "MessagesGetOldFeaturedStickersRequest(nil)"
	}
	type  MessagesGetOldFeaturedStickersRequest
	return fmt.Sprintf("MessagesGetOldFeaturedStickersRequest%+v", (*))
}

// FillFrom fills MessagesGetOldFeaturedStickersRequest from given interface.
func ( *MessagesGetOldFeaturedStickersRequest) ( interface {
	() ( int)
	() ( int)
	() ( int64)
}) {
	.Offset = .()
	.Limit = .()
	.Hash = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessagesGetOldFeaturedStickersRequest) () uint32 {
	return MessagesGetOldFeaturedStickersRequestTypeID
}

// TypeName returns name of type in TL schema.
func (*MessagesGetOldFeaturedStickersRequest) () string {
	return "messages.getOldFeaturedStickers"
}

// TypeInfo returns info about TL type.
func ( *MessagesGetOldFeaturedStickersRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getOldFeaturedStickers",
		ID:   MessagesGetOldFeaturedStickersRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Limit",
			SchemaName: "limit",
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetOldFeaturedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil")
	}
	.PutID(MessagesGetOldFeaturedStickersRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetOldFeaturedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Limit)
	.PutLong(.Hash)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesGetOldFeaturedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil")
	}
	if  := .ConsumeID(MessagesGetOldFeaturedStickersRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetOldFeaturedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field limit: %w", )
		}
		.Limit = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getOldFeaturedStickers#7ed094a1: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessagesGetOldFeaturedStickersRequest) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLimit returns value of Limit field.
func ( *MessagesGetOldFeaturedStickersRequest) () ( int) {
	if  == nil {
		return
	}
	return .Limit
}

// GetHash returns value of Hash field.
func ( *MessagesGetOldFeaturedStickersRequest) () ( int64) {
	if  == nil {
		return
	}
	return .Hash
}

// MessagesGetOldFeaturedStickers invokes method messages.getOldFeaturedStickers#7ed094a1 returning error if any.
// Method for fetching previously featured stickers
//
// See https://core.telegram.org/method/messages.getOldFeaturedStickers for reference.
func ( *Client) ( context.Context,  *MessagesGetOldFeaturedStickersRequest) (MessagesFeaturedStickersClass, error) {
	var  MessagesFeaturedStickersBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .FeaturedStickers, nil
}