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

// StickersRemoveStickerFromSetRequest represents TL type `stickers.removeStickerFromSet#f7760f51`.
// Remove a sticker from the set where it belongs, bots only. The sticker set must have
// been created by the bot.
//
// See https://core.telegram.org/method/stickers.removeStickerFromSet for reference.
type StickersRemoveStickerFromSetRequest struct {
	// The sticker to remove
	Sticker InputDocumentClass
}

// StickersRemoveStickerFromSetRequestTypeID is TL type id of StickersRemoveStickerFromSetRequest.
const StickersRemoveStickerFromSetRequestTypeID = 0xf7760f51

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

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

	return true
}

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

// FillFrom fills StickersRemoveStickerFromSetRequest from given interface.
func ( *StickersRemoveStickerFromSetRequest) ( interface {
	() ( InputDocumentClass)
}) {
	.Sticker = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *StickersRemoveStickerFromSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.removeStickerFromSet#f7760f51 as nil")
	}
	.PutID(StickersRemoveStickerFromSetRequestTypeID)
	return .EncodeBare()
}

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

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

// DecodeBare implements bin.BareDecoder.
func ( *StickersRemoveStickerFromSetRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.removeStickerFromSet#f7760f51 to nil")
	}
	{
		,  := DecodeInputDocument()
		if  != nil {
			return fmt.Errorf("unable to decode stickers.removeStickerFromSet#f7760f51: field sticker: %w", )
		}
		.Sticker = 
	}
	return nil
}

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

// GetStickerAsNotEmpty returns mapped value of Sticker field.
func ( *StickersRemoveStickerFromSetRequest) () (*InputDocument, bool) {
	return .Sticker.AsNotEmpty()
}

// StickersRemoveStickerFromSet invokes method stickers.removeStickerFromSet#f7760f51 returning error if any.
// Remove a sticker from the set where it belongs, 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 STICKER_INVALID: The provided sticker is invalid.
//
// See https://core.telegram.org/method/stickers.removeStickerFromSet for reference.
// Can be used by bots.
func ( *Client) ( context.Context,  InputDocumentClass) (MessagesStickerSetClass, error) {
	var  MessagesStickerSetBox

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