// 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{}
)

// MessagesGetStickerSetRequest represents TL type `messages.getStickerSet#c8a0ec74`.
// Get info about a stickerset
//
// See https://core.telegram.org/method/messages.getStickerSet for reference.
type MessagesGetStickerSetRequest struct {
	// Stickerset
	Stickerset InputStickerSetClass
	// Hash for pagination, for more info click hereĀ¹
	//
	// Links:
	//  1) https://core.telegram.org/api/offsets#hash-generation
	Hash int
}

// MessagesGetStickerSetRequestTypeID is TL type id of MessagesGetStickerSetRequest.
const MessagesGetStickerSetRequestTypeID = 0xc8a0ec74

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

func ( *MessagesGetStickerSetRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Stickerset == nil) {
		return false
	}
	if !(.Hash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetStickerSetRequest from given interface.
func ( *MessagesGetStickerSetRequest) ( interface {
	() ( InputStickerSetClass)
	() ( int)
}) {
	.Stickerset = .()
	.Hash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesGetStickerSetRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getStickerSet",
		ID:   MessagesGetStickerSetRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
		{
			Name:       "Hash",
			SchemaName: "hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetStickerSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getStickerSet#c8a0ec74 as nil")
	}
	.PutID(MessagesGetStickerSetRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetStickerSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getStickerSet#c8a0ec74 as nil")
	}
	if .Stickerset == nil {
		return fmt.Errorf("unable to encode messages.getStickerSet#c8a0ec74: field stickerset is nil")
	}
	if  := .Stickerset.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.getStickerSet#c8a0ec74: field stickerset: %w", )
	}
	.PutInt(.Hash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetStickerSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getStickerSet#c8a0ec74 to nil")
	}
	{
		,  := DecodeInputStickerSet()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getStickerSet#c8a0ec74: field stickerset: %w", )
		}
		.Stickerset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getStickerSet#c8a0ec74: field hash: %w", )
		}
		.Hash = 
	}
	return nil
}

// GetStickerset returns value of Stickerset field.
func ( *MessagesGetStickerSetRequest) () ( InputStickerSetClass) {
	if  == nil {
		return
	}
	return .Stickerset
}

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

// MessagesGetStickerSet invokes method messages.getStickerSet#c8a0ec74 returning error if any.
// Get info about a stickerset
//
// Possible errors:
//
//	400 EMOTICON_STICKERPACK_MISSING: inputStickerSetDice.emoji cannot be empty.
//	406 STICKERSET_INVALID: The provided sticker set is invalid.
//
// See https://core.telegram.org/method/messages.getStickerSet for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *MessagesGetStickerSetRequest) (MessagesStickerSetClass, error) {
	var  MessagesStickerSetBox

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