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

// MessagesGetAttachedStickersRequest represents TL type `messages.getAttachedStickers#cc5b67cc`.
// Get stickers attached to a photo or video
//
// See https://core.telegram.org/method/messages.getAttachedStickers for reference.
type MessagesGetAttachedStickersRequest struct {
	// Stickered media
	Media InputStickeredMediaClass
}

// MessagesGetAttachedStickersRequestTypeID is TL type id of MessagesGetAttachedStickersRequest.
const MessagesGetAttachedStickersRequestTypeID = 0xcc5b67cc

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

func ( *MessagesGetAttachedStickersRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Media == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetAttachedStickersRequest from given interface.
func ( *MessagesGetAttachedStickersRequest) ( interface {
	() ( InputStickeredMediaClass)
}) {
	.Media = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesGetAttachedStickersRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getAttachedStickers",
		ID:   MessagesGetAttachedStickersRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Media",
			SchemaName: "media",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetAttachedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getAttachedStickers#cc5b67cc as nil")
	}
	.PutID(MessagesGetAttachedStickersRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetAttachedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getAttachedStickers#cc5b67cc as nil")
	}
	if .Media == nil {
		return fmt.Errorf("unable to encode messages.getAttachedStickers#cc5b67cc: field media is nil")
	}
	if  := .Media.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.getAttachedStickers#cc5b67cc: field media: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetAttachedStickersRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getAttachedStickers#cc5b67cc to nil")
	}
	{
		,  := DecodeInputStickeredMedia()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getAttachedStickers#cc5b67cc: field media: %w", )
		}
		.Media = 
	}
	return nil
}

// GetMedia returns value of Media field.
func ( *MessagesGetAttachedStickersRequest) () ( InputStickeredMediaClass) {
	if  == nil {
		return
	}
	return .Media
}

// MessagesGetAttachedStickers invokes method messages.getAttachedStickers#cc5b67cc returning error if any.
// Get stickers attached to a photo or video
//
// See https://core.telegram.org/method/messages.getAttachedStickers for reference.
func ( *Client) ( context.Context,  InputStickeredMediaClass) ([]StickerSetCoveredClass, error) {
	var  StickerSetCoveredClassVector

	 := &MessagesGetAttachedStickersRequest{
		Media: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return []StickerSetCoveredClass(.Elems), nil
}