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

// StickersSuggestShortNameRequest represents TL type `stickers.suggestShortName#4dafc503`.
// Suggests a short name for a given stickerpack name
//
// See https://core.telegram.org/method/stickers.suggestShortName for reference.
type StickersSuggestShortNameRequest struct {
	// Sticker pack name
	Title string
}

// StickersSuggestShortNameRequestTypeID is TL type id of StickersSuggestShortNameRequest.
const StickersSuggestShortNameRequestTypeID = 0x4dafc503

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

func ( *StickersSuggestShortNameRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Title == "") {
		return false
	}

	return true
}

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

// FillFrom fills StickersSuggestShortNameRequest from given interface.
func ( *StickersSuggestShortNameRequest) ( interface {
	() ( string)
}) {
	.Title = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *StickersSuggestShortNameRequest) () tdp.Type {
	 := tdp.Type{
		Name: "stickers.suggestShortName",
		ID:   StickersSuggestShortNameRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *StickersSuggestShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.suggestShortName#4dafc503 as nil")
	}
	.PutID(StickersSuggestShortNameRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *StickersSuggestShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode stickers.suggestShortName#4dafc503 as nil")
	}
	.PutString(.Title)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *StickersSuggestShortNameRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode stickers.suggestShortName#4dafc503 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode stickers.suggestShortName#4dafc503: field title: %w", )
		}
		.Title = 
	}
	return nil
}

// GetTitle returns value of Title field.
func ( *StickersSuggestShortNameRequest) () ( string) {
	if  == nil {
		return
	}
	return .Title
}

// StickersSuggestShortName invokes method stickers.suggestShortName#4dafc503 returning error if any.
// Suggests a short name for a given stickerpack name
//
// Possible errors:
//
//	400 TITLE_INVALID: The specified stickerpack title is invalid.
//
// See https://core.telegram.org/method/stickers.suggestShortName for reference.
func ( *Client) ( context.Context,  string) (*StickersSuggestedShortName, error) {
	var  StickersSuggestedShortName

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