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

// ReactionNotificationsFromContacts represents TL type `reactionNotificationsFromContacts#bac3a61a`.
// Receive notifications about reactions made only by our contacts.
//
// See https://core.telegram.org/constructor/reactionNotificationsFromContacts for reference.
type ReactionNotificationsFromContacts struct {
}

// ReactionNotificationsFromContactsTypeID is TL type id of ReactionNotificationsFromContacts.
const ReactionNotificationsFromContactsTypeID = 0xbac3a61a

// construct implements constructor of ReactionNotificationsFromClass.
func ( ReactionNotificationsFromContacts) () ReactionNotificationsFromClass { return & }

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

	_ ReactionNotificationsFromClass = &ReactionNotificationsFromContacts{}
)

func ( *ReactionNotificationsFromContacts) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *ReactionNotificationsFromContacts) () tdp.Type {
	 := tdp.Type{
		Name: "reactionNotificationsFromContacts",
		ID:   ReactionNotificationsFromContactsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *ReactionNotificationsFromContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode reactionNotificationsFromContacts#bac3a61a as nil")
	}
	.PutID(ReactionNotificationsFromContactsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReactionNotificationsFromContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode reactionNotificationsFromContacts#bac3a61a as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReactionNotificationsFromContacts) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode reactionNotificationsFromContacts#bac3a61a to nil")
	}
	return nil
}

// ReactionNotificationsFromAll represents TL type `reactionNotificationsFromAll#4b9e22a0`.
// Receive notifications about reactions made by any user.
//
// See https://core.telegram.org/constructor/reactionNotificationsFromAll for reference.
type ReactionNotificationsFromAll struct {
}

// ReactionNotificationsFromAllTypeID is TL type id of ReactionNotificationsFromAll.
const ReactionNotificationsFromAllTypeID = 0x4b9e22a0

// construct implements constructor of ReactionNotificationsFromClass.
func ( ReactionNotificationsFromAll) () ReactionNotificationsFromClass { return & }

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

	_ ReactionNotificationsFromClass = &ReactionNotificationsFromAll{}
)

func ( *ReactionNotificationsFromAll) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *ReactionNotificationsFromAll) () tdp.Type {
	 := tdp.Type{
		Name: "reactionNotificationsFromAll",
		ID:   ReactionNotificationsFromAllTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *ReactionNotificationsFromAll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode reactionNotificationsFromAll#4b9e22a0 as nil")
	}
	.PutID(ReactionNotificationsFromAllTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReactionNotificationsFromAll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode reactionNotificationsFromAll#4b9e22a0 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReactionNotificationsFromAll) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode reactionNotificationsFromAll#4b9e22a0 to nil")
	}
	return nil
}

// ReactionNotificationsFromClassName is schema name of ReactionNotificationsFromClass.
const ReactionNotificationsFromClassName = "ReactionNotificationsFrom"

// ReactionNotificationsFromClass represents ReactionNotificationsFrom generic type.
//
// See https://core.telegram.org/type/ReactionNotificationsFrom for reference.
//
// Constructors:
//   - [ReactionNotificationsFromContacts]
//   - [ReactionNotificationsFromAll]
//
// Example:
//
//	g, err := tg.DecodeReactionNotificationsFrom(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.ReactionNotificationsFromContacts: // reactionNotificationsFromContacts#bac3a61a
//	case *tg.ReactionNotificationsFromAll: // reactionNotificationsFromAll#4b9e22a0
//	default: panic(v)
//	}
type ReactionNotificationsFromClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() ReactionNotificationsFromClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool
}

// DecodeReactionNotificationsFrom implements binary de-serialization for ReactionNotificationsFromClass.
func ( *bin.Buffer) (ReactionNotificationsFromClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case ReactionNotificationsFromContactsTypeID:
		// Decoding reactionNotificationsFromContacts#bac3a61a.
		 := ReactionNotificationsFromContacts{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReactionNotificationsFromClass: %w", )
		}
		return &, nil
	case ReactionNotificationsFromAllTypeID:
		// Decoding reactionNotificationsFromAll#4b9e22a0.
		 := ReactionNotificationsFromAll{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode ReactionNotificationsFromClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode ReactionNotificationsFromClass: %w", bin.NewUnexpectedID())
	}
}

// ReactionNotificationsFrom boxes the ReactionNotificationsFromClass providing a helper.
type ReactionNotificationsFromBox struct {
	ReactionNotificationsFrom ReactionNotificationsFromClass
}

// Decode implements bin.Decoder for ReactionNotificationsFromBox.
func ( *ReactionNotificationsFromBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode ReactionNotificationsFromBox to nil")
	}
	,  := DecodeReactionNotificationsFrom()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.ReactionNotificationsFrom = 
	return nil
}

// Encode implements bin.Encode for ReactionNotificationsFromBox.
func ( *ReactionNotificationsFromBox) ( *bin.Buffer) error {
	if  == nil || .ReactionNotificationsFrom == nil {
		return fmt.Errorf("unable to encode ReactionNotificationsFromClass as nil")
	}
	return .ReactionNotificationsFrom.Encode()
}