// Code generated by gotdgen, DO NOT EDIT.

package mt

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

// MsgsStateInfo represents TL type `msgs_state_info#4deb57d`.
type MsgsStateInfo struct {
	// ReqMsgID field of MsgsStateInfo.
	ReqMsgID int64
	// Info field of MsgsStateInfo.
	Info []byte
}

// MsgsStateInfoTypeID is TL type id of MsgsStateInfo.
const MsgsStateInfoTypeID = 0x4deb57d

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

func ( *MsgsStateInfo) () bool {
	if  == nil {
		return true
	}
	if !(.ReqMsgID == 0) {
		return false
	}
	if !(.Info == nil) {
		return false
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *MsgsStateInfo) () tdp.Type {
	 := tdp.Type{
		Name: "msgs_state_info",
		ID:   MsgsStateInfoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ReqMsgID",
			SchemaName: "req_msg_id",
		},
		{
			Name:       "Info",
			SchemaName: "info",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MsgsStateInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msgs_state_info#4deb57d as nil")
	}
	.PutID(MsgsStateInfoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MsgsStateInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msgs_state_info#4deb57d as nil")
	}
	.PutLong(.ReqMsgID)
	.PutBytes(.Info)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MsgsStateInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode msgs_state_info#4deb57d to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode msgs_state_info#4deb57d: field req_msg_id: %w", )
		}
		.ReqMsgID = 
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode msgs_state_info#4deb57d: field info: %w", )
		}
		.Info = 
	}
	return nil
}

// GetReqMsgID returns value of ReqMsgID field.
func ( *MsgsStateInfo) () ( int64) {
	if  == nil {
		return
	}
	return .ReqMsgID
}

// GetInfo returns value of Info field.
func ( *MsgsStateInfo) () ( []byte) {
	if  == nil {
		return
	}
	return .Info
}