// Code generated by gotdgen, DO NOT EDIT.

package td

import (
	"context"
	"errors"
	"fmt"
	"sort"
	"strings"

	"go.uber.org/multierr"

	"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
	"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)

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

// TypesMap returns mapping from type ids to TL type names.
func TypesMap() map[uint32]string {
	return map[uint32]string{
		Int32TypeID:                        "int32#5cb934fa",
		StringTypeID:                       "string#b5286e24",
		FalseTypeID:                        "false#bc799737",
		TrueTypeID:                         "true#997275b5",
		BytesTypeID:                        "bytes#e937bb82",
		ErrorTypeID:                        "error#14feebbc",
		OkTypeID:                           "ok#d4edbe69",
		MessageTypeID:                      "message#ec200d96",
		SMSTypeID:                          "sms#ed8bebfe",
		ResponseIDTypeID:                   "responseID#85d7fd8b",
		ResponseTextTypeID:                 "responseText#cb0244f2",
		BigMessageTypeID:                   "bigMessage#7490dcc5",
		NoMessageTypeID:                    "noMessage#ee6324c4",
		TargetsMessageTypeID:               "targetsMessage#cc6136f1",
		UpdateTypeID:                       "update#b03e2ef8",
		GetUpdatesRespTypeID:               "getUpdatesResp#300bb5e1",
		FieldsMessageTypeID:                "fieldsMessage#947225b5",
		BytesMessageTypeID:                 "bytesMessage#f990a67d",
		TextEntityTypeMentionTypeID:        "textEntityTypeMention#37b3df65",
		TextEntityTypeHashtagTypeID:        "textEntityTypeHashtag#c2f7a2dd",
		TextEntityTypeCashtagTypeID:        "textEntityTypeCashtag#48e4374b",
		TextEntityTypeBotCommandTypeID:     "textEntityTypeBotCommand#bb652bb3",
		TextEntityTypeURLTypeID:            "textEntityTypeUrl#b1c0d47c",
		TextEntityTypeEmailAddressTypeID:   "textEntityTypeEmailAddress#54f81821",
		TextEntityTypePhoneNumberTypeID:    "textEntityTypePhoneNumber#bad9aa2a",
		TextEntityTypeBankCardNumberTypeID: "textEntityTypeBankCardNumber#6513910",
		TextEntityTypeBoldTypeID:           "textEntityTypeBold#bcc0e1b0",
		TextEntityTypeItalicTypeID:         "textEntityTypeItalic#f8f3965d",
		TextEntityTypeUnderlineTypeID:      "textEntityTypeUnderline#2f39cf92",
		TextEntityTypeStrikethroughTypeID:  "textEntityTypeStrikethrough#394fc4fa",
		TextEntityTypeCodeTypeID:           "textEntityTypeCode#c5e9c94a",
		TextEntityTypePreTypeID:            "textEntityTypePre#62491c8e",
		TextEntityTypePreCodeTypeID:        "textEntityTypePreCode#c7a77aab",
		TextEntityTypeTextURLTypeID:        "textEntityTypeTextUrl#1a912463",
		TextEntityTypeMentionNameTypeID:    "textEntityTypeMentionName#d0d2685d",
		TextEntityTypeID:                   "textEntity#8bab99a8",
		TextEntitiesTypeID:                 "textEntities#cf89c258",
		TestIntTypeID:                      "testInt#ddbd2c09",
		TestStringTypeID:                   "testString#fe56688c",
		TestBytesTypeID:                    "testBytes#a422c4de",
		TestVectorIntTypeID:                "testVectorInt#df9eb113",
		TestVectorIntObjectTypeID:          "testVectorIntObject#f152999b",
		TestVectorStringTypeID:             "testVectorString#5d6f85bc",
		TestVectorStringObjectTypeID:       "testVectorStringObject#e5ecc0d",
		TestVectorBytesTypeID:              "testVectorBytes#a590fb25",
		TestVectorVectorTypeID:             "testVectorVector#69e8846c",
		ClientDHInnerDataTypeID:            "client_DH_inner_data#6643b654",
		DCOptionTypeID:                     "dcOption#18b7a10d",
		ConfigTypeID:                       "config#330b4067",
		InvokeWithLayerTypeID:              "invokeWithLayer#da9b0d0d",
		AuthTypeID:                         "auth#f8bb4a38",
		AuthPasswordTypeID:                 "authPassword#29bacabb",
		UserAuthTypeID:                     "user.auth#f4815592",
		UserAuthPasswordTypeID:             "user.authPassword#5981e317",
		ThemeTypeID:                        "theme#28f1114",
		AccountThemesNotModifiedTypeID:     "account.themesNotModified#f41eb622",
		AccountThemesTypeID:                "account.themes#7f676421",
		PingRequestTypeID:                  "ping#ce73048f",
		SendRequestTypeID:                  "send#f74488a",
		SendMultipleSMSRequestTypeID:       "sendMultipleSMS#df18e5ca",
		DoAuthRequestTypeID:                "doAuth#fd2f6687",
		EchoVectorRequestTypeID:            "echoVector#d4785939",
	}
}

// NamesMap returns mapping from type names to TL type ids.
func NamesMap() map[string]uint32 {
	return map[string]uint32{
		"int32":                        Int32TypeID,
		"string":                       StringTypeID,
		"false":                        FalseTypeID,
		"true":                         TrueTypeID,
		"bytes":                        BytesTypeID,
		"error":                        ErrorTypeID,
		"ok":                           OkTypeID,
		"message":                      MessageTypeID,
		"sms":                          SMSTypeID,
		"responseID":                   ResponseIDTypeID,
		"responseText":                 ResponseTextTypeID,
		"bigMessage":                   BigMessageTypeID,
		"noMessage":                    NoMessageTypeID,
		"targetsMessage":               TargetsMessageTypeID,
		"update":                       UpdateTypeID,
		"getUpdatesResp":               GetUpdatesRespTypeID,
		"fieldsMessage":                FieldsMessageTypeID,
		"bytesMessage":                 BytesMessageTypeID,
		"textEntityTypeMention":        TextEntityTypeMentionTypeID,
		"textEntityTypeHashtag":        TextEntityTypeHashtagTypeID,
		"textEntityTypeCashtag":        TextEntityTypeCashtagTypeID,
		"textEntityTypeBotCommand":     TextEntityTypeBotCommandTypeID,
		"textEntityTypeUrl":            TextEntityTypeURLTypeID,
		"textEntityTypeEmailAddress":   TextEntityTypeEmailAddressTypeID,
		"textEntityTypePhoneNumber":    TextEntityTypePhoneNumberTypeID,
		"textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID,
		"textEntityTypeBold":           TextEntityTypeBoldTypeID,
		"textEntityTypeItalic":         TextEntityTypeItalicTypeID,
		"textEntityTypeUnderline":      TextEntityTypeUnderlineTypeID,
		"textEntityTypeStrikethrough":  TextEntityTypeStrikethroughTypeID,
		"textEntityTypeCode":           TextEntityTypeCodeTypeID,
		"textEntityTypePre":            TextEntityTypePreTypeID,
		"textEntityTypePreCode":        TextEntityTypePreCodeTypeID,
		"textEntityTypeTextUrl":        TextEntityTypeTextURLTypeID,
		"textEntityTypeMentionName":    TextEntityTypeMentionNameTypeID,
		"textEntity":                   TextEntityTypeID,
		"textEntities":                 TextEntitiesTypeID,
		"testInt":                      TestIntTypeID,
		"testString":                   TestStringTypeID,
		"testBytes":                    TestBytesTypeID,
		"testVectorInt":                TestVectorIntTypeID,
		"testVectorIntObject":          TestVectorIntObjectTypeID,
		"testVectorString":             TestVectorStringTypeID,
		"testVectorStringObject":       TestVectorStringObjectTypeID,
		"testVectorBytes":              TestVectorBytesTypeID,
		"testVectorVector":             TestVectorVectorTypeID,
		"client_DH_inner_data":         ClientDHInnerDataTypeID,
		"dcOption":                     DCOptionTypeID,
		"config":                       ConfigTypeID,
		"invokeWithLayer":              InvokeWithLayerTypeID,
		"auth":                         AuthTypeID,
		"authPassword":                 AuthPasswordTypeID,
		"user.auth":                    UserAuthTypeID,
		"user.authPassword":            UserAuthPasswordTypeID,
		"theme":                        ThemeTypeID,
		"account.themesNotModified":    AccountThemesNotModifiedTypeID,
		"account.themes":               AccountThemesTypeID,
		"ping":                         PingRequestTypeID,
		"send":                         SendRequestTypeID,
		"sendMultipleSMS":              SendMultipleSMSRequestTypeID,
		"doAuth":                       DoAuthRequestTypeID,
		"echoVector":                   EchoVectorRequestTypeID,
	}
}

// TypesConstructorMap maps type ids to constructors.
func TypesConstructorMap() map[uint32]func() bin.Object {
	return map[uint32]func() bin.Object{
		Int32TypeID:                        func() bin.Object { return &Int32{} },
		StringTypeID:                       func() bin.Object { return &String{} },
		FalseTypeID:                        func() bin.Object { return &False{} },
		TrueTypeID:                         func() bin.Object { return &True{} },
		BytesTypeID:                        func() bin.Object { return &Bytes{} },
		ErrorTypeID:                        func() bin.Object { return &Error{} },
		OkTypeID:                           func() bin.Object { return &Ok{} },
		MessageTypeID:                      func() bin.Object { return &Message{} },
		SMSTypeID:                          func() bin.Object { return &SMS{} },
		ResponseIDTypeID:                   func() bin.Object { return &ResponseID{} },
		ResponseTextTypeID:                 func() bin.Object { return &ResponseText{} },
		BigMessageTypeID:                   func() bin.Object { return &BigMessage{} },
		NoMessageTypeID:                    func() bin.Object { return &NoMessage{} },
		TargetsMessageTypeID:               func() bin.Object { return &TargetsMessage{} },
		UpdateTypeID:                       func() bin.Object { return &Update{} },
		GetUpdatesRespTypeID:               func() bin.Object { return &GetUpdatesResp{} },
		FieldsMessageTypeID:                func() bin.Object { return &FieldsMessage{} },
		BytesMessageTypeID:                 func() bin.Object { return &BytesMessage{} },
		TextEntityTypeMentionTypeID:        func() bin.Object { return &TextEntityTypeMention{} },
		TextEntityTypeHashtagTypeID:        func() bin.Object { return &TextEntityTypeHashtag{} },
		TextEntityTypeCashtagTypeID:        func() bin.Object { return &TextEntityTypeCashtag{} },
		TextEntityTypeBotCommandTypeID:     func() bin.Object { return &TextEntityTypeBotCommand{} },
		TextEntityTypeURLTypeID:            func() bin.Object { return &TextEntityTypeURL{} },
		TextEntityTypeEmailAddressTypeID:   func() bin.Object { return &TextEntityTypeEmailAddress{} },
		TextEntityTypePhoneNumberTypeID:    func() bin.Object { return &TextEntityTypePhoneNumber{} },
		TextEntityTypeBankCardNumberTypeID: func() bin.Object { return &TextEntityTypeBankCardNumber{} },
		TextEntityTypeBoldTypeID:           func() bin.Object { return &TextEntityTypeBold{} },
		TextEntityTypeItalicTypeID:         func() bin.Object { return &TextEntityTypeItalic{} },
		TextEntityTypeUnderlineTypeID:      func() bin.Object { return &TextEntityTypeUnderline{} },
		TextEntityTypeStrikethroughTypeID:  func() bin.Object { return &TextEntityTypeStrikethrough{} },
		TextEntityTypeCodeTypeID:           func() bin.Object { return &TextEntityTypeCode{} },
		TextEntityTypePreTypeID:            func() bin.Object { return &TextEntityTypePre{} },
		TextEntityTypePreCodeTypeID:        func() bin.Object { return &TextEntityTypePreCode{} },
		TextEntityTypeTextURLTypeID:        func() bin.Object { return &TextEntityTypeTextURL{} },
		TextEntityTypeMentionNameTypeID:    func() bin.Object { return &TextEntityTypeMentionName{} },
		TextEntityTypeID:                   func() bin.Object { return &TextEntity{} },
		TextEntitiesTypeID:                 func() bin.Object { return &TextEntities{} },
		TestIntTypeID:                      func() bin.Object { return &TestInt{} },
		TestStringTypeID:                   func() bin.Object { return &TestString{} },
		TestBytesTypeID:                    func() bin.Object { return &TestBytes{} },
		TestVectorIntTypeID:                func() bin.Object { return &TestVectorInt{} },
		TestVectorIntObjectTypeID:          func() bin.Object { return &TestVectorIntObject{} },
		TestVectorStringTypeID:             func() bin.Object { return &TestVectorString{} },
		TestVectorStringObjectTypeID:       func() bin.Object { return &TestVectorStringObject{} },
		TestVectorBytesTypeID:              func() bin.Object { return &TestVectorBytes{} },
		TestVectorVectorTypeID:             func() bin.Object { return &TestVectorVector{} },
		ClientDHInnerDataTypeID:            func() bin.Object { return &ClientDHInnerData{} },
		DCOptionTypeID:                     func() bin.Object { return &DCOption{} },
		ConfigTypeID:                       func() bin.Object { return &Config{} },
		InvokeWithLayerTypeID:              func() bin.Object { return &InvokeWithLayer{} },
		AuthTypeID:                         func() bin.Object { return &Auth{} },
		AuthPasswordTypeID:                 func() bin.Object { return &AuthPassword{} },
		UserAuthTypeID:                     func() bin.Object { return &UserAuth{} },
		UserAuthPasswordTypeID:             func() bin.Object { return &UserAuthPassword{} },
		ThemeTypeID:                        func() bin.Object { return &Theme{} },
		AccountThemesNotModifiedTypeID:     func() bin.Object { return &AccountThemesNotModified{} },
		AccountThemesTypeID:                func() bin.Object { return &AccountThemes{} },
		PingRequestTypeID:                  func() bin.Object { return &PingRequest{} },
		SendRequestTypeID:                  func() bin.Object { return &SendRequest{} },
		SendMultipleSMSRequestTypeID:       func() bin.Object { return &SendMultipleSMSRequest{} },
		DoAuthRequestTypeID:                func() bin.Object { return &DoAuthRequest{} },
		EchoVectorRequestTypeID:            func() bin.Object { return &EchoVectorRequest{} },
	}
}

// ClassConstructorsMap maps class schema name to constructors type ids.
func ClassConstructorsMap() map[string][]uint32 {
	return map[string][]uint32{
		AbstractMessageClassName: {
			BigMessageTypeID,
			NoMessageTypeID,
			TargetsMessageTypeID,
			FieldsMessageTypeID,
			BytesMessageTypeID,
		},
		AccountThemesClassName: {
			AccountThemesNotModifiedTypeID,
			AccountThemesTypeID,
		},
		AuthClassName: {
			AuthTypeID,
			AuthPasswordTypeID,
		},
		BoolClassName: {
			FalseTypeID,
			TrueTypeID,
		},
		ResponseClassName: {
			ResponseIDTypeID,
			ResponseTextTypeID,
		},
		TextEntityTypeClassName: {
			TextEntityTypeMentionTypeID,
			TextEntityTypeHashtagTypeID,
			TextEntityTypeCashtagTypeID,
			TextEntityTypeBotCommandTypeID,
			TextEntityTypeURLTypeID,
			TextEntityTypeEmailAddressTypeID,
			TextEntityTypePhoneNumberTypeID,
			TextEntityTypeBankCardNumberTypeID,
			TextEntityTypeBoldTypeID,
			TextEntityTypeItalicTypeID,
			TextEntityTypeUnderlineTypeID,
			TextEntityTypeStrikethroughTypeID,
			TextEntityTypeCodeTypeID,
			TextEntityTypePreTypeID,
			TextEntityTypePreCodeTypeID,
			TextEntityTypeTextURLTypeID,
			TextEntityTypeMentionNameTypeID,
		},
		UserAuthClassName: {
			UserAuthTypeID,
			UserAuthPasswordTypeID,
		},
	}
}
