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

// MessagesDialogs represents TL type `messages.dialogs#15ba6c40`.
// Full list of chats with messages and auxiliary data.
//
// See https://core.telegram.org/constructor/messages.dialogs for reference.
type MessagesDialogs struct {
	// List of chats
	Dialogs []DialogClass
	// List of last messages from each chat
	Messages []MessageClass
	// List of groups mentioned in the chats
	Chats []ChatClass
	// List of users mentioned in messages and groups
	Users []UserClass
}

// MessagesDialogsTypeID is TL type id of MessagesDialogs.
const MessagesDialogsTypeID = 0x15ba6c40

// construct implements constructor of MessagesDialogsClass.
func ( MessagesDialogs) () MessagesDialogsClass { return & }

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

	_ MessagesDialogsClass = &MessagesDialogs{}
)

func ( *MessagesDialogs) () bool {
	if  == nil {
		return true
	}
	if !(.Dialogs == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesDialogs from given interface.
func ( *MessagesDialogs) ( interface {
	() ( []DialogClass)
	() ( []MessageClass)
	() ( []ChatClass)
	() ( []UserClass)
}) {
	.Dialogs = .()
	.Messages = .()
	.Chats = .()
	.Users = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesDialogs) () tdp.Type {
	 := tdp.Type{
		Name: "messages.dialogs",
		ID:   MessagesDialogsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Dialogs",
			SchemaName: "dialogs",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogs#15ba6c40 as nil")
	}
	.PutID(MessagesDialogsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogs#15ba6c40 as nil")
	}
	.PutVectorHeader(len(.Dialogs))
	for ,  := range .Dialogs {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field dialogs element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field dialogs element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field messages element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field messages element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field chats element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogs#15ba6c40: field users element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesDialogs) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.dialogs#15ba6c40 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field dialogs: %w", )
		}

		if  > 0 {
			.Dialogs = make([]DialogClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDialog()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field dialogs: %w", )
			}
			.Dialogs = append(.Dialogs, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]MessageClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessage()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogs#15ba6c40: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	return nil
}

// GetDialogs returns value of Dialogs field.
func ( *MessagesDialogs) () ( []DialogClass) {
	if  == nil {
		return
	}
	return .Dialogs
}

// GetMessages returns value of Messages field.
func ( *MessagesDialogs) () ( []MessageClass) {
	if  == nil {
		return
	}
	return .Messages
}

// GetChats returns value of Chats field.
func ( *MessagesDialogs) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetUsers returns value of Users field.
func ( *MessagesDialogs) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// MapDialogs returns field Dialogs wrapped in DialogClassArray helper.
func ( *MessagesDialogs) () ( DialogClassArray) {
	return DialogClassArray(.Dialogs)
}

// MapMessages returns field Messages wrapped in MessageClassArray helper.
func ( *MessagesDialogs) () ( MessageClassArray) {
	return MessageClassArray(.Messages)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *MessagesDialogs) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *MessagesDialogs) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// MessagesDialogsSlice represents TL type `messages.dialogsSlice#71e094f3`.
// Incomplete list of dialogs with messages and auxiliary data.
//
// See https://core.telegram.org/constructor/messages.dialogsSlice for reference.
type MessagesDialogsSlice struct {
	// Total number of dialogs
	Count int
	// List of dialogs
	Dialogs []DialogClass
	// List of last messages from dialogs
	Messages []MessageClass
	// List of chats mentioned in dialogs
	Chats []ChatClass
	// List of users mentioned in messages and chats
	Users []UserClass
}

// MessagesDialogsSliceTypeID is TL type id of MessagesDialogsSlice.
const MessagesDialogsSliceTypeID = 0x71e094f3

// construct implements constructor of MessagesDialogsClass.
func ( MessagesDialogsSlice) () MessagesDialogsClass { return & }

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

	_ MessagesDialogsClass = &MessagesDialogsSlice{}
)

func ( *MessagesDialogsSlice) () bool {
	if  == nil {
		return true
	}
	if !(.Count == 0) {
		return false
	}
	if !(.Dialogs == nil) {
		return false
	}
	if !(.Messages == nil) {
		return false
	}
	if !(.Chats == nil) {
		return false
	}
	if !(.Users == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesDialogsSlice from given interface.
func ( *MessagesDialogsSlice) ( interface {
	() ( int)
	() ( []DialogClass)
	() ( []MessageClass)
	() ( []ChatClass)
	() ( []UserClass)
}) {
	.Count = .()
	.Dialogs = .()
	.Messages = .()
	.Chats = .()
	.Users = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesDialogsSlice) () tdp.Type {
	 := tdp.Type{
		Name: "messages.dialogsSlice",
		ID:   MessagesDialogsSliceTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Count",
			SchemaName: "count",
		},
		{
			Name:       "Dialogs",
			SchemaName: "dialogs",
		},
		{
			Name:       "Messages",
			SchemaName: "messages",
		},
		{
			Name:       "Chats",
			SchemaName: "chats",
		},
		{
			Name:       "Users",
			SchemaName: "users",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesDialogsSlice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogsSlice#71e094f3 as nil")
	}
	.PutID(MessagesDialogsSliceTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesDialogsSlice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogsSlice#71e094f3 as nil")
	}
	.PutInt(.Count)
	.PutVectorHeader(len(.Dialogs))
	for ,  := range .Dialogs {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field dialogs element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field dialogs element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Messages))
	for ,  := range .Messages {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field messages element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field messages element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Chats))
	for ,  := range .Chats {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field chats element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field chats element with index %d: %w", , )
		}
	}
	.PutVectorHeader(len(.Users))
	for ,  := range .Users {
		if  == nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field users element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode messages.dialogsSlice#71e094f3: field users element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesDialogsSlice) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.dialogsSlice#71e094f3 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field count: %w", )
		}
		.Count = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field dialogs: %w", )
		}

		if  > 0 {
			.Dialogs = make([]DialogClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDialog()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field dialogs: %w", )
			}
			.Dialogs = append(.Dialogs, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field messages: %w", )
		}

		if  > 0 {
			.Messages = make([]MessageClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeMessage()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field messages: %w", )
			}
			.Messages = append(.Messages, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field chats: %w", )
		}

		if  > 0 {
			.Chats = make([]ChatClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeChat()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field chats: %w", )
			}
			.Chats = append(.Chats, )
		}
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field users: %w", )
		}

		if  > 0 {
			.Users = make([]UserClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeUser()
			if  != nil {
				return fmt.Errorf("unable to decode messages.dialogsSlice#71e094f3: field users: %w", )
			}
			.Users = append(.Users, )
		}
	}
	return nil
}

// GetCount returns value of Count field.
func ( *MessagesDialogsSlice) () ( int) {
	if  == nil {
		return
	}
	return .Count
}

// GetDialogs returns value of Dialogs field.
func ( *MessagesDialogsSlice) () ( []DialogClass) {
	if  == nil {
		return
	}
	return .Dialogs
}

// GetMessages returns value of Messages field.
func ( *MessagesDialogsSlice) () ( []MessageClass) {
	if  == nil {
		return
	}
	return .Messages
}

// GetChats returns value of Chats field.
func ( *MessagesDialogsSlice) () ( []ChatClass) {
	if  == nil {
		return
	}
	return .Chats
}

// GetUsers returns value of Users field.
func ( *MessagesDialogsSlice) () ( []UserClass) {
	if  == nil {
		return
	}
	return .Users
}

// MapDialogs returns field Dialogs wrapped in DialogClassArray helper.
func ( *MessagesDialogsSlice) () ( DialogClassArray) {
	return DialogClassArray(.Dialogs)
}

// MapMessages returns field Messages wrapped in MessageClassArray helper.
func ( *MessagesDialogsSlice) () ( MessageClassArray) {
	return MessageClassArray(.Messages)
}

// MapChats returns field Chats wrapped in ChatClassArray helper.
func ( *MessagesDialogsSlice) () ( ChatClassArray) {
	return ChatClassArray(.Chats)
}

// MapUsers returns field Users wrapped in UserClassArray helper.
func ( *MessagesDialogsSlice) () ( UserClassArray) {
	return UserClassArray(.Users)
}

// MessagesDialogsNotModified represents TL type `messages.dialogsNotModified#f0e3e596`.
// Dialogs haven't changed
//
// See https://core.telegram.org/constructor/messages.dialogsNotModified for reference.
type MessagesDialogsNotModified struct {
	// Number of dialogs found server-side by the query
	Count int
}

// MessagesDialogsNotModifiedTypeID is TL type id of MessagesDialogsNotModified.
const MessagesDialogsNotModifiedTypeID = 0xf0e3e596

// construct implements constructor of MessagesDialogsClass.
func ( MessagesDialogsNotModified) () MessagesDialogsClass { return & }

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

	_ MessagesDialogsClass = &MessagesDialogsNotModified{}
)

func ( *MessagesDialogsNotModified) () bool {
	if  == nil {
		return true
	}
	if !(.Count == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesDialogsNotModified from given interface.
func ( *MessagesDialogsNotModified) ( interface {
	() ( int)
}) {
	.Count = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesDialogsNotModified) () tdp.Type {
	 := tdp.Type{
		Name: "messages.dialogsNotModified",
		ID:   MessagesDialogsNotModifiedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Count",
			SchemaName: "count",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesDialogsNotModified) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogsNotModified#f0e3e596 as nil")
	}
	.PutID(MessagesDialogsNotModifiedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesDialogsNotModified) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.dialogsNotModified#f0e3e596 as nil")
	}
	.PutInt(.Count)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesDialogsNotModified) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.dialogsNotModified#f0e3e596 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.dialogsNotModified#f0e3e596: field count: %w", )
		}
		.Count = 
	}
	return nil
}

// GetCount returns value of Count field.
func ( *MessagesDialogsNotModified) () ( int) {
	if  == nil {
		return
	}
	return .Count
}

// MessagesDialogsClassName is schema name of MessagesDialogsClass.
const MessagesDialogsClassName = "messages.Dialogs"

// MessagesDialogsClass represents messages.Dialogs generic type.
//
// See https://core.telegram.org/type/messages.Dialogs for reference.
//
// Example:
//
//	g, err := tg.DecodeMessagesDialogs(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.MessagesDialogs: // messages.dialogs#15ba6c40
//	case *tg.MessagesDialogsSlice: // messages.dialogsSlice#71e094f3
//	case *tg.MessagesDialogsNotModified: // messages.dialogsNotModified#f0e3e596
//	default: panic(v)
//	}
type MessagesDialogsClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() MessagesDialogsClass

	// 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

	// AsModified tries to map MessagesDialogsClass to ModifiedMessagesDialogs.
	AsModified() (ModifiedMessagesDialogs, bool)
}

// ModifiedMessagesDialogs represents Modified subset of MessagesDialogsClass.
type ModifiedMessagesDialogs interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() MessagesDialogsClass

	// 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

	// List of chats
	GetDialogs() (value []DialogClass)

	// List of last messages from each chat
	GetMessages() (value []MessageClass)

	// List of groups mentioned in the chats
	GetChats() (value []ChatClass)

	// List of users mentioned in messages and groups
	GetUsers() (value []UserClass)
}

// AsModified tries to map MessagesDialogs to ModifiedMessagesDialogs.
func ( *MessagesDialogs) () (ModifiedMessagesDialogs, bool) {
	,  := (MessagesDialogsClass()).(ModifiedMessagesDialogs)
	return , 
}

// AsModified tries to map MessagesDialogsSlice to ModifiedMessagesDialogs.
func ( *MessagesDialogsSlice) () (ModifiedMessagesDialogs, bool) {
	,  := (MessagesDialogsClass()).(ModifiedMessagesDialogs)
	return , 
}

// AsModified tries to map MessagesDialogsNotModified to ModifiedMessagesDialogs.
func ( *MessagesDialogsNotModified) () (ModifiedMessagesDialogs, bool) {
	,  := (MessagesDialogsClass()).(ModifiedMessagesDialogs)
	return , 
}

// DecodeMessagesDialogs implements binary de-serialization for MessagesDialogsClass.
func ( *bin.Buffer) (MessagesDialogsClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case MessagesDialogsTypeID:
		// Decoding messages.dialogs#15ba6c40.
		 := MessagesDialogs{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessagesDialogsClass: %w", )
		}
		return &, nil
	case MessagesDialogsSliceTypeID:
		// Decoding messages.dialogsSlice#71e094f3.
		 := MessagesDialogsSlice{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessagesDialogsClass: %w", )
		}
		return &, nil
	case MessagesDialogsNotModifiedTypeID:
		// Decoding messages.dialogsNotModified#f0e3e596.
		 := MessagesDialogsNotModified{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessagesDialogsClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode MessagesDialogsClass: %w", bin.NewUnexpectedID())
	}
}

// MessagesDialogs boxes the MessagesDialogsClass providing a helper.
type MessagesDialogsBox struct {
	Dialogs MessagesDialogsClass
}

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

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