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

// LangPackStringClassVector is a box for Vector<LangPackString>
type LangPackStringClassVector struct {
	// Elements of Vector<LangPackString>
	Elems []LangPackStringClass
}

// LangPackStringClassVectorTypeID is TL type id of LangPackStringClassVector.
const LangPackStringClassVectorTypeID = bin.TypeVector

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

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

	return true
}

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

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

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

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

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

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

	return .EncodeBare()
}

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

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

	return .DecodeBare()
}

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

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

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

// MapElems returns field Elems wrapped in LangPackStringClassArray helper.
func ( *LangPackStringClassVector) () ( LangPackStringClassArray) {
	return LangPackStringClassArray(.Elems)
}