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

// Config represents TL type `config#cc1a241e`.
// Current configuration
//
// See https://core.telegram.org/constructor/config for reference.
type Config struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the client should use P2P by default for phone calls with contacts
	DefaultP2PContacts bool
	// Whether the client should preload featured stickers
	PreloadFeaturedStickers bool
	// Whether incoming private messages can be deleted for both participants
	RevokePmInbox bool
	// Indicates that telegram is probably censored by governments/ISPs in the current region
	BlockedMode bool
	// Whether to forcefully connect using IPv6 dcOptions¹, even if the client knows that
	// IPv4 is available.
	//
	// Links:
	//  1) https://core.telegram.org/type/DcOption
	ForceTryIpv6 bool
	// Current date at the server
	Date int
	// Expiration date of this config: when it expires it'll have to be refetched using help
	// getConfig¹
	//
	// Links:
	//  1) https://core.telegram.org/method/help.getConfig
	Expires int
	// Whether we're connected to the test DCs
	TestMode bool
	// ID of the DC that returned the reply
	ThisDC int
	// DC IP list
	DCOptions []DCOption
	// Domain name for fetching encrypted DC list from DNS TXT record
	DCTxtDomainName string
	// Maximum member count for normal groups¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	ChatSizeMax int
	// Maximum member count for supergroups¹
	//
	// Links:
	//  1) https://core.telegram.org/api/channel
	MegagroupSizeMax int
	// Maximum number of messages that can be forwarded at once using messages
	// forwardMessages¹.
	//
	// Links:
	//  1) https://core.telegram.org/method/messages.forwardMessages
	ForwardedCountMax int
	// The client should update its online status¹ every N milliseconds
	//
	// Links:
	//  1) https://core.telegram.org/method/account.updateStatus
	OnlineUpdatePeriodMs int
	// Delay before offline status needs to be sent to the server
	OfflineBlurTimeoutMs int
	// Time without any user activity after which it should be treated offline
	OfflineIdleTimeoutMs int
	// If we are offline, but were online from some other client in last
	// online_cloud_timeout_ms milliseconds after we had gone offline, then delay offline
	// notification for notify_cloud_delay_ms milliseconds.
	OnlineCloudTimeoutMs int
	// If we are offline, but online from some other client then delay sending the offline
	// notification for notify_cloud_delay_ms milliseconds.
	NotifyCloudDelayMs int
	// If some other client is online, then delay notification for
	// notification_default_delay_ms milliseconds
	NotifyDefaultDelayMs int
	// Not for client use
	PushChatPeriodMs int
	// Not for client use
	PushChatLimit int
	// Only messages with age smaller than the one specified can be edited
	EditTimeLimit int
	// Only channel/supergroup messages with age smaller than the specified can be deleted
	RevokeTimeLimit int
	// Only private messages with age smaller than the specified can be deleted
	RevokePmTimeLimit int
	// Exponential decay rate for computing top peer rating¹
	//
	// Links:
	//  1) https://core.telegram.org/api/top-rating
	RatingEDecay int
	// Maximum number of recent stickers
	StickersRecentLimit int
	// Indicates that round videos (video notes) and voice messages sent in channels and
	// older than the specified period must be marked as read
	ChannelsReadMediaPeriod int
	// Temporary passport¹ sessions
	//
	// Links:
	//  1) https://core.telegram.org/passport
	//
	// Use SetTmpSessions and GetTmpSessions helpers.
	TmpSessions int
	// Maximum allowed outgoing ring time in VoIP calls: if the user we're calling doesn't
	// reply within the specified time (in milliseconds), we should hang up the call
	CallReceiveTimeoutMs int
	// Maximum allowed incoming ring time in VoIP calls: if the current user doesn't reply
	// within the specified time (in milliseconds), the call will be automatically refused
	CallRingTimeoutMs int
	// VoIP connection timeout: if the instance of libtgvoip on the other side of the call
	// doesn't connect to our instance of libtgvoip within the specified time (in
	// milliseconds), the call must be aborted
	CallConnectTimeoutMs int
	// If during a VoIP call a packet isn't received for the specified period of time, the
	// call must be aborted
	CallPacketTimeoutMs int
	// The domain to use to parse deep links »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links
	MeURLPrefix string
	// URL to use to auto-update the current app
	//
	// Use SetAutoupdateURLPrefix and GetAutoupdateURLPrefix helpers.
	AutoupdateURLPrefix string
	// Username of the bot to use to search for GIFs
	//
	// Use SetGifSearchUsername and GetGifSearchUsername helpers.
	GifSearchUsername string
	// Username of the bot to use to search for venues
	//
	// Use SetVenueSearchUsername and GetVenueSearchUsername helpers.
	VenueSearchUsername string
	// Username of the bot to use for image search
	//
	// Use SetImgSearchUsername and GetImgSearchUsername helpers.
	ImgSearchUsername string
	// ID of the map provider to use for venues
	//
	// Use SetStaticMapsProvider and GetStaticMapsProvider helpers.
	StaticMapsProvider string
	// Maximum length of caption (length in utf8 codepoints)
	CaptionLengthMax int
	// Maximum length of messages (length in utf8 codepoints)
	MessageLengthMax int
	// DC ID to use to download webfiles¹
	//
	// Links:
	//  1) https://core.telegram.org/api/files#downloading-webfiles
	WebfileDCID int
	// Suggested language code
	//
	// Use SetSuggestedLangCode and GetSuggestedLangCode helpers.
	SuggestedLangCode string
	// Language pack version
	//
	// Use SetLangPackVersion and GetLangPackVersion helpers.
	LangPackVersion int
	// Basic language pack version
	//
	// Use SetBaseLangPackVersion and GetBaseLangPackVersion helpers.
	BaseLangPackVersion int
	// Default message reaction¹
	//
	// Links:
	//  1) https://core.telegram.org/api/reactions
	//
	// Use SetReactionsDefault and GetReactionsDefault helpers.
	ReactionsDefault ReactionClass
	// Autologin token, click here for more info on URL authorization »¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/url-authorization#link-url-authorization
	//
	// Use SetAutologinToken and GetAutologinToken helpers.
	AutologinToken string
}

// ConfigTypeID is TL type id of Config.
const ConfigTypeID = 0xcc1a241e

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

func ( *Config) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.DefaultP2PContacts == false) {
		return false
	}
	if !(.PreloadFeaturedStickers == false) {
		return false
	}
	if !(.RevokePmInbox == false) {
		return false
	}
	if !(.BlockedMode == false) {
		return false
	}
	if !(.ForceTryIpv6 == false) {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Expires == 0) {
		return false
	}
	if !(.TestMode == false) {
		return false
	}
	if !(.ThisDC == 0) {
		return false
	}
	if !(.DCOptions == nil) {
		return false
	}
	if !(.DCTxtDomainName == "") {
		return false
	}
	if !(.ChatSizeMax == 0) {
		return false
	}
	if !(.MegagroupSizeMax == 0) {
		return false
	}
	if !(.ForwardedCountMax == 0) {
		return false
	}
	if !(.OnlineUpdatePeriodMs == 0) {
		return false
	}
	if !(.OfflineBlurTimeoutMs == 0) {
		return false
	}
	if !(.OfflineIdleTimeoutMs == 0) {
		return false
	}
	if !(.OnlineCloudTimeoutMs == 0) {
		return false
	}
	if !(.NotifyCloudDelayMs == 0) {
		return false
	}
	if !(.NotifyDefaultDelayMs == 0) {
		return false
	}
	if !(.PushChatPeriodMs == 0) {
		return false
	}
	if !(.PushChatLimit == 0) {
		return false
	}
	if !(.EditTimeLimit == 0) {
		return false
	}
	if !(.RevokeTimeLimit == 0) {
		return false
	}
	if !(.RevokePmTimeLimit == 0) {
		return false
	}
	if !(.RatingEDecay == 0) {
		return false
	}
	if !(.StickersRecentLimit == 0) {
		return false
	}
	if !(.ChannelsReadMediaPeriod == 0) {
		return false
	}
	if !(.TmpSessions == 0) {
		return false
	}
	if !(.CallReceiveTimeoutMs == 0) {
		return false
	}
	if !(.CallRingTimeoutMs == 0) {
		return false
	}
	if !(.CallConnectTimeoutMs == 0) {
		return false
	}
	if !(.CallPacketTimeoutMs == 0) {
		return false
	}
	if !(.MeURLPrefix == "") {
		return false
	}
	if !(.AutoupdateURLPrefix == "") {
		return false
	}
	if !(.GifSearchUsername == "") {
		return false
	}
	if !(.VenueSearchUsername == "") {
		return false
	}
	if !(.ImgSearchUsername == "") {
		return false
	}
	if !(.StaticMapsProvider == "") {
		return false
	}
	if !(.CaptionLengthMax == 0) {
		return false
	}
	if !(.MessageLengthMax == 0) {
		return false
	}
	if !(.WebfileDCID == 0) {
		return false
	}
	if !(.SuggestedLangCode == "") {
		return false
	}
	if !(.LangPackVersion == 0) {
		return false
	}
	if !(.BaseLangPackVersion == 0) {
		return false
	}
	if !(.ReactionsDefault == nil) {
		return false
	}
	if !(.AutologinToken == "") {
		return false
	}

	return true
}

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

// FillFrom fills Config from given interface.
func ( *Config) ( interface {
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( bool)
	() ( int)
	() ( int)
	() ( bool)
	() ( int)
	() ( []DCOption)
	() ( string)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( int,  bool)
	() ( int)
	() ( int)
	() ( int)
	() ( int)
	() ( string)
	() ( string,  bool)
	() ( string,  bool)
	() ( string,  bool)
	() ( string,  bool)
	() ( string,  bool)
	() ( int)
	() ( int)
	() ( int)
	() ( string,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( ReactionClass,  bool)
	() ( string,  bool)
}) {
	.DefaultP2PContacts = .()
	.PreloadFeaturedStickers = .()
	.RevokePmInbox = .()
	.BlockedMode = .()
	.ForceTryIpv6 = .()
	.Date = .()
	.Expires = .()
	.TestMode = .()
	.ThisDC = .()
	.DCOptions = .()
	.DCTxtDomainName = .()
	.ChatSizeMax = .()
	.MegagroupSizeMax = .()
	.ForwardedCountMax = .()
	.OnlineUpdatePeriodMs = .()
	.OfflineBlurTimeoutMs = .()
	.OfflineIdleTimeoutMs = .()
	.OnlineCloudTimeoutMs = .()
	.NotifyCloudDelayMs = .()
	.NotifyDefaultDelayMs = .()
	.PushChatPeriodMs = .()
	.PushChatLimit = .()
	.EditTimeLimit = .()
	.RevokeTimeLimit = .()
	.RevokePmTimeLimit = .()
	.RatingEDecay = .()
	.StickersRecentLimit = .()
	.ChannelsReadMediaPeriod = .()
	if ,  := .();  {
		.TmpSessions = 
	}

	.CallReceiveTimeoutMs = .()
	.CallRingTimeoutMs = .()
	.CallConnectTimeoutMs = .()
	.CallPacketTimeoutMs = .()
	.MeURLPrefix = .()
	if ,  := .();  {
		.AutoupdateURLPrefix = 
	}

	if ,  := .();  {
		.GifSearchUsername = 
	}

	if ,  := .();  {
		.VenueSearchUsername = 
	}

	if ,  := .();  {
		.ImgSearchUsername = 
	}

	if ,  := .();  {
		.StaticMapsProvider = 
	}

	.CaptionLengthMax = .()
	.MessageLengthMax = .()
	.WebfileDCID = .()
	if ,  := .();  {
		.SuggestedLangCode = 
	}

	if ,  := .();  {
		.LangPackVersion = 
	}

	if ,  := .();  {
		.BaseLangPackVersion = 
	}

	if ,  := .();  {
		.ReactionsDefault = 
	}

	if ,  := .();  {
		.AutologinToken = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *Config) () tdp.Type {
	 := tdp.Type{
		Name: "config",
		ID:   ConfigTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "DefaultP2PContacts",
			SchemaName: "default_p2p_contacts",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "PreloadFeaturedStickers",
			SchemaName: "preload_featured_stickers",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "RevokePmInbox",
			SchemaName: "revoke_pm_inbox",
			Null:       !.Flags.Has(6),
		},
		{
			Name:       "BlockedMode",
			SchemaName: "blocked_mode",
			Null:       !.Flags.Has(8),
		},
		{
			Name:       "ForceTryIpv6",
			SchemaName: "force_try_ipv6",
			Null:       !.Flags.Has(14),
		},
		{
			Name:       "Date",
			SchemaName: "date",
		},
		{
			Name:       "Expires",
			SchemaName: "expires",
		},
		{
			Name:       "TestMode",
			SchemaName: "test_mode",
		},
		{
			Name:       "ThisDC",
			SchemaName: "this_dc",
		},
		{
			Name:       "DCOptions",
			SchemaName: "dc_options",
		},
		{
			Name:       "DCTxtDomainName",
			SchemaName: "dc_txt_domain_name",
		},
		{
			Name:       "ChatSizeMax",
			SchemaName: "chat_size_max",
		},
		{
			Name:       "MegagroupSizeMax",
			SchemaName: "megagroup_size_max",
		},
		{
			Name:       "ForwardedCountMax",
			SchemaName: "forwarded_count_max",
		},
		{
			Name:       "OnlineUpdatePeriodMs",
			SchemaName: "online_update_period_ms",
		},
		{
			Name:       "OfflineBlurTimeoutMs",
			SchemaName: "offline_blur_timeout_ms",
		},
		{
			Name:       "OfflineIdleTimeoutMs",
			SchemaName: "offline_idle_timeout_ms",
		},
		{
			Name:       "OnlineCloudTimeoutMs",
			SchemaName: "online_cloud_timeout_ms",
		},
		{
			Name:       "NotifyCloudDelayMs",
			SchemaName: "notify_cloud_delay_ms",
		},
		{
			Name:       "NotifyDefaultDelayMs",
			SchemaName: "notify_default_delay_ms",
		},
		{
			Name:       "PushChatPeriodMs",
			SchemaName: "push_chat_period_ms",
		},
		{
			Name:       "PushChatLimit",
			SchemaName: "push_chat_limit",
		},
		{
			Name:       "EditTimeLimit",
			SchemaName: "edit_time_limit",
		},
		{
			Name:       "RevokeTimeLimit",
			SchemaName: "revoke_time_limit",
		},
		{
			Name:       "RevokePmTimeLimit",
			SchemaName: "revoke_pm_time_limit",
		},
		{
			Name:       "RatingEDecay",
			SchemaName: "rating_e_decay",
		},
		{
			Name:       "StickersRecentLimit",
			SchemaName: "stickers_recent_limit",
		},
		{
			Name:       "ChannelsReadMediaPeriod",
			SchemaName: "channels_read_media_period",
		},
		{
			Name:       "TmpSessions",
			SchemaName: "tmp_sessions",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "CallReceiveTimeoutMs",
			SchemaName: "call_receive_timeout_ms",
		},
		{
			Name:       "CallRingTimeoutMs",
			SchemaName: "call_ring_timeout_ms",
		},
		{
			Name:       "CallConnectTimeoutMs",
			SchemaName: "call_connect_timeout_ms",
		},
		{
			Name:       "CallPacketTimeoutMs",
			SchemaName: "call_packet_timeout_ms",
		},
		{
			Name:       "MeURLPrefix",
			SchemaName: "me_url_prefix",
		},
		{
			Name:       "AutoupdateURLPrefix",
			SchemaName: "autoupdate_url_prefix",
			Null:       !.Flags.Has(7),
		},
		{
			Name:       "GifSearchUsername",
			SchemaName: "gif_search_username",
			Null:       !.Flags.Has(9),
		},
		{
			Name:       "VenueSearchUsername",
			SchemaName: "venue_search_username",
			Null:       !.Flags.Has(10),
		},
		{
			Name:       "ImgSearchUsername",
			SchemaName: "img_search_username",
			Null:       !.Flags.Has(11),
		},
		{
			Name:       "StaticMapsProvider",
			SchemaName: "static_maps_provider",
			Null:       !.Flags.Has(12),
		},
		{
			Name:       "CaptionLengthMax",
			SchemaName: "caption_length_max",
		},
		{
			Name:       "MessageLengthMax",
			SchemaName: "message_length_max",
		},
		{
			Name:       "WebfileDCID",
			SchemaName: "webfile_dc_id",
		},
		{
			Name:       "SuggestedLangCode",
			SchemaName: "suggested_lang_code",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "LangPackVersion",
			SchemaName: "lang_pack_version",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "BaseLangPackVersion",
			SchemaName: "base_lang_pack_version",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "ReactionsDefault",
			SchemaName: "reactions_default",
			Null:       !.Flags.Has(15),
		},
		{
			Name:       "AutologinToken",
			SchemaName: "autologin_token",
			Null:       !.Flags.Has(16),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *Config) () {
	if !(.DefaultP2PContacts == false) {
		.Flags.Set(3)
	}
	if !(.PreloadFeaturedStickers == false) {
		.Flags.Set(4)
	}
	if !(.RevokePmInbox == false) {
		.Flags.Set(6)
	}
	if !(.BlockedMode == false) {
		.Flags.Set(8)
	}
	if !(.ForceTryIpv6 == false) {
		.Flags.Set(14)
	}
	if !(.TmpSessions == 0) {
		.Flags.Set(0)
	}
	if !(.AutoupdateURLPrefix == "") {
		.Flags.Set(7)
	}
	if !(.GifSearchUsername == "") {
		.Flags.Set(9)
	}
	if !(.VenueSearchUsername == "") {
		.Flags.Set(10)
	}
	if !(.ImgSearchUsername == "") {
		.Flags.Set(11)
	}
	if !(.StaticMapsProvider == "") {
		.Flags.Set(12)
	}
	if !(.SuggestedLangCode == "") {
		.Flags.Set(2)
	}
	if !(.LangPackVersion == 0) {
		.Flags.Set(2)
	}
	if !(.BaseLangPackVersion == 0) {
		.Flags.Set(2)
	}
	if !(.ReactionsDefault == nil) {
		.Flags.Set(15)
	}
	if !(.AutologinToken == "") {
		.Flags.Set(16)
	}
}

// Encode implements bin.Encoder.
func ( *Config) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode config#cc1a241e as nil")
	}
	.PutID(ConfigTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *Config) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode config#cc1a241e as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode config#cc1a241e: field flags: %w", )
	}
	.PutInt(.Date)
	.PutInt(.Expires)
	.PutBool(.TestMode)
	.PutInt(.ThisDC)
	.PutVectorHeader(len(.DCOptions))
	for ,  := range .DCOptions {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode config#cc1a241e: field dc_options element with index %d: %w", , )
		}
	}
	.PutString(.DCTxtDomainName)
	.PutInt(.ChatSizeMax)
	.PutInt(.MegagroupSizeMax)
	.PutInt(.ForwardedCountMax)
	.PutInt(.OnlineUpdatePeriodMs)
	.PutInt(.OfflineBlurTimeoutMs)
	.PutInt(.OfflineIdleTimeoutMs)
	.PutInt(.OnlineCloudTimeoutMs)
	.PutInt(.NotifyCloudDelayMs)
	.PutInt(.NotifyDefaultDelayMs)
	.PutInt(.PushChatPeriodMs)
	.PutInt(.PushChatLimit)
	.PutInt(.EditTimeLimit)
	.PutInt(.RevokeTimeLimit)
	.PutInt(.RevokePmTimeLimit)
	.PutInt(.RatingEDecay)
	.PutInt(.StickersRecentLimit)
	.PutInt(.ChannelsReadMediaPeriod)
	if .Flags.Has(0) {
		.PutInt(.TmpSessions)
	}
	.PutInt(.CallReceiveTimeoutMs)
	.PutInt(.CallRingTimeoutMs)
	.PutInt(.CallConnectTimeoutMs)
	.PutInt(.CallPacketTimeoutMs)
	.PutString(.MeURLPrefix)
	if .Flags.Has(7) {
		.PutString(.AutoupdateURLPrefix)
	}
	if .Flags.Has(9) {
		.PutString(.GifSearchUsername)
	}
	if .Flags.Has(10) {
		.PutString(.VenueSearchUsername)
	}
	if .Flags.Has(11) {
		.PutString(.ImgSearchUsername)
	}
	if .Flags.Has(12) {
		.PutString(.StaticMapsProvider)
	}
	.PutInt(.CaptionLengthMax)
	.PutInt(.MessageLengthMax)
	.PutInt(.WebfileDCID)
	if .Flags.Has(2) {
		.PutString(.SuggestedLangCode)
	}
	if .Flags.Has(2) {
		.PutInt(.LangPackVersion)
	}
	if .Flags.Has(2) {
		.PutInt(.BaseLangPackVersion)
	}
	if .Flags.Has(15) {
		if .ReactionsDefault == nil {
			return fmt.Errorf("unable to encode config#cc1a241e: field reactions_default is nil")
		}
		if  := .ReactionsDefault.Encode();  != nil {
			return fmt.Errorf("unable to encode config#cc1a241e: field reactions_default: %w", )
		}
	}
	if .Flags.Has(16) {
		.PutString(.AutologinToken)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *Config) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode config#cc1a241e to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field flags: %w", )
		}
	}
	.DefaultP2PContacts = .Flags.Has(3)
	.PreloadFeaturedStickers = .Flags.Has(4)
	.RevokePmInbox = .Flags.Has(6)
	.BlockedMode = .Flags.Has(8)
	.ForceTryIpv6 = .Flags.Has(14)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field expires: %w", )
		}
		.Expires = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field test_mode: %w", )
		}
		.TestMode = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field this_dc: %w", )
		}
		.ThisDC = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field dc_options: %w", )
		}

		if  > 0 {
			.DCOptions = make([]DCOption, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  DCOption
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode config#cc1a241e: field dc_options: %w", )
			}
			.DCOptions = append(.DCOptions, )
		}
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field dc_txt_domain_name: %w", )
		}
		.DCTxtDomainName = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field chat_size_max: %w", )
		}
		.ChatSizeMax = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field megagroup_size_max: %w", )
		}
		.MegagroupSizeMax = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field forwarded_count_max: %w", )
		}
		.ForwardedCountMax = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field online_update_period_ms: %w", )
		}
		.OnlineUpdatePeriodMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field offline_blur_timeout_ms: %w", )
		}
		.OfflineBlurTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field offline_idle_timeout_ms: %w", )
		}
		.OfflineIdleTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field online_cloud_timeout_ms: %w", )
		}
		.OnlineCloudTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field notify_cloud_delay_ms: %w", )
		}
		.NotifyCloudDelayMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field notify_default_delay_ms: %w", )
		}
		.NotifyDefaultDelayMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field push_chat_period_ms: %w", )
		}
		.PushChatPeriodMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field push_chat_limit: %w", )
		}
		.PushChatLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field edit_time_limit: %w", )
		}
		.EditTimeLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field revoke_time_limit: %w", )
		}
		.RevokeTimeLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field revoke_pm_time_limit: %w", )
		}
		.RevokePmTimeLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field rating_e_decay: %w", )
		}
		.RatingEDecay = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field stickers_recent_limit: %w", )
		}
		.StickersRecentLimit = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field channels_read_media_period: %w", )
		}
		.ChannelsReadMediaPeriod = 
	}
	if .Flags.Has(0) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field tmp_sessions: %w", )
		}
		.TmpSessions = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field call_receive_timeout_ms: %w", )
		}
		.CallReceiveTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field call_ring_timeout_ms: %w", )
		}
		.CallRingTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field call_connect_timeout_ms: %w", )
		}
		.CallConnectTimeoutMs = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field call_packet_timeout_ms: %w", )
		}
		.CallPacketTimeoutMs = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field me_url_prefix: %w", )
		}
		.MeURLPrefix = 
	}
	if .Flags.Has(7) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field autoupdate_url_prefix: %w", )
		}
		.AutoupdateURLPrefix = 
	}
	if .Flags.Has(9) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field gif_search_username: %w", )
		}
		.GifSearchUsername = 
	}
	if .Flags.Has(10) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field venue_search_username: %w", )
		}
		.VenueSearchUsername = 
	}
	if .Flags.Has(11) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field img_search_username: %w", )
		}
		.ImgSearchUsername = 
	}
	if .Flags.Has(12) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field static_maps_provider: %w", )
		}
		.StaticMapsProvider = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field caption_length_max: %w", )
		}
		.CaptionLengthMax = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field message_length_max: %w", )
		}
		.MessageLengthMax = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field webfile_dc_id: %w", )
		}
		.WebfileDCID = 
	}
	if .Flags.Has(2) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field suggested_lang_code: %w", )
		}
		.SuggestedLangCode = 
	}
	if .Flags.Has(2) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field lang_pack_version: %w", )
		}
		.LangPackVersion = 
	}
	if .Flags.Has(2) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field base_lang_pack_version: %w", )
		}
		.BaseLangPackVersion = 
	}
	if .Flags.Has(15) {
		,  := DecodeReaction()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field reactions_default: %w", )
		}
		.ReactionsDefault = 
	}
	if .Flags.Has(16) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode config#cc1a241e: field autologin_token: %w", )
		}
		.AutologinToken = 
	}
	return nil
}

// SetDefaultP2PContacts sets value of DefaultP2PContacts conditional field.
func ( *Config) ( bool) {
	if  {
		.Flags.Set(3)
		.DefaultP2PContacts = true
	} else {
		.Flags.Unset(3)
		.DefaultP2PContacts = false
	}
}

// GetDefaultP2PContacts returns value of DefaultP2PContacts conditional field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetPreloadFeaturedStickers sets value of PreloadFeaturedStickers conditional field.
func ( *Config) ( bool) {
	if  {
		.Flags.Set(4)
		.PreloadFeaturedStickers = true
	} else {
		.Flags.Unset(4)
		.PreloadFeaturedStickers = false
	}
}

// GetPreloadFeaturedStickers returns value of PreloadFeaturedStickers conditional field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(4)
}

// SetRevokePmInbox sets value of RevokePmInbox conditional field.
func ( *Config) ( bool) {
	if  {
		.Flags.Set(6)
		.RevokePmInbox = true
	} else {
		.Flags.Unset(6)
		.RevokePmInbox = false
	}
}

// GetRevokePmInbox returns value of RevokePmInbox conditional field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(6)
}

// SetBlockedMode sets value of BlockedMode conditional field.
func ( *Config) ( bool) {
	if  {
		.Flags.Set(8)
		.BlockedMode = true
	} else {
		.Flags.Unset(8)
		.BlockedMode = false
	}
}

// GetBlockedMode returns value of BlockedMode conditional field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(8)
}

// SetForceTryIpv6 sets value of ForceTryIpv6 conditional field.
func ( *Config) ( bool) {
	if  {
		.Flags.Set(14)
		.ForceTryIpv6 = true
	} else {
		.Flags.Unset(14)
		.ForceTryIpv6 = false
	}
}

// GetForceTryIpv6 returns value of ForceTryIpv6 conditional field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(14)
}

// GetDate returns value of Date field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .Date
}

// GetExpires returns value of Expires field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .Expires
}

// GetTestMode returns value of TestMode field.
func ( *Config) () ( bool) {
	if  == nil {
		return
	}
	return .TestMode
}

// GetThisDC returns value of ThisDC field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .ThisDC
}

// GetDCOptions returns value of DCOptions field.
func ( *Config) () ( []DCOption) {
	if  == nil {
		return
	}
	return .DCOptions
}

// GetDCTxtDomainName returns value of DCTxtDomainName field.
func ( *Config) () ( string) {
	if  == nil {
		return
	}
	return .DCTxtDomainName
}

// GetChatSizeMax returns value of ChatSizeMax field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .ChatSizeMax
}

// GetMegagroupSizeMax returns value of MegagroupSizeMax field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .MegagroupSizeMax
}

// GetForwardedCountMax returns value of ForwardedCountMax field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .ForwardedCountMax
}

// GetOnlineUpdatePeriodMs returns value of OnlineUpdatePeriodMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .OnlineUpdatePeriodMs
}

// GetOfflineBlurTimeoutMs returns value of OfflineBlurTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .OfflineBlurTimeoutMs
}

// GetOfflineIdleTimeoutMs returns value of OfflineIdleTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .OfflineIdleTimeoutMs
}

// GetOnlineCloudTimeoutMs returns value of OnlineCloudTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .OnlineCloudTimeoutMs
}

// GetNotifyCloudDelayMs returns value of NotifyCloudDelayMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .NotifyCloudDelayMs
}

// GetNotifyDefaultDelayMs returns value of NotifyDefaultDelayMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .NotifyDefaultDelayMs
}

// GetPushChatPeriodMs returns value of PushChatPeriodMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .PushChatPeriodMs
}

// GetPushChatLimit returns value of PushChatLimit field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .PushChatLimit
}

// GetEditTimeLimit returns value of EditTimeLimit field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .EditTimeLimit
}

// GetRevokeTimeLimit returns value of RevokeTimeLimit field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .RevokeTimeLimit
}

// GetRevokePmTimeLimit returns value of RevokePmTimeLimit field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .RevokePmTimeLimit
}

// GetRatingEDecay returns value of RatingEDecay field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .RatingEDecay
}

// GetStickersRecentLimit returns value of StickersRecentLimit field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .StickersRecentLimit
}

// GetChannelsReadMediaPeriod returns value of ChannelsReadMediaPeriod field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .ChannelsReadMediaPeriod
}

// SetTmpSessions sets value of TmpSessions conditional field.
func ( *Config) ( int) {
	.Flags.Set(0)
	.TmpSessions = 
}

// GetTmpSessions returns value of TmpSessions conditional field and
// boolean which is true if field was set.
func ( *Config) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .TmpSessions, true
}

// GetCallReceiveTimeoutMs returns value of CallReceiveTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .CallReceiveTimeoutMs
}

// GetCallRingTimeoutMs returns value of CallRingTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .CallRingTimeoutMs
}

// GetCallConnectTimeoutMs returns value of CallConnectTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .CallConnectTimeoutMs
}

// GetCallPacketTimeoutMs returns value of CallPacketTimeoutMs field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .CallPacketTimeoutMs
}

// GetMeURLPrefix returns value of MeURLPrefix field.
func ( *Config) () ( string) {
	if  == nil {
		return
	}
	return .MeURLPrefix
}

// SetAutoupdateURLPrefix sets value of AutoupdateURLPrefix conditional field.
func ( *Config) ( string) {
	.Flags.Set(7)
	.AutoupdateURLPrefix = 
}

// GetAutoupdateURLPrefix returns value of AutoupdateURLPrefix conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(7) {
		return , false
	}
	return .AutoupdateURLPrefix, true
}

// SetGifSearchUsername sets value of GifSearchUsername conditional field.
func ( *Config) ( string) {
	.Flags.Set(9)
	.GifSearchUsername = 
}

// GetGifSearchUsername returns value of GifSearchUsername conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(9) {
		return , false
	}
	return .GifSearchUsername, true
}

// SetVenueSearchUsername sets value of VenueSearchUsername conditional field.
func ( *Config) ( string) {
	.Flags.Set(10)
	.VenueSearchUsername = 
}

// GetVenueSearchUsername returns value of VenueSearchUsername conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(10) {
		return , false
	}
	return .VenueSearchUsername, true
}

// SetImgSearchUsername sets value of ImgSearchUsername conditional field.
func ( *Config) ( string) {
	.Flags.Set(11)
	.ImgSearchUsername = 
}

// GetImgSearchUsername returns value of ImgSearchUsername conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(11) {
		return , false
	}
	return .ImgSearchUsername, true
}

// SetStaticMapsProvider sets value of StaticMapsProvider conditional field.
func ( *Config) ( string) {
	.Flags.Set(12)
	.StaticMapsProvider = 
}

// GetStaticMapsProvider returns value of StaticMapsProvider conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(12) {
		return , false
	}
	return .StaticMapsProvider, true
}

// GetCaptionLengthMax returns value of CaptionLengthMax field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .CaptionLengthMax
}

// GetMessageLengthMax returns value of MessageLengthMax field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .MessageLengthMax
}

// GetWebfileDCID returns value of WebfileDCID field.
func ( *Config) () ( int) {
	if  == nil {
		return
	}
	return .WebfileDCID
}

// SetSuggestedLangCode sets value of SuggestedLangCode conditional field.
func ( *Config) ( string) {
	.Flags.Set(2)
	.SuggestedLangCode = 
}

// GetSuggestedLangCode returns value of SuggestedLangCode conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .SuggestedLangCode, true
}

// SetLangPackVersion sets value of LangPackVersion conditional field.
func ( *Config) ( int) {
	.Flags.Set(2)
	.LangPackVersion = 
}

// GetLangPackVersion returns value of LangPackVersion conditional field and
// boolean which is true if field was set.
func ( *Config) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .LangPackVersion, true
}

// SetBaseLangPackVersion sets value of BaseLangPackVersion conditional field.
func ( *Config) ( int) {
	.Flags.Set(2)
	.BaseLangPackVersion = 
}

// GetBaseLangPackVersion returns value of BaseLangPackVersion conditional field and
// boolean which is true if field was set.
func ( *Config) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .BaseLangPackVersion, true
}

// SetReactionsDefault sets value of ReactionsDefault conditional field.
func ( *Config) ( ReactionClass) {
	.Flags.Set(15)
	.ReactionsDefault = 
}

// GetReactionsDefault returns value of ReactionsDefault conditional field and
// boolean which is true if field was set.
func ( *Config) () ( ReactionClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(15) {
		return , false
	}
	return .ReactionsDefault, true
}

// SetAutologinToken sets value of AutologinToken conditional field.
func ( *Config) ( string) {
	.Flags.Set(16)
	.AutologinToken = 
}

// GetAutologinToken returns value of AutologinToken conditional field and
// boolean which is true if field was set.
func ( *Config) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(16) {
		return , false
	}
	return .AutologinToken, true
}