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

// MessagesGetEmojiKeywordsDifferenceRequest represents TL type `messages.getEmojiKeywordsDifference#1508b6af`.
// Get changed emoji keywords »¹.
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiKeywordsDifference for reference.
type MessagesGetEmojiKeywordsDifferenceRequest struct {
	// Language code
	LangCode string
	// Previous stored emoji keyword list version
	FromVersion int
}

// MessagesGetEmojiKeywordsDifferenceRequestTypeID is TL type id of MessagesGetEmojiKeywordsDifferenceRequest.
const MessagesGetEmojiKeywordsDifferenceRequestTypeID = 0x1508b6af

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

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

	return true
}

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

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

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

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

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

// Encode implements bin.Encoder.
func ( *MessagesGetEmojiKeywordsDifferenceRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiKeywordsDifference#1508b6af as nil")
	}
	.PutID(MessagesGetEmojiKeywordsDifferenceRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetEmojiKeywordsDifferenceRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getEmojiKeywordsDifference#1508b6af as nil")
	}
	.PutString(.LangCode)
	.PutInt(.FromVersion)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetEmojiKeywordsDifferenceRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getEmojiKeywordsDifference#1508b6af to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiKeywordsDifference#1508b6af: field lang_code: %w", )
		}
		.LangCode = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getEmojiKeywordsDifference#1508b6af: field from_version: %w", )
		}
		.FromVersion = 
	}
	return nil
}

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

// GetFromVersion returns value of FromVersion field.
func ( *MessagesGetEmojiKeywordsDifferenceRequest) () ( int) {
	if  == nil {
		return
	}
	return .FromVersion
}

// MessagesGetEmojiKeywordsDifference invokes method messages.getEmojiKeywordsDifference#1508b6af returning error if any.
// Get changed emoji keywords »¹.
//
// Links:
//  1. https://core.telegram.org/api/custom-emoji#emoji-keywords
//
// See https://core.telegram.org/method/messages.getEmojiKeywordsDifference for reference.
func ( *Client) ( context.Context,  *MessagesGetEmojiKeywordsDifferenceRequest) (*EmojiKeywordsDifference, error) {
	var  EmojiKeywordsDifference

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