From 423d5bc8e0956a06526c8a52e725afab62059198 Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 15 Mar 2022 07:44:30 +0000 Subject: [PATCH] feat(schema): update TDLib to the latest layer --- _schema/tdapi.tl | 8 +- tdapi/tl_internal_link_type_gen.go | 292 +++++++++++++++++++++++++++++ tdapi/tl_registry_gen.go | 8 + 3 files changed, 307 insertions(+), 1 deletion(-) diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index 2442d51abb..b684d07bbe 100644 --- a/_schema/tdapi.tl +++ b/_schema/tdapi.tl @@ -1,7 +1,7 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/td_api.tl -// SHA256: 1faa140515f06a6e321c0f201315130eb1510cc62c478121b8368ea9309c73fc +// SHA256: f8442005f91b925bb51f9fbcea29a1e27a03455df6d99eff4ee7d8c040422eae double#2210c154 ? = Double; @@ -4158,6 +4158,9 @@ internalLinkTypeGame#f074adcd bot_username:string game_short_name:string = Inter //@language_pack_id Language pack identifier internalLinkTypeLanguagePack#a9870d6c language_pack_id:string = InternalLinkType; +//@description The link is a link to the language settings section of the app +internalLinkTypeLanguageSettings#b019e6e6 = InternalLinkType; + //@description The link is a link to a Telegram message. Call getMessageLinkInfo with the given URL to process the link //@url URL to be passed to getMessageLinkInfo internalLinkTypeMessage#3a535c52 url:string = InternalLinkType; @@ -4180,6 +4183,9 @@ internalLinkTypePassportDataRequest#c50fce81 bot_user_id:int53 scope:string publ //@phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation#68bf6b16 hash:string phone_number:string = InternalLinkType; +//@description The link is a link to the privacy and security settings section of the app +internalLinkTypePrivacyAndSecuritySettings#ad5f6acf = InternalLinkType; + //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy //@server Proxy server IP address //@port Proxy server port diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index 459d2847f3..2e56231bcf 100644 --- a/tdapi/tl_internal_link_type_gen.go +++ b/tdapi/tl_internal_link_type_gen.go @@ -1688,6 +1688,137 @@ func (i *InternalLinkTypeLanguagePack) GetLanguagePackID() (value string) { return i.LanguagePackID } +// InternalLinkTypeLanguageSettings represents TL type `internalLinkTypeLanguageSettings#b019e6e6`. +type InternalLinkTypeLanguageSettings struct { +} + +// InternalLinkTypeLanguageSettingsTypeID is TL type id of InternalLinkTypeLanguageSettings. +const InternalLinkTypeLanguageSettingsTypeID = 0xb019e6e6 + +// construct implements constructor of InternalLinkTypeClass. +func (i InternalLinkTypeLanguageSettings) construct() InternalLinkTypeClass { return &i } + +// Ensuring interfaces in compile-time for InternalLinkTypeLanguageSettings. +var ( + _ bin.Encoder = &InternalLinkTypeLanguageSettings{} + _ bin.Decoder = &InternalLinkTypeLanguageSettings{} + _ bin.BareEncoder = &InternalLinkTypeLanguageSettings{} + _ bin.BareDecoder = &InternalLinkTypeLanguageSettings{} + + _ InternalLinkTypeClass = &InternalLinkTypeLanguageSettings{} +) + +func (i *InternalLinkTypeLanguageSettings) Zero() bool { + if i == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (i *InternalLinkTypeLanguageSettings) String() string { + if i == nil { + return "InternalLinkTypeLanguageSettings(nil)" + } + type Alias InternalLinkTypeLanguageSettings + return fmt.Sprintf("InternalLinkTypeLanguageSettings%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InternalLinkTypeLanguageSettings) TypeID() uint32 { + return InternalLinkTypeLanguageSettingsTypeID +} + +// TypeName returns name of type in TL schema. +func (*InternalLinkTypeLanguageSettings) TypeName() string { + return "internalLinkTypeLanguageSettings" +} + +// TypeInfo returns info about TL type. +func (i *InternalLinkTypeLanguageSettings) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "internalLinkTypeLanguageSettings", + ID: InternalLinkTypeLanguageSettingsTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (i *InternalLinkTypeLanguageSettings) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypeLanguageSettings#b019e6e6 as nil") + } + b.PutID(InternalLinkTypeLanguageSettingsTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InternalLinkTypeLanguageSettings) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypeLanguageSettings#b019e6e6 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InternalLinkTypeLanguageSettings) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypeLanguageSettings#b019e6e6 to nil") + } + if err := b.ConsumeID(InternalLinkTypeLanguageSettingsTypeID); err != nil { + return fmt.Errorf("unable to decode internalLinkTypeLanguageSettings#b019e6e6: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InternalLinkTypeLanguageSettings) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypeLanguageSettings#b019e6e6 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InternalLinkTypeLanguageSettings) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypeLanguageSettings#b019e6e6 as nil") + } + b.ObjStart() + b.PutID("internalLinkTypeLanguageSettings") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InternalLinkTypeLanguageSettings) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypeLanguageSettings#b019e6e6 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("internalLinkTypeLanguageSettings"); err != nil { + return fmt.Errorf("unable to decode internalLinkTypeLanguageSettings#b019e6e6: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // InternalLinkTypeMessage represents TL type `internalLinkTypeMessage#3a535c52`. type InternalLinkTypeMessage struct { // URL to be passed to getMessageLinkInfo @@ -2560,6 +2691,137 @@ func (i *InternalLinkTypePhoneNumberConfirmation) GetPhoneNumber() (value string return i.PhoneNumber } +// InternalLinkTypePrivacyAndSecuritySettings represents TL type `internalLinkTypePrivacyAndSecuritySettings#ad5f6acf`. +type InternalLinkTypePrivacyAndSecuritySettings struct { +} + +// InternalLinkTypePrivacyAndSecuritySettingsTypeID is TL type id of InternalLinkTypePrivacyAndSecuritySettings. +const InternalLinkTypePrivacyAndSecuritySettingsTypeID = 0xad5f6acf + +// construct implements constructor of InternalLinkTypeClass. +func (i InternalLinkTypePrivacyAndSecuritySettings) construct() InternalLinkTypeClass { return &i } + +// Ensuring interfaces in compile-time for InternalLinkTypePrivacyAndSecuritySettings. +var ( + _ bin.Encoder = &InternalLinkTypePrivacyAndSecuritySettings{} + _ bin.Decoder = &InternalLinkTypePrivacyAndSecuritySettings{} + _ bin.BareEncoder = &InternalLinkTypePrivacyAndSecuritySettings{} + _ bin.BareDecoder = &InternalLinkTypePrivacyAndSecuritySettings{} + + _ InternalLinkTypeClass = &InternalLinkTypePrivacyAndSecuritySettings{} +) + +func (i *InternalLinkTypePrivacyAndSecuritySettings) Zero() bool { + if i == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (i *InternalLinkTypePrivacyAndSecuritySettings) String() string { + if i == nil { + return "InternalLinkTypePrivacyAndSecuritySettings(nil)" + } + type Alias InternalLinkTypePrivacyAndSecuritySettings + return fmt.Sprintf("InternalLinkTypePrivacyAndSecuritySettings%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InternalLinkTypePrivacyAndSecuritySettings) TypeID() uint32 { + return InternalLinkTypePrivacyAndSecuritySettingsTypeID +} + +// TypeName returns name of type in TL schema. +func (*InternalLinkTypePrivacyAndSecuritySettings) TypeName() string { + return "internalLinkTypePrivacyAndSecuritySettings" +} + +// TypeInfo returns info about TL type. +func (i *InternalLinkTypePrivacyAndSecuritySettings) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "internalLinkTypePrivacyAndSecuritySettings", + ID: InternalLinkTypePrivacyAndSecuritySettingsTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf as nil") + } + b.PutID(InternalLinkTypePrivacyAndSecuritySettingsTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf to nil") + } + if err := b.ConsumeID(InternalLinkTypePrivacyAndSecuritySettingsTypeID); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf as nil") + } + b.ObjStart() + b.PutID("internalLinkTypePrivacyAndSecuritySettings") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InternalLinkTypePrivacyAndSecuritySettings) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("internalLinkTypePrivacyAndSecuritySettings"); err != nil { + return fmt.Errorf("unable to decode internalLinkTypePrivacyAndSecuritySettings#ad5f6acf: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // InternalLinkTypeProxy represents TL type `internalLinkTypeProxy#b1b12cea`. type InternalLinkTypeProxy struct { // Proxy server IP address @@ -4415,10 +4677,12 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeFilterSettings: // internalLinkTypeFilterSettings#5981179b // case *tdapi.InternalLinkTypeGame: // internalLinkTypeGame#f074adcd // case *tdapi.InternalLinkTypeLanguagePack: // internalLinkTypeLanguagePack#a9870d6c +// case *tdapi.InternalLinkTypeLanguageSettings: // internalLinkTypeLanguageSettings#b019e6e6 // case *tdapi.InternalLinkTypeMessage: // internalLinkTypeMessage#3a535c52 // case *tdapi.InternalLinkTypeMessageDraft: // internalLinkTypeMessageDraft#276fbad5 // case *tdapi.InternalLinkTypePassportDataRequest: // internalLinkTypePassportDataRequest#c50fce81 // case *tdapi.InternalLinkTypePhoneNumberConfirmation: // internalLinkTypePhoneNumberConfirmation#68bf6b16 +// case *tdapi.InternalLinkTypePrivacyAndSecuritySettings: // internalLinkTypePrivacyAndSecuritySettings#ad5f6acf // case *tdapi.InternalLinkTypeProxy: // internalLinkTypeProxy#b1b12cea // case *tdapi.InternalLinkTypePublicChat: // internalLinkTypePublicChat#a774573b // case *tdapi.InternalLinkTypeQrCodeAuthentication: // internalLinkTypeQrCodeAuthentication#bf121924 @@ -4531,6 +4795,13 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case InternalLinkTypeLanguageSettingsTypeID: + // Decoding internalLinkTypeLanguageSettings#b019e6e6. + v := InternalLinkTypeLanguageSettings{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case InternalLinkTypeMessageTypeID: // Decoding internalLinkTypeMessage#3a535c52. v := InternalLinkTypeMessage{} @@ -4559,6 +4830,13 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case InternalLinkTypePrivacyAndSecuritySettingsTypeID: + // Decoding internalLinkTypePrivacyAndSecuritySettings#ad5f6acf. + v := InternalLinkTypePrivacyAndSecuritySettings{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case InternalLinkTypeProxyTypeID: // Decoding internalLinkTypeProxy#b1b12cea. v := InternalLinkTypeProxy{} @@ -4718,6 +4996,13 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case "internalLinkTypeLanguageSettings": + // Decoding internalLinkTypeLanguageSettings#b019e6e6. + v := InternalLinkTypeLanguageSettings{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case "internalLinkTypeMessage": // Decoding internalLinkTypeMessage#3a535c52. v := InternalLinkTypeMessage{} @@ -4746,6 +5031,13 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) } return &v, nil + case "internalLinkTypePrivacyAndSecuritySettings": + // Decoding internalLinkTypePrivacyAndSecuritySettings#ad5f6acf. + v := InternalLinkTypePrivacyAndSecuritySettings{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) + } + return &v, nil case "internalLinkTypeProxy": // Decoding internalLinkTypeProxy#b1b12cea. v := InternalLinkTypeProxy{} diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 5fc3d31fa4..c5983268cf 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -802,10 +802,12 @@ func TypesMap() map[uint32]string { InternalLinkTypeFilterSettingsTypeID: "internalLinkTypeFilterSettings#5981179b", InternalLinkTypeGameTypeID: "internalLinkTypeGame#f074adcd", InternalLinkTypeLanguagePackTypeID: "internalLinkTypeLanguagePack#a9870d6c", + InternalLinkTypeLanguageSettingsTypeID: "internalLinkTypeLanguageSettings#b019e6e6", InternalLinkTypeMessageTypeID: "internalLinkTypeMessage#3a535c52", InternalLinkTypeMessageDraftTypeID: "internalLinkTypeMessageDraft#276fbad5", InternalLinkTypePassportDataRequestTypeID: "internalLinkTypePassportDataRequest#c50fce81", InternalLinkTypePhoneNumberConfirmationTypeID: "internalLinkTypePhoneNumberConfirmation#68bf6b16", + InternalLinkTypePrivacyAndSecuritySettingsTypeID: "internalLinkTypePrivacyAndSecuritySettings#ad5f6acf", InternalLinkTypeProxyTypeID: "internalLinkTypeProxy#b1b12cea", InternalLinkTypePublicChatTypeID: "internalLinkTypePublicChat#a774573b", InternalLinkTypeQrCodeAuthenticationTypeID: "internalLinkTypeQrCodeAuthentication#bf121924", @@ -2277,10 +2279,12 @@ func NamesMap() map[string]uint32 { "internalLinkTypeFilterSettings": InternalLinkTypeFilterSettingsTypeID, "internalLinkTypeGame": InternalLinkTypeGameTypeID, "internalLinkTypeLanguagePack": InternalLinkTypeLanguagePackTypeID, + "internalLinkTypeLanguageSettings": InternalLinkTypeLanguageSettingsTypeID, "internalLinkTypeMessage": InternalLinkTypeMessageTypeID, "internalLinkTypeMessageDraft": InternalLinkTypeMessageDraftTypeID, "internalLinkTypePassportDataRequest": InternalLinkTypePassportDataRequestTypeID, "internalLinkTypePhoneNumberConfirmation": InternalLinkTypePhoneNumberConfirmationTypeID, + "internalLinkTypePrivacyAndSecuritySettings": InternalLinkTypePrivacyAndSecuritySettingsTypeID, "internalLinkTypeProxy": InternalLinkTypeProxyTypeID, "internalLinkTypePublicChat": InternalLinkTypePublicChatTypeID, "internalLinkTypeQrCodeAuthentication": InternalLinkTypeQrCodeAuthenticationTypeID, @@ -3752,10 +3756,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InternalLinkTypeFilterSettingsTypeID: func() bin.Object { return &InternalLinkTypeFilterSettings{} }, InternalLinkTypeGameTypeID: func() bin.Object { return &InternalLinkTypeGame{} }, InternalLinkTypeLanguagePackTypeID: func() bin.Object { return &InternalLinkTypeLanguagePack{} }, + InternalLinkTypeLanguageSettingsTypeID: func() bin.Object { return &InternalLinkTypeLanguageSettings{} }, InternalLinkTypeMessageTypeID: func() bin.Object { return &InternalLinkTypeMessage{} }, InternalLinkTypeMessageDraftTypeID: func() bin.Object { return &InternalLinkTypeMessageDraft{} }, InternalLinkTypePassportDataRequestTypeID: func() bin.Object { return &InternalLinkTypePassportDataRequest{} }, InternalLinkTypePhoneNumberConfirmationTypeID: func() bin.Object { return &InternalLinkTypePhoneNumberConfirmation{} }, + InternalLinkTypePrivacyAndSecuritySettingsTypeID: func() bin.Object { return &InternalLinkTypePrivacyAndSecuritySettings{} }, InternalLinkTypeProxyTypeID: func() bin.Object { return &InternalLinkTypeProxy{} }, InternalLinkTypePublicChatTypeID: func() bin.Object { return &InternalLinkTypePublicChat{} }, InternalLinkTypeQrCodeAuthenticationTypeID: func() bin.Object { return &InternalLinkTypeQrCodeAuthentication{} }, @@ -4828,10 +4834,12 @@ func ClassConstructorsMap() map[string][]uint32 { InternalLinkTypeFilterSettingsTypeID, InternalLinkTypeGameTypeID, InternalLinkTypeLanguagePackTypeID, + InternalLinkTypeLanguageSettingsTypeID, InternalLinkTypeMessageTypeID, InternalLinkTypeMessageDraftTypeID, InternalLinkTypePassportDataRequestTypeID, InternalLinkTypePhoneNumberConfirmationTypeID, + InternalLinkTypePrivacyAndSecuritySettingsTypeID, InternalLinkTypeProxyTypeID, InternalLinkTypePublicChatTypeID, InternalLinkTypeQrCodeAuthenticationTypeID,