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

// DialogFilterSuggested represents TL type `dialogFilterSuggested#77744d4a`.
// Suggested folders¹
//
// Links:
//  1. https://core.telegram.org/api/folders
//
// See https://core.telegram.org/constructor/dialogFilterSuggested for reference.
type DialogFilterSuggested struct {
	// Folder info¹
	//
	// Links:
	//  1) https://core.telegram.org/api/folders
	Filter DialogFilterClass
	// Folder¹ description
	//
	// Links:
	//  1) https://core.telegram.org/api/folders
	Description string
}

// DialogFilterSuggestedTypeID is TL type id of DialogFilterSuggested.
const DialogFilterSuggestedTypeID = 0x77744d4a

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

func ( *DialogFilterSuggested) () bool {
	if  == nil {
		return true
	}
	if !(.Filter == nil) {
		return false
	}
	if !(.Description == "") {
		return false
	}

	return true
}

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

// FillFrom fills DialogFilterSuggested from given interface.
func ( *DialogFilterSuggested) ( interface {
	() ( DialogFilterClass)
	() ( string)
}) {
	.Filter = .()
	.Description = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *DialogFilterSuggested) () tdp.Type {
	 := tdp.Type{
		Name: "dialogFilterSuggested",
		ID:   DialogFilterSuggestedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Filter",
			SchemaName: "filter",
		},
		{
			Name:       "Description",
			SchemaName: "description",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *DialogFilterSuggested) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode dialogFilterSuggested#77744d4a as nil")
	}
	.PutID(DialogFilterSuggestedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *DialogFilterSuggested) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode dialogFilterSuggested#77744d4a as nil")
	}
	if .Filter == nil {
		return fmt.Errorf("unable to encode dialogFilterSuggested#77744d4a: field filter is nil")
	}
	if  := .Filter.Encode();  != nil {
		return fmt.Errorf("unable to encode dialogFilterSuggested#77744d4a: field filter: %w", )
	}
	.PutString(.Description)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *DialogFilterSuggested) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode dialogFilterSuggested#77744d4a to nil")
	}
	{
		,  := DecodeDialogFilter()
		if  != nil {
			return fmt.Errorf("unable to decode dialogFilterSuggested#77744d4a: field filter: %w", )
		}
		.Filter = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode dialogFilterSuggested#77744d4a: field description: %w", )
		}
		.Description = 
	}
	return nil
}

// GetFilter returns value of Filter field.
func ( *DialogFilterSuggested) () ( DialogFilterClass) {
	if  == nil {
		return
	}
	return .Filter
}

// GetDescription returns value of Description field.
func ( *DialogFilterSuggested) () ( string) {
	if  == nil {
		return
	}
	return .Description
}