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

// EmojiURL represents TL type `emojiURL#a575739d`.
// An HTTP URL which can be used to automatically log in into translation platform and
// suggest new emoji replacements. The URL will be valid for 30 seconds after generation
//
// See https://core.telegram.org/constructor/emojiURL for reference.
type EmojiURL struct {
	// An HTTP URL which can be used to automatically log in into translation platform and
	// suggest new emoji replacements. The URL will be valid for 30 seconds after generation
	URL string
}

// EmojiURLTypeID is TL type id of EmojiURL.
const EmojiURLTypeID = 0xa575739d

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

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

	return true
}

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

// FillFrom fills EmojiURL from given interface.
func ( *EmojiURL) ( interface {
	() ( string)
}) {
	.URL = .()
}

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

// TypeName returns name of type in TL schema.
func (*EmojiURL) () string {
	return "emojiURL"
}

// TypeInfo returns info about TL type.
func ( *EmojiURL) () tdp.Type {
	 := tdp.Type{
		Name: "emojiURL",
		ID:   EmojiURLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "URL",
			SchemaName: "url",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *EmojiURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiURL#a575739d as nil")
	}
	.PutID(EmojiURLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *EmojiURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode emojiURL#a575739d as nil")
	}
	.PutString(.URL)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *EmojiURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode emojiURL#a575739d to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode emojiURL#a575739d: field url: %w", )
		}
		.URL = 
	}
	return nil
}

// GetURL returns value of URL field.
func ( *EmojiURL) () ( string) {
	if  == nil {
		return
	}
	return .URL
}