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

// MessagesGetEmojiURLRequest represents TL type `messages.getEmojiURL#d5b10c26`.
// Returns an HTTP URL which can be used to automatically log in into translation
// platform and suggest new emoji keywords »¹. The URL will be valid for 30 seconds
// after generation.
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiURL for reference.
type MessagesGetEmojiURLRequest struct {
	// Language code for which the emoji keywords will be suggested
	LangCode string
}

// MessagesGetEmojiURLRequestTypeID is TL type id of MessagesGetEmojiURLRequest.
const MessagesGetEmojiURLRequestTypeID = 0xd5b10c26

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

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

	return true
}

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

// FillFrom fills MessagesGetEmojiURLRequest from given interface.
func ( *MessagesGetEmojiURLRequest) ( interface {
	() ( string)
}) {
	.LangCode = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesGetEmojiURLRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getEmojiURL",
		ID:   MessagesGetEmojiURLRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "LangCode",
			SchemaName: "lang_code",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetEmojiURLRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiURL#d5b10c26 as nil")
	}
	.PutID(MessagesGetEmojiURLRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetEmojiURLRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiURL#d5b10c26 as nil")
	}
	.PutString(.LangCode)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetEmojiURLRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiURL#d5b10c26 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiURL#d5b10c26: field lang_code: %w", )
		}
		.LangCode = 
	}
	return nil
}

// GetLangCode returns value of LangCode field.
func ( *MessagesGetEmojiURLRequest) () ( string) {
	if  == nil {
		return
	}
	return .LangCode
}

// MessagesGetEmojiURL invokes method messages.getEmojiURL#d5b10c26 returning error if any.
// Returns an HTTP URL which can be used to automatically log in into translation
// platform and suggest new emoji keywords »¹. The URL will be valid for 30 seconds
// after generation.
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiURL for reference.
func ( *Client) ( context.Context,  string) (*EmojiURL, error) {
	var  EmojiURL

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