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

// LangPackLanguageVector is a box for Vector<LangPackLanguage>
type LangPackLanguageVector struct {
	// Elements of Vector<LangPackLanguage>
	Elems []LangPackLanguage
}

// LangPackLanguageVectorTypeID is TL type id of LangPackLanguageVector.
const LangPackLanguageVectorTypeID = bin.TypeVector

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

func ( *LangPackLanguageVector) () bool {
	if  == nil {
		return true
	}
	if !(.Elems == nil) {
		return false
	}

	return true
}

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

// FillFrom fills LangPackLanguageVector from given interface.
func ( *LangPackLanguageVector) ( interface {
	() ( []LangPackLanguage)
}) {
	.Elems = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *LangPackLanguageVector) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode Vector<LangPackLanguage> as nil")
	}

	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *LangPackLanguageVector) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode Vector<LangPackLanguage> as nil")
	}
	.PutVectorHeader(len(.Elems))
	for ,  := range .Elems {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode Vector<LangPackLanguage>: field Elems element with index %d: %w", , )
		}
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *LangPackLanguageVector) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode Vector<LangPackLanguage> to nil")
	}

	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *LangPackLanguageVector) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode Vector<LangPackLanguage> to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode Vector<LangPackLanguage>: field Elems: %w", )
		}

		if  > 0 {
			.Elems = make([]LangPackLanguage, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  LangPackLanguage
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode Vector<LangPackLanguage>: field Elems: %w", )
			}
			.Elems = append(.Elems, )
		}
	}
	return nil
}

// GetElems returns value of Elems field.
func ( *LangPackLanguageVector) () ( []LangPackLanguage) {
	if  == nil {
		return
	}
	return .Elems
}