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

// MessagesEmojiGameOutcome represents TL type `messages.emojiGameOutcome#da2ad647`.
//
// See https://core.telegram.org/constructor/messages.emojiGameOutcome for reference.
type MessagesEmojiGameOutcome struct {
	// Seed field of MessagesEmojiGameOutcome.
	Seed []byte
	// StakeTonAmount field of MessagesEmojiGameOutcome.
	StakeTonAmount int64
	// TonAmount field of MessagesEmojiGameOutcome.
	TonAmount int64
}

// MessagesEmojiGameOutcomeTypeID is TL type id of MessagesEmojiGameOutcome.
const MessagesEmojiGameOutcomeTypeID = 0xda2ad647

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

func ( *MessagesEmojiGameOutcome) () bool {
	if  == nil {
		return true
	}
	if !(.Seed == nil) {
		return false
	}
	if !(.StakeTonAmount == 0) {
		return false
	}
	if !(.TonAmount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesEmojiGameOutcome from given interface.
func ( *MessagesEmojiGameOutcome) ( interface {
	() ( []byte)
	() ( int64)
	() ( int64)
}) {
	.Seed = .()
	.StakeTonAmount = .()
	.TonAmount = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesEmojiGameOutcome) () tdp.Type {
	 := tdp.Type{
		Name: "messages.emojiGameOutcome",
		ID:   MessagesEmojiGameOutcomeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Seed",
			SchemaName: "seed",
		},
		{
			Name:       "StakeTonAmount",
			SchemaName: "stake_ton_amount",
		},
		{
			Name:       "TonAmount",
			SchemaName: "ton_amount",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesEmojiGameOutcome) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.emojiGameOutcome#da2ad647 as nil")
	}
	.PutID(MessagesEmojiGameOutcomeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesEmojiGameOutcome) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.emojiGameOutcome#da2ad647 as nil")
	}
	.PutBytes(.Seed)
	.PutLong(.StakeTonAmount)
	.PutLong(.TonAmount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesEmojiGameOutcome) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.emojiGameOutcome#da2ad647 to nil")
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode messages.emojiGameOutcome#da2ad647: field seed: %w", )
		}
		.Seed = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.emojiGameOutcome#da2ad647: field stake_ton_amount: %w", )
		}
		.StakeTonAmount = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.emojiGameOutcome#da2ad647: field ton_amount: %w", )
		}
		.TonAmount = 
	}
	return nil
}

// GetSeed returns value of Seed field.
func ( *MessagesEmojiGameOutcome) () ( []byte) {
	if  == nil {
		return
	}
	return .Seed
}

// GetStakeTonAmount returns value of StakeTonAmount field.
func ( *MessagesEmojiGameOutcome) () ( int64) {
	if  == nil {
		return
	}
	return .StakeTonAmount
}

// GetTonAmount returns value of TonAmount field.
func ( *MessagesEmojiGameOutcome) () ( int64) {
	if  == nil {
		return
	}
	return .TonAmount
}