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

// StickersAddStickerToSetRequest represents TL type `stickers.addStickerToSet#8653febe`.
// Add a sticker to a stickerset, bots only. The sticker set must have been created by
// the bot.
//
// See https://core.telegram.org/method/stickers.addStickerToSet for reference.
type StickersAddStickerToSetRequest struct {
	// The stickerset
	Stickerset InputStickerSetClass
	// The sticker
	Sticker InputStickerSetItem
}

// StickersAddStickerToSetRequestTypeID is TL type id of StickersAddStickerToSetRequest.
const StickersAddStickerToSetRequestTypeID = 0x8653febe

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

func ( *StickersAddStickerToSetRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Stickerset == nil) {
		return false
	}
	if !(.Sticker.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills StickersAddStickerToSetRequest from given interface.
func ( *StickersAddStickerToSetRequest) ( interface {
	() ( InputStickerSetClass)
	() ( InputStickerSetItem)
}) {
	.Stickerset = .()
	.Sticker = .()
}

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

// TypeName returns name of type in TL schema.
func (*StickersAddStickerToSetRequest) () string {
	return "stickers.addStickerToSet"
}

// TypeInfo returns info about TL type.
func ( *StickersAddStickerToSetRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stickers.addStickerToSet",
		ID:   StickersAddStickerToSetRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Stickerset",
			SchemaName: "stickerset",
		},
		{
			Name:       "Sticker",
			SchemaName: "sticker",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *StickersAddStickerToSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.addStickerToSet#8653febe as nil")
	}
	.PutID(StickersAddStickerToSetRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StickersAddStickerToSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.addStickerToSet#8653febe as nil")
	}
	if .Stickerset == nil {
		return fmt.Errorf("unable to encode stickers.addStickerToSet#8653febe: field stickerset is nil")
	}
	if  := .Stickerset.Encode();  != nil {
		return fmt.Errorf("unable to encode stickers.addStickerToSet#8653febe: field stickerset: %w", )
	}
	if  := .Sticker.Encode();  != nil {
		return fmt.Errorf("unable to encode stickers.addStickerToSet#8653febe: field sticker: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *StickersAddStickerToSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.addStickerToSet#8653febe to nil")
	}
	if  := .ConsumeID(StickersAddStickerToSetRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode stickers.addStickerToSet#8653febe: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *StickersAddStickerToSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.addStickerToSet#8653febe to nil")
	}
	{
		,  := DecodeInputStickerSet()
		if  != nil {
			return fmt.Errorf("unable to decode stickers.addStickerToSet#8653febe: field stickerset: %w", )
		}
		.Stickerset = 
	}
	{
		if  := .Sticker.Decode();  != nil {
			return fmt.Errorf("unable to decode stickers.addStickerToSet#8653febe: field sticker: %w", )
		}
	}
	return nil
}

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

// GetSticker returns value of Sticker field.
func ( *StickersAddStickerToSetRequest) () ( InputStickerSetItem) {
	if  == nil {
		return
	}
	return .Sticker
}

// StickersAddStickerToSet invokes method stickers.addStickerToSet#8653febe returning error if any.
// Add a sticker to a stickerset, bots only. The sticker set must have been created by
// the bot.
//
// Possible errors:
//
//	400 BOT_MISSING: Only bots can call this method, please use @stickers if you're a user.
//	400 STICKERPACK_STICKERS_TOO_MUCH: There are too many stickers in this stickerpack, you can't add any more.
//	406 STICKERSET_INVALID: The provided sticker set is invalid.
//	400 STICKERS_TOO_MUCH: There are too many stickers in this stickerpack, you can't add any more.
//	400 STICKER_PNG_NOPNG: One of the specified stickers is not a valid PNG file.
//	400 STICKER_TGS_NOTGS: Invalid TGS sticker provided.
//
// See https://core.telegram.org/method/stickers.addStickerToSet for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  *StickersAddStickerToSetRequest) (MessagesStickerSetClass, error) {
	var  MessagesStickerSetBox

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