package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type TextEmpty struct {
}
const TextEmptyTypeID = 0xdc3d824f
func (t TextEmpty ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextEmpty {}
_ bin .Decoder = &TextEmpty {}
_ bin .BareEncoder = &TextEmpty {}
_ bin .BareDecoder = &TextEmpty {}
_ RichTextClass = &TextEmpty {}
)
func (t *TextEmpty ) Zero () bool {
if t == nil {
return true
}
return true
}
func (t *TextEmpty ) String () string {
if t == nil {
return "TextEmpty(nil)"
}
type Alias TextEmpty
return fmt .Sprintf ("TextEmpty%+v" , Alias (*t ))
}
func (*TextEmpty ) TypeID () uint32 {
return TextEmptyTypeID
}
func (*TextEmpty ) TypeName () string {
return "textEmpty"
}
func (t *TextEmpty ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textEmpty" ,
ID : TextEmptyTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (t *TextEmpty ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textEmpty#dc3d824f as nil" )
}
b .PutID (TextEmptyTypeID )
return t .EncodeBare (b )
}
func (t *TextEmpty ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textEmpty#dc3d824f as nil" )
}
return nil
}
func (t *TextEmpty ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textEmpty#dc3d824f to nil" )
}
if err := b .ConsumeID (TextEmptyTypeID ); err != nil {
return fmt .Errorf ("unable to decode textEmpty#dc3d824f: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextEmpty ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textEmpty#dc3d824f to nil" )
}
return nil
}
type TextPlain struct {
Text string
}
const TextPlainTypeID = 0x744694e0
func (t TextPlain ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextPlain {}
_ bin .Decoder = &TextPlain {}
_ bin .BareEncoder = &TextPlain {}
_ bin .BareDecoder = &TextPlain {}
_ RichTextClass = &TextPlain {}
)
func (t *TextPlain ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == "" ) {
return false
}
return true
}
func (t *TextPlain ) String () string {
if t == nil {
return "TextPlain(nil)"
}
type Alias TextPlain
return fmt .Sprintf ("TextPlain%+v" , Alias (*t ))
}
func (t *TextPlain ) FillFrom (from interface {
GetText () (value string )
}) {
t .Text = from .GetText ()
}
func (*TextPlain ) TypeID () uint32 {
return TextPlainTypeID
}
func (*TextPlain ) TypeName () string {
return "textPlain"
}
func (t *TextPlain ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textPlain" ,
ID : TextPlainTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextPlain ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textPlain#744694e0 as nil" )
}
b .PutID (TextPlainTypeID )
return t .EncodeBare (b )
}
func (t *TextPlain ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textPlain#744694e0 as nil" )
}
b .PutString (t .Text )
return nil
}
func (t *TextPlain ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textPlain#744694e0 to nil" )
}
if err := b .ConsumeID (TextPlainTypeID ); err != nil {
return fmt .Errorf ("unable to decode textPlain#744694e0: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextPlain ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textPlain#744694e0 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textPlain#744694e0: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextPlain ) GetText () (value string ) {
if t == nil {
return
}
return t .Text
}
type TextBold struct {
Text RichTextClass
}
const TextBoldTypeID = 0x6724abc4
func (t TextBold ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextBold {}
_ bin .Decoder = &TextBold {}
_ bin .BareEncoder = &TextBold {}
_ bin .BareDecoder = &TextBold {}
_ RichTextClass = &TextBold {}
)
func (t *TextBold ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextBold ) String () string {
if t == nil {
return "TextBold(nil)"
}
type Alias TextBold
return fmt .Sprintf ("TextBold%+v" , Alias (*t ))
}
func (t *TextBold ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextBold ) TypeID () uint32 {
return TextBoldTypeID
}
func (*TextBold ) TypeName () string {
return "textBold"
}
func (t *TextBold ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textBold" ,
ID : TextBoldTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextBold ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBold#6724abc4 as nil" )
}
b .PutID (TextBoldTypeID )
return t .EncodeBare (b )
}
func (t *TextBold ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBold#6724abc4 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textBold#6724abc4: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textBold#6724abc4: field text: %w" , err )
}
return nil
}
func (t *TextBold ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBold#6724abc4 to nil" )
}
if err := b .ConsumeID (TextBoldTypeID ); err != nil {
return fmt .Errorf ("unable to decode textBold#6724abc4: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextBold ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBold#6724abc4 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textBold#6724abc4: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextBold ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextItalic struct {
Text RichTextClass
}
const TextItalicTypeID = 0xd912a59c
func (t TextItalic ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextItalic {}
_ bin .Decoder = &TextItalic {}
_ bin .BareEncoder = &TextItalic {}
_ bin .BareDecoder = &TextItalic {}
_ RichTextClass = &TextItalic {}
)
func (t *TextItalic ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextItalic ) String () string {
if t == nil {
return "TextItalic(nil)"
}
type Alias TextItalic
return fmt .Sprintf ("TextItalic%+v" , Alias (*t ))
}
func (t *TextItalic ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextItalic ) TypeID () uint32 {
return TextItalicTypeID
}
func (*TextItalic ) TypeName () string {
return "textItalic"
}
func (t *TextItalic ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textItalic" ,
ID : TextItalicTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextItalic ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textItalic#d912a59c as nil" )
}
b .PutID (TextItalicTypeID )
return t .EncodeBare (b )
}
func (t *TextItalic ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textItalic#d912a59c as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textItalic#d912a59c: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textItalic#d912a59c: field text: %w" , err )
}
return nil
}
func (t *TextItalic ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textItalic#d912a59c to nil" )
}
if err := b .ConsumeID (TextItalicTypeID ); err != nil {
return fmt .Errorf ("unable to decode textItalic#d912a59c: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextItalic ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textItalic#d912a59c to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textItalic#d912a59c: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextItalic ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextUnderline struct {
Text RichTextClass
}
const TextUnderlineTypeID = 0xc12622c4
func (t TextUnderline ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextUnderline {}
_ bin .Decoder = &TextUnderline {}
_ bin .BareEncoder = &TextUnderline {}
_ bin .BareDecoder = &TextUnderline {}
_ RichTextClass = &TextUnderline {}
)
func (t *TextUnderline ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextUnderline ) String () string {
if t == nil {
return "TextUnderline(nil)"
}
type Alias TextUnderline
return fmt .Sprintf ("TextUnderline%+v" , Alias (*t ))
}
func (t *TextUnderline ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextUnderline ) TypeID () uint32 {
return TextUnderlineTypeID
}
func (*TextUnderline ) TypeName () string {
return "textUnderline"
}
func (t *TextUnderline ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textUnderline" ,
ID : TextUnderlineTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextUnderline ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textUnderline#c12622c4 as nil" )
}
b .PutID (TextUnderlineTypeID )
return t .EncodeBare (b )
}
func (t *TextUnderline ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textUnderline#c12622c4 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textUnderline#c12622c4: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textUnderline#c12622c4: field text: %w" , err )
}
return nil
}
func (t *TextUnderline ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textUnderline#c12622c4 to nil" )
}
if err := b .ConsumeID (TextUnderlineTypeID ); err != nil {
return fmt .Errorf ("unable to decode textUnderline#c12622c4: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextUnderline ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textUnderline#c12622c4 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textUnderline#c12622c4: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextUnderline ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextStrike struct {
Text RichTextClass
}
const TextStrikeTypeID = 0x9bf8bb95
func (t TextStrike ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextStrike {}
_ bin .Decoder = &TextStrike {}
_ bin .BareEncoder = &TextStrike {}
_ bin .BareDecoder = &TextStrike {}
_ RichTextClass = &TextStrike {}
)
func (t *TextStrike ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextStrike ) String () string {
if t == nil {
return "TextStrike(nil)"
}
type Alias TextStrike
return fmt .Sprintf ("TextStrike%+v" , Alias (*t ))
}
func (t *TextStrike ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextStrike ) TypeID () uint32 {
return TextStrikeTypeID
}
func (*TextStrike ) TypeName () string {
return "textStrike"
}
func (t *TextStrike ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textStrike" ,
ID : TextStrikeTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextStrike ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textStrike#9bf8bb95 as nil" )
}
b .PutID (TextStrikeTypeID )
return t .EncodeBare (b )
}
func (t *TextStrike ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textStrike#9bf8bb95 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textStrike#9bf8bb95: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textStrike#9bf8bb95: field text: %w" , err )
}
return nil
}
func (t *TextStrike ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textStrike#9bf8bb95 to nil" )
}
if err := b .ConsumeID (TextStrikeTypeID ); err != nil {
return fmt .Errorf ("unable to decode textStrike#9bf8bb95: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextStrike ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textStrike#9bf8bb95 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textStrike#9bf8bb95: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextStrike ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextFixed struct {
Text RichTextClass
}
const TextFixedTypeID = 0x6c3f19b9
func (t TextFixed ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextFixed {}
_ bin .Decoder = &TextFixed {}
_ bin .BareEncoder = &TextFixed {}
_ bin .BareDecoder = &TextFixed {}
_ RichTextClass = &TextFixed {}
)
func (t *TextFixed ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextFixed ) String () string {
if t == nil {
return "TextFixed(nil)"
}
type Alias TextFixed
return fmt .Sprintf ("TextFixed%+v" , Alias (*t ))
}
func (t *TextFixed ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextFixed ) TypeID () uint32 {
return TextFixedTypeID
}
func (*TextFixed ) TypeName () string {
return "textFixed"
}
func (t *TextFixed ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textFixed" ,
ID : TextFixedTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextFixed ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textFixed#6c3f19b9 as nil" )
}
b .PutID (TextFixedTypeID )
return t .EncodeBare (b )
}
func (t *TextFixed ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textFixed#6c3f19b9 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textFixed#6c3f19b9: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textFixed#6c3f19b9: field text: %w" , err )
}
return nil
}
func (t *TextFixed ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textFixed#6c3f19b9 to nil" )
}
if err := b .ConsumeID (TextFixedTypeID ); err != nil {
return fmt .Errorf ("unable to decode textFixed#6c3f19b9: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextFixed ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textFixed#6c3f19b9 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textFixed#6c3f19b9: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextFixed ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextURL struct {
Text RichTextClass
URL string
WebpageID int64
}
const TextURLTypeID = 0x3c2884c1
func (t TextURL ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextURL {}
_ bin .Decoder = &TextURL {}
_ bin .BareEncoder = &TextURL {}
_ bin .BareDecoder = &TextURL {}
_ RichTextClass = &TextURL {}
)
func (t *TextURL ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
if !(t .URL == "" ) {
return false
}
if !(t .WebpageID == 0 ) {
return false
}
return true
}
func (t *TextURL ) String () string {
if t == nil {
return "TextURL(nil)"
}
type Alias TextURL
return fmt .Sprintf ("TextURL%+v" , Alias (*t ))
}
func (t *TextURL ) FillFrom (from interface {
GetText () (value RichTextClass )
GetURL () (value string )
GetWebpageID () (value int64 )
}) {
t .Text = from .GetText ()
t .URL = from .GetURL ()
t .WebpageID = from .GetWebpageID ()
}
func (*TextURL ) TypeID () uint32 {
return TextURLTypeID
}
func (*TextURL ) TypeName () string {
return "textUrl"
}
func (t *TextURL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textUrl" ,
ID : TextURLTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "URL" ,
SchemaName : "url" ,
},
{
Name : "WebpageID" ,
SchemaName : "webpage_id" ,
},
}
return typ
}
func (t *TextURL ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textUrl#3c2884c1 as nil" )
}
b .PutID (TextURLTypeID )
return t .EncodeBare (b )
}
func (t *TextURL ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textUrl#3c2884c1 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textUrl#3c2884c1: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textUrl#3c2884c1: field text: %w" , err )
}
b .PutString (t .URL )
b .PutLong (t .WebpageID )
return nil
}
func (t *TextURL ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textUrl#3c2884c1 to nil" )
}
if err := b .ConsumeID (TextURLTypeID ); err != nil {
return fmt .Errorf ("unable to decode textUrl#3c2884c1: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextURL ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textUrl#3c2884c1 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textUrl#3c2884c1: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textUrl#3c2884c1: field url: %w" , err )
}
t .URL = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode textUrl#3c2884c1: field webpage_id: %w" , err )
}
t .WebpageID = value
}
return nil
}
func (t *TextURL ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextURL ) GetURL () (value string ) {
if t == nil {
return
}
return t .URL
}
func (t *TextURL ) GetWebpageID () (value int64 ) {
if t == nil {
return
}
return t .WebpageID
}
type TextEmail struct {
Text RichTextClass
Email string
}
const TextEmailTypeID = 0xde5a0dd6
func (t TextEmail ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextEmail {}
_ bin .Decoder = &TextEmail {}
_ bin .BareEncoder = &TextEmail {}
_ bin .BareDecoder = &TextEmail {}
_ RichTextClass = &TextEmail {}
)
func (t *TextEmail ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
if !(t .Email == "" ) {
return false
}
return true
}
func (t *TextEmail ) String () string {
if t == nil {
return "TextEmail(nil)"
}
type Alias TextEmail
return fmt .Sprintf ("TextEmail%+v" , Alias (*t ))
}
func (t *TextEmail ) FillFrom (from interface {
GetText () (value RichTextClass )
GetEmail () (value string )
}) {
t .Text = from .GetText ()
t .Email = from .GetEmail ()
}
func (*TextEmail ) TypeID () uint32 {
return TextEmailTypeID
}
func (*TextEmail ) TypeName () string {
return "textEmail"
}
func (t *TextEmail ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textEmail" ,
ID : TextEmailTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Email" ,
SchemaName : "email" ,
},
}
return typ
}
func (t *TextEmail ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textEmail#de5a0dd6 as nil" )
}
b .PutID (TextEmailTypeID )
return t .EncodeBare (b )
}
func (t *TextEmail ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textEmail#de5a0dd6 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textEmail#de5a0dd6: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textEmail#de5a0dd6: field text: %w" , err )
}
b .PutString (t .Email )
return nil
}
func (t *TextEmail ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textEmail#de5a0dd6 to nil" )
}
if err := b .ConsumeID (TextEmailTypeID ); err != nil {
return fmt .Errorf ("unable to decode textEmail#de5a0dd6: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextEmail ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textEmail#de5a0dd6 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textEmail#de5a0dd6: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textEmail#de5a0dd6: field email: %w" , err )
}
t .Email = value
}
return nil
}
func (t *TextEmail ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextEmail ) GetEmail () (value string ) {
if t == nil {
return
}
return t .Email
}
type TextConcat struct {
Texts []RichTextClass
}
const TextConcatTypeID = 0x7e6260d7
func (t TextConcat ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextConcat {}
_ bin .Decoder = &TextConcat {}
_ bin .BareEncoder = &TextConcat {}
_ bin .BareDecoder = &TextConcat {}
_ RichTextClass = &TextConcat {}
)
func (t *TextConcat ) Zero () bool {
if t == nil {
return true
}
if !(t .Texts == nil ) {
return false
}
return true
}
func (t *TextConcat ) String () string {
if t == nil {
return "TextConcat(nil)"
}
type Alias TextConcat
return fmt .Sprintf ("TextConcat%+v" , Alias (*t ))
}
func (t *TextConcat ) FillFrom (from interface {
GetTexts () (value []RichTextClass )
}) {
t .Texts = from .GetTexts ()
}
func (*TextConcat ) TypeID () uint32 {
return TextConcatTypeID
}
func (*TextConcat ) TypeName () string {
return "textConcat"
}
func (t *TextConcat ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textConcat" ,
ID : TextConcatTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Texts" ,
SchemaName : "texts" ,
},
}
return typ
}
func (t *TextConcat ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textConcat#7e6260d7 as nil" )
}
b .PutID (TextConcatTypeID )
return t .EncodeBare (b )
}
func (t *TextConcat ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textConcat#7e6260d7 as nil" )
}
b .PutVectorHeader (len (t .Texts ))
for idx , v := range t .Texts {
if v == nil {
return fmt .Errorf ("unable to encode textConcat#7e6260d7: field texts element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textConcat#7e6260d7: field texts element with index %d: %w" , idx , err )
}
}
return nil
}
func (t *TextConcat ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textConcat#7e6260d7 to nil" )
}
if err := b .ConsumeID (TextConcatTypeID ); err != nil {
return fmt .Errorf ("unable to decode textConcat#7e6260d7: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextConcat ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textConcat#7e6260d7 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode textConcat#7e6260d7: field texts: %w" , err )
}
if headerLen > 0 {
t .Texts = make ([]RichTextClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textConcat#7e6260d7: field texts: %w" , err )
}
t .Texts = append (t .Texts , value )
}
}
return nil
}
func (t *TextConcat ) GetTexts () (value []RichTextClass ) {
if t == nil {
return
}
return t .Texts
}
func (t *TextConcat ) MapTexts () (value RichTextClassArray ) {
return RichTextClassArray (t .Texts )
}
type TextSubscript struct {
Text RichTextClass
}
const TextSubscriptTypeID = 0xed6a8504
func (t TextSubscript ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextSubscript {}
_ bin .Decoder = &TextSubscript {}
_ bin .BareEncoder = &TextSubscript {}
_ bin .BareDecoder = &TextSubscript {}
_ RichTextClass = &TextSubscript {}
)
func (t *TextSubscript ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextSubscript ) String () string {
if t == nil {
return "TextSubscript(nil)"
}
type Alias TextSubscript
return fmt .Sprintf ("TextSubscript%+v" , Alias (*t ))
}
func (t *TextSubscript ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextSubscript ) TypeID () uint32 {
return TextSubscriptTypeID
}
func (*TextSubscript ) TypeName () string {
return "textSubscript"
}
func (t *TextSubscript ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textSubscript" ,
ID : TextSubscriptTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextSubscript ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSubscript#ed6a8504 as nil" )
}
b .PutID (TextSubscriptTypeID )
return t .EncodeBare (b )
}
func (t *TextSubscript ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSubscript#ed6a8504 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textSubscript#ed6a8504: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textSubscript#ed6a8504: field text: %w" , err )
}
return nil
}
func (t *TextSubscript ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSubscript#ed6a8504 to nil" )
}
if err := b .ConsumeID (TextSubscriptTypeID ); err != nil {
return fmt .Errorf ("unable to decode textSubscript#ed6a8504: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextSubscript ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSubscript#ed6a8504 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textSubscript#ed6a8504: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextSubscript ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextSuperscript struct {
Text RichTextClass
}
const TextSuperscriptTypeID = 0xc7fb5e01
func (t TextSuperscript ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextSuperscript {}
_ bin .Decoder = &TextSuperscript {}
_ bin .BareEncoder = &TextSuperscript {}
_ bin .BareDecoder = &TextSuperscript {}
_ RichTextClass = &TextSuperscript {}
)
func (t *TextSuperscript ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextSuperscript ) String () string {
if t == nil {
return "TextSuperscript(nil)"
}
type Alias TextSuperscript
return fmt .Sprintf ("TextSuperscript%+v" , Alias (*t ))
}
func (t *TextSuperscript ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextSuperscript ) TypeID () uint32 {
return TextSuperscriptTypeID
}
func (*TextSuperscript ) TypeName () string {
return "textSuperscript"
}
func (t *TextSuperscript ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textSuperscript" ,
ID : TextSuperscriptTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextSuperscript ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSuperscript#c7fb5e01 as nil" )
}
b .PutID (TextSuperscriptTypeID )
return t .EncodeBare (b )
}
func (t *TextSuperscript ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSuperscript#c7fb5e01 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textSuperscript#c7fb5e01: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textSuperscript#c7fb5e01: field text: %w" , err )
}
return nil
}
func (t *TextSuperscript ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSuperscript#c7fb5e01 to nil" )
}
if err := b .ConsumeID (TextSuperscriptTypeID ); err != nil {
return fmt .Errorf ("unable to decode textSuperscript#c7fb5e01: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextSuperscript ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSuperscript#c7fb5e01 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textSuperscript#c7fb5e01: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextSuperscript ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextMarked struct {
Text RichTextClass
}
const TextMarkedTypeID = 0x34b8621
func (t TextMarked ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextMarked {}
_ bin .Decoder = &TextMarked {}
_ bin .BareEncoder = &TextMarked {}
_ bin .BareDecoder = &TextMarked {}
_ RichTextClass = &TextMarked {}
)
func (t *TextMarked ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextMarked ) String () string {
if t == nil {
return "TextMarked(nil)"
}
type Alias TextMarked
return fmt .Sprintf ("TextMarked%+v" , Alias (*t ))
}
func (t *TextMarked ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextMarked ) TypeID () uint32 {
return TextMarkedTypeID
}
func (*TextMarked ) TypeName () string {
return "textMarked"
}
func (t *TextMarked ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textMarked" ,
ID : TextMarkedTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextMarked ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMarked#34b8621 as nil" )
}
b .PutID (TextMarkedTypeID )
return t .EncodeBare (b )
}
func (t *TextMarked ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMarked#34b8621 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textMarked#34b8621: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textMarked#34b8621: field text: %w" , err )
}
return nil
}
func (t *TextMarked ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMarked#34b8621 to nil" )
}
if err := b .ConsumeID (TextMarkedTypeID ); err != nil {
return fmt .Errorf ("unable to decode textMarked#34b8621: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextMarked ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMarked#34b8621 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textMarked#34b8621: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextMarked ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextPhone struct {
Text RichTextClass
Phone string
}
const TextPhoneTypeID = 0x1ccb966a
func (t TextPhone ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextPhone {}
_ bin .Decoder = &TextPhone {}
_ bin .BareEncoder = &TextPhone {}
_ bin .BareDecoder = &TextPhone {}
_ RichTextClass = &TextPhone {}
)
func (t *TextPhone ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
if !(t .Phone == "" ) {
return false
}
return true
}
func (t *TextPhone ) String () string {
if t == nil {
return "TextPhone(nil)"
}
type Alias TextPhone
return fmt .Sprintf ("TextPhone%+v" , Alias (*t ))
}
func (t *TextPhone ) FillFrom (from interface {
GetText () (value RichTextClass )
GetPhone () (value string )
}) {
t .Text = from .GetText ()
t .Phone = from .GetPhone ()
}
func (*TextPhone ) TypeID () uint32 {
return TextPhoneTypeID
}
func (*TextPhone ) TypeName () string {
return "textPhone"
}
func (t *TextPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textPhone" ,
ID : TextPhoneTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Phone" ,
SchemaName : "phone" ,
},
}
return typ
}
func (t *TextPhone ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textPhone#1ccb966a as nil" )
}
b .PutID (TextPhoneTypeID )
return t .EncodeBare (b )
}
func (t *TextPhone ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textPhone#1ccb966a as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textPhone#1ccb966a: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textPhone#1ccb966a: field text: %w" , err )
}
b .PutString (t .Phone )
return nil
}
func (t *TextPhone ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textPhone#1ccb966a to nil" )
}
if err := b .ConsumeID (TextPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode textPhone#1ccb966a: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextPhone ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textPhone#1ccb966a to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textPhone#1ccb966a: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textPhone#1ccb966a: field phone: %w" , err )
}
t .Phone = value
}
return nil
}
func (t *TextPhone ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextPhone ) GetPhone () (value string ) {
if t == nil {
return
}
return t .Phone
}
type TextImage struct {
DocumentID int64
W int
H int
}
const TextImageTypeID = 0x81ccf4f
func (t TextImage ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextImage {}
_ bin .Decoder = &TextImage {}
_ bin .BareEncoder = &TextImage {}
_ bin .BareDecoder = &TextImage {}
_ RichTextClass = &TextImage {}
)
func (t *TextImage ) Zero () bool {
if t == nil {
return true
}
if !(t .DocumentID == 0 ) {
return false
}
if !(t .W == 0 ) {
return false
}
if !(t .H == 0 ) {
return false
}
return true
}
func (t *TextImage ) String () string {
if t == nil {
return "TextImage(nil)"
}
type Alias TextImage
return fmt .Sprintf ("TextImage%+v" , Alias (*t ))
}
func (t *TextImage ) FillFrom (from interface {
GetDocumentID () (value int64 )
GetW () (value int )
GetH () (value int )
}) {
t .DocumentID = from .GetDocumentID ()
t .W = from .GetW ()
t .H = from .GetH ()
}
func (*TextImage ) TypeID () uint32 {
return TextImageTypeID
}
func (*TextImage ) TypeName () string {
return "textImage"
}
func (t *TextImage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textImage" ,
ID : TextImageTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DocumentID" ,
SchemaName : "document_id" ,
},
{
Name : "W" ,
SchemaName : "w" ,
},
{
Name : "H" ,
SchemaName : "h" ,
},
}
return typ
}
func (t *TextImage ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textImage#81ccf4f as nil" )
}
b .PutID (TextImageTypeID )
return t .EncodeBare (b )
}
func (t *TextImage ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textImage#81ccf4f as nil" )
}
b .PutLong (t .DocumentID )
b .PutInt (t .W )
b .PutInt (t .H )
return nil
}
func (t *TextImage ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textImage#81ccf4f to nil" )
}
if err := b .ConsumeID (TextImageTypeID ); err != nil {
return fmt .Errorf ("unable to decode textImage#81ccf4f: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextImage ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textImage#81ccf4f to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode textImage#81ccf4f: field document_id: %w" , err )
}
t .DocumentID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode textImage#81ccf4f: field w: %w" , err )
}
t .W = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode textImage#81ccf4f: field h: %w" , err )
}
t .H = value
}
return nil
}
func (t *TextImage ) GetDocumentID () (value int64 ) {
if t == nil {
return
}
return t .DocumentID
}
func (t *TextImage ) GetW () (value int ) {
if t == nil {
return
}
return t .W
}
func (t *TextImage ) GetH () (value int ) {
if t == nil {
return
}
return t .H
}
type TextAnchor struct {
Text RichTextClass
Name string
}
const TextAnchorTypeID = 0x35553762
func (t TextAnchor ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextAnchor {}
_ bin .Decoder = &TextAnchor {}
_ bin .BareEncoder = &TextAnchor {}
_ bin .BareDecoder = &TextAnchor {}
_ RichTextClass = &TextAnchor {}
)
func (t *TextAnchor ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
if !(t .Name == "" ) {
return false
}
return true
}
func (t *TextAnchor ) String () string {
if t == nil {
return "TextAnchor(nil)"
}
type Alias TextAnchor
return fmt .Sprintf ("TextAnchor%+v" , Alias (*t ))
}
func (t *TextAnchor ) FillFrom (from interface {
GetText () (value RichTextClass )
GetName () (value string )
}) {
t .Text = from .GetText ()
t .Name = from .GetName ()
}
func (*TextAnchor ) TypeID () uint32 {
return TextAnchorTypeID
}
func (*TextAnchor ) TypeName () string {
return "textAnchor"
}
func (t *TextAnchor ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textAnchor" ,
ID : TextAnchorTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Name" ,
SchemaName : "name" ,
},
}
return typ
}
func (t *TextAnchor ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAnchor#35553762 as nil" )
}
b .PutID (TextAnchorTypeID )
return t .EncodeBare (b )
}
func (t *TextAnchor ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAnchor#35553762 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textAnchor#35553762: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textAnchor#35553762: field text: %w" , err )
}
b .PutString (t .Name )
return nil
}
func (t *TextAnchor ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAnchor#35553762 to nil" )
}
if err := b .ConsumeID (TextAnchorTypeID ); err != nil {
return fmt .Errorf ("unable to decode textAnchor#35553762: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextAnchor ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAnchor#35553762 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textAnchor#35553762: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textAnchor#35553762: field name: %w" , err )
}
t .Name = value
}
return nil
}
func (t *TextAnchor ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextAnchor ) GetName () (value string ) {
if t == nil {
return
}
return t .Name
}
type TextMath struct {
Source string
}
const TextMathTypeID = 0x9d2eac97
func (t TextMath ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextMath {}
_ bin .Decoder = &TextMath {}
_ bin .BareEncoder = &TextMath {}
_ bin .BareDecoder = &TextMath {}
_ RichTextClass = &TextMath {}
)
func (t *TextMath ) Zero () bool {
if t == nil {
return true
}
if !(t .Source == "" ) {
return false
}
return true
}
func (t *TextMath ) String () string {
if t == nil {
return "TextMath(nil)"
}
type Alias TextMath
return fmt .Sprintf ("TextMath%+v" , Alias (*t ))
}
func (t *TextMath ) FillFrom (from interface {
GetSource () (value string )
}) {
t .Source = from .GetSource ()
}
func (*TextMath ) TypeID () uint32 {
return TextMathTypeID
}
func (*TextMath ) TypeName () string {
return "textMath"
}
func (t *TextMath ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textMath" ,
ID : TextMathTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Source" ,
SchemaName : "source" ,
},
}
return typ
}
func (t *TextMath ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMath#9d2eac97 as nil" )
}
b .PutID (TextMathTypeID )
return t .EncodeBare (b )
}
func (t *TextMath ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMath#9d2eac97 as nil" )
}
b .PutString (t .Source )
return nil
}
func (t *TextMath ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMath#9d2eac97 to nil" )
}
if err := b .ConsumeID (TextMathTypeID ); err != nil {
return fmt .Errorf ("unable to decode textMath#9d2eac97: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextMath ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMath#9d2eac97 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textMath#9d2eac97: field source: %w" , err )
}
t .Source = value
}
return nil
}
func (t *TextMath ) GetSource () (value string ) {
if t == nil {
return
}
return t .Source
}
type TextCustomEmoji struct {
DocumentID int64
Alt string
}
const TextCustomEmojiTypeID = 0xa26156c0
func (t TextCustomEmoji ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextCustomEmoji {}
_ bin .Decoder = &TextCustomEmoji {}
_ bin .BareEncoder = &TextCustomEmoji {}
_ bin .BareDecoder = &TextCustomEmoji {}
_ RichTextClass = &TextCustomEmoji {}
)
func (t *TextCustomEmoji ) Zero () bool {
if t == nil {
return true
}
if !(t .DocumentID == 0 ) {
return false
}
if !(t .Alt == "" ) {
return false
}
return true
}
func (t *TextCustomEmoji ) String () string {
if t == nil {
return "TextCustomEmoji(nil)"
}
type Alias TextCustomEmoji
return fmt .Sprintf ("TextCustomEmoji%+v" , Alias (*t ))
}
func (t *TextCustomEmoji ) FillFrom (from interface {
GetDocumentID () (value int64 )
GetAlt () (value string )
}) {
t .DocumentID = from .GetDocumentID ()
t .Alt = from .GetAlt ()
}
func (*TextCustomEmoji ) TypeID () uint32 {
return TextCustomEmojiTypeID
}
func (*TextCustomEmoji ) TypeName () string {
return "textCustomEmoji"
}
func (t *TextCustomEmoji ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textCustomEmoji" ,
ID : TextCustomEmojiTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DocumentID" ,
SchemaName : "document_id" ,
},
{
Name : "Alt" ,
SchemaName : "alt" ,
},
}
return typ
}
func (t *TextCustomEmoji ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textCustomEmoji#a26156c0 as nil" )
}
b .PutID (TextCustomEmojiTypeID )
return t .EncodeBare (b )
}
func (t *TextCustomEmoji ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textCustomEmoji#a26156c0 as nil" )
}
b .PutLong (t .DocumentID )
b .PutString (t .Alt )
return nil
}
func (t *TextCustomEmoji ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textCustomEmoji#a26156c0 to nil" )
}
if err := b .ConsumeID (TextCustomEmojiTypeID ); err != nil {
return fmt .Errorf ("unable to decode textCustomEmoji#a26156c0: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextCustomEmoji ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textCustomEmoji#a26156c0 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode textCustomEmoji#a26156c0: field document_id: %w" , err )
}
t .DocumentID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode textCustomEmoji#a26156c0: field alt: %w" , err )
}
t .Alt = value
}
return nil
}
func (t *TextCustomEmoji ) GetDocumentID () (value int64 ) {
if t == nil {
return
}
return t .DocumentID
}
func (t *TextCustomEmoji ) GetAlt () (value string ) {
if t == nil {
return
}
return t .Alt
}
type TextSpoiler struct {
Text RichTextClass
}
const TextSpoilerTypeID = 0x4c2a5d62
func (t TextSpoiler ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextSpoiler {}
_ bin .Decoder = &TextSpoiler {}
_ bin .BareEncoder = &TextSpoiler {}
_ bin .BareDecoder = &TextSpoiler {}
_ RichTextClass = &TextSpoiler {}
)
func (t *TextSpoiler ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextSpoiler ) String () string {
if t == nil {
return "TextSpoiler(nil)"
}
type Alias TextSpoiler
return fmt .Sprintf ("TextSpoiler%+v" , Alias (*t ))
}
func (t *TextSpoiler ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextSpoiler ) TypeID () uint32 {
return TextSpoilerTypeID
}
func (*TextSpoiler ) TypeName () string {
return "textSpoiler"
}
func (t *TextSpoiler ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textSpoiler" ,
ID : TextSpoilerTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextSpoiler ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSpoiler#4c2a5d62 as nil" )
}
b .PutID (TextSpoilerTypeID )
return t .EncodeBare (b )
}
func (t *TextSpoiler ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textSpoiler#4c2a5d62 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textSpoiler#4c2a5d62: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textSpoiler#4c2a5d62: field text: %w" , err )
}
return nil
}
func (t *TextSpoiler ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSpoiler#4c2a5d62 to nil" )
}
if err := b .ConsumeID (TextSpoilerTypeID ); err != nil {
return fmt .Errorf ("unable to decode textSpoiler#4c2a5d62: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextSpoiler ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textSpoiler#4c2a5d62 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textSpoiler#4c2a5d62: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextSpoiler ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextMention struct {
Text RichTextClass
}
const TextMentionTypeID = 0xcd24cf44
func (t TextMention ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextMention {}
_ bin .Decoder = &TextMention {}
_ bin .BareEncoder = &TextMention {}
_ bin .BareDecoder = &TextMention {}
_ RichTextClass = &TextMention {}
)
func (t *TextMention ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextMention ) String () string {
if t == nil {
return "TextMention(nil)"
}
type Alias TextMention
return fmt .Sprintf ("TextMention%+v" , Alias (*t ))
}
func (t *TextMention ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextMention ) TypeID () uint32 {
return TextMentionTypeID
}
func (*TextMention ) TypeName () string {
return "textMention"
}
func (t *TextMention ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textMention" ,
ID : TextMentionTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextMention ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMention#cd24cf44 as nil" )
}
b .PutID (TextMentionTypeID )
return t .EncodeBare (b )
}
func (t *TextMention ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMention#cd24cf44 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textMention#cd24cf44: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textMention#cd24cf44: field text: %w" , err )
}
return nil
}
func (t *TextMention ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMention#cd24cf44 to nil" )
}
if err := b .ConsumeID (TextMentionTypeID ); err != nil {
return fmt .Errorf ("unable to decode textMention#cd24cf44: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextMention ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMention#cd24cf44 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textMention#cd24cf44: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextMention ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextHashtag struct {
Text RichTextClass
}
const TextHashtagTypeID = 0x519524ea
func (t TextHashtag ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextHashtag {}
_ bin .Decoder = &TextHashtag {}
_ bin .BareEncoder = &TextHashtag {}
_ bin .BareDecoder = &TextHashtag {}
_ RichTextClass = &TextHashtag {}
)
func (t *TextHashtag ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextHashtag ) String () string {
if t == nil {
return "TextHashtag(nil)"
}
type Alias TextHashtag
return fmt .Sprintf ("TextHashtag%+v" , Alias (*t ))
}
func (t *TextHashtag ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextHashtag ) TypeID () uint32 {
return TextHashtagTypeID
}
func (*TextHashtag ) TypeName () string {
return "textHashtag"
}
func (t *TextHashtag ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textHashtag" ,
ID : TextHashtagTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextHashtag ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textHashtag#519524ea as nil" )
}
b .PutID (TextHashtagTypeID )
return t .EncodeBare (b )
}
func (t *TextHashtag ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textHashtag#519524ea as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textHashtag#519524ea: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textHashtag#519524ea: field text: %w" , err )
}
return nil
}
func (t *TextHashtag ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textHashtag#519524ea to nil" )
}
if err := b .ConsumeID (TextHashtagTypeID ); err != nil {
return fmt .Errorf ("unable to decode textHashtag#519524ea: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextHashtag ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textHashtag#519524ea to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textHashtag#519524ea: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextHashtag ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextBotCommand struct {
Text RichTextClass
}
const TextBotCommandTypeID = 0x2ff29d3
func (t TextBotCommand ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextBotCommand {}
_ bin .Decoder = &TextBotCommand {}
_ bin .BareEncoder = &TextBotCommand {}
_ bin .BareDecoder = &TextBotCommand {}
_ RichTextClass = &TextBotCommand {}
)
func (t *TextBotCommand ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextBotCommand ) String () string {
if t == nil {
return "TextBotCommand(nil)"
}
type Alias TextBotCommand
return fmt .Sprintf ("TextBotCommand%+v" , Alias (*t ))
}
func (t *TextBotCommand ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextBotCommand ) TypeID () uint32 {
return TextBotCommandTypeID
}
func (*TextBotCommand ) TypeName () string {
return "textBotCommand"
}
func (t *TextBotCommand ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textBotCommand" ,
ID : TextBotCommandTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextBotCommand ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBotCommand#2ff29d3 as nil" )
}
b .PutID (TextBotCommandTypeID )
return t .EncodeBare (b )
}
func (t *TextBotCommand ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBotCommand#2ff29d3 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textBotCommand#2ff29d3: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textBotCommand#2ff29d3: field text: %w" , err )
}
return nil
}
func (t *TextBotCommand ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBotCommand#2ff29d3 to nil" )
}
if err := b .ConsumeID (TextBotCommandTypeID ); err != nil {
return fmt .Errorf ("unable to decode textBotCommand#2ff29d3: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextBotCommand ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBotCommand#2ff29d3 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textBotCommand#2ff29d3: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextBotCommand ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextCashtag struct {
Text RichTextClass
}
const TextCashtagTypeID = 0x7b9e1801
func (t TextCashtag ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextCashtag {}
_ bin .Decoder = &TextCashtag {}
_ bin .BareEncoder = &TextCashtag {}
_ bin .BareDecoder = &TextCashtag {}
_ RichTextClass = &TextCashtag {}
)
func (t *TextCashtag ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextCashtag ) String () string {
if t == nil {
return "TextCashtag(nil)"
}
type Alias TextCashtag
return fmt .Sprintf ("TextCashtag%+v" , Alias (*t ))
}
func (t *TextCashtag ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextCashtag ) TypeID () uint32 {
return TextCashtagTypeID
}
func (*TextCashtag ) TypeName () string {
return "textCashtag"
}
func (t *TextCashtag ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textCashtag" ,
ID : TextCashtagTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextCashtag ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textCashtag#7b9e1801 as nil" )
}
b .PutID (TextCashtagTypeID )
return t .EncodeBare (b )
}
func (t *TextCashtag ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textCashtag#7b9e1801 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textCashtag#7b9e1801: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textCashtag#7b9e1801: field text: %w" , err )
}
return nil
}
func (t *TextCashtag ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textCashtag#7b9e1801 to nil" )
}
if err := b .ConsumeID (TextCashtagTypeID ); err != nil {
return fmt .Errorf ("unable to decode textCashtag#7b9e1801: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextCashtag ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textCashtag#7b9e1801 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textCashtag#7b9e1801: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextCashtag ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextAutoURL struct {
Text RichTextClass
}
const TextAutoURLTypeID = 0xac6a83aa
func (t TextAutoURL ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextAutoURL {}
_ bin .Decoder = &TextAutoURL {}
_ bin .BareEncoder = &TextAutoURL {}
_ bin .BareDecoder = &TextAutoURL {}
_ RichTextClass = &TextAutoURL {}
)
func (t *TextAutoURL ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextAutoURL ) String () string {
if t == nil {
return "TextAutoURL(nil)"
}
type Alias TextAutoURL
return fmt .Sprintf ("TextAutoURL%+v" , Alias (*t ))
}
func (t *TextAutoURL ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextAutoURL ) TypeID () uint32 {
return TextAutoURLTypeID
}
func (*TextAutoURL ) TypeName () string {
return "textAutoUrl"
}
func (t *TextAutoURL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textAutoUrl" ,
ID : TextAutoURLTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextAutoURL ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoUrl#ac6a83aa as nil" )
}
b .PutID (TextAutoURLTypeID )
return t .EncodeBare (b )
}
func (t *TextAutoURL ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoUrl#ac6a83aa as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textAutoUrl#ac6a83aa: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textAutoUrl#ac6a83aa: field text: %w" , err )
}
return nil
}
func (t *TextAutoURL ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoUrl#ac6a83aa to nil" )
}
if err := b .ConsumeID (TextAutoURLTypeID ); err != nil {
return fmt .Errorf ("unable to decode textAutoUrl#ac6a83aa: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextAutoURL ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoUrl#ac6a83aa to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textAutoUrl#ac6a83aa: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextAutoURL ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextAutoEmail struct {
Text RichTextClass
}
const TextAutoEmailTypeID = 0xc556a45d
func (t TextAutoEmail ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextAutoEmail {}
_ bin .Decoder = &TextAutoEmail {}
_ bin .BareEncoder = &TextAutoEmail {}
_ bin .BareDecoder = &TextAutoEmail {}
_ RichTextClass = &TextAutoEmail {}
)
func (t *TextAutoEmail ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextAutoEmail ) String () string {
if t == nil {
return "TextAutoEmail(nil)"
}
type Alias TextAutoEmail
return fmt .Sprintf ("TextAutoEmail%+v" , Alias (*t ))
}
func (t *TextAutoEmail ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextAutoEmail ) TypeID () uint32 {
return TextAutoEmailTypeID
}
func (*TextAutoEmail ) TypeName () string {
return "textAutoEmail"
}
func (t *TextAutoEmail ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textAutoEmail" ,
ID : TextAutoEmailTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextAutoEmail ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoEmail#c556a45d as nil" )
}
b .PutID (TextAutoEmailTypeID )
return t .EncodeBare (b )
}
func (t *TextAutoEmail ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoEmail#c556a45d as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textAutoEmail#c556a45d: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textAutoEmail#c556a45d: field text: %w" , err )
}
return nil
}
func (t *TextAutoEmail ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoEmail#c556a45d to nil" )
}
if err := b .ConsumeID (TextAutoEmailTypeID ); err != nil {
return fmt .Errorf ("unable to decode textAutoEmail#c556a45d: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextAutoEmail ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoEmail#c556a45d to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textAutoEmail#c556a45d: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextAutoEmail ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextAutoPhone struct {
Text RichTextClass
}
const TextAutoPhoneTypeID = 0x24c26789
func (t TextAutoPhone ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextAutoPhone {}
_ bin .Decoder = &TextAutoPhone {}
_ bin .BareEncoder = &TextAutoPhone {}
_ bin .BareDecoder = &TextAutoPhone {}
_ RichTextClass = &TextAutoPhone {}
)
func (t *TextAutoPhone ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextAutoPhone ) String () string {
if t == nil {
return "TextAutoPhone(nil)"
}
type Alias TextAutoPhone
return fmt .Sprintf ("TextAutoPhone%+v" , Alias (*t ))
}
func (t *TextAutoPhone ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextAutoPhone ) TypeID () uint32 {
return TextAutoPhoneTypeID
}
func (*TextAutoPhone ) TypeName () string {
return "textAutoPhone"
}
func (t *TextAutoPhone ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textAutoPhone" ,
ID : TextAutoPhoneTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextAutoPhone ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoPhone#24c26789 as nil" )
}
b .PutID (TextAutoPhoneTypeID )
return t .EncodeBare (b )
}
func (t *TextAutoPhone ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textAutoPhone#24c26789 as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textAutoPhone#24c26789: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textAutoPhone#24c26789: field text: %w" , err )
}
return nil
}
func (t *TextAutoPhone ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoPhone#24c26789 to nil" )
}
if err := b .ConsumeID (TextAutoPhoneTypeID ); err != nil {
return fmt .Errorf ("unable to decode textAutoPhone#24c26789: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextAutoPhone ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textAutoPhone#24c26789 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textAutoPhone#24c26789: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextAutoPhone ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextBankCard struct {
Text RichTextClass
}
const TextBankCardTypeID = 0xb956812d
func (t TextBankCard ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextBankCard {}
_ bin .Decoder = &TextBankCard {}
_ bin .BareEncoder = &TextBankCard {}
_ bin .BareDecoder = &TextBankCard {}
_ RichTextClass = &TextBankCard {}
)
func (t *TextBankCard ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
return true
}
func (t *TextBankCard ) String () string {
if t == nil {
return "TextBankCard(nil)"
}
type Alias TextBankCard
return fmt .Sprintf ("TextBankCard%+v" , Alias (*t ))
}
func (t *TextBankCard ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
t .Text = from .GetText ()
}
func (*TextBankCard ) TypeID () uint32 {
return TextBankCardTypeID
}
func (*TextBankCard ) TypeName () string {
return "textBankCard"
}
func (t *TextBankCard ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textBankCard" ,
ID : TextBankCardTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (t *TextBankCard ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBankCard#b956812d as nil" )
}
b .PutID (TextBankCardTypeID )
return t .EncodeBare (b )
}
func (t *TextBankCard ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textBankCard#b956812d as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textBankCard#b956812d: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textBankCard#b956812d: field text: %w" , err )
}
return nil
}
func (t *TextBankCard ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBankCard#b956812d to nil" )
}
if err := b .ConsumeID (TextBankCardTypeID ); err != nil {
return fmt .Errorf ("unable to decode textBankCard#b956812d: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextBankCard ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textBankCard#b956812d to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textBankCard#b956812d: field text: %w" , err )
}
t .Text = value
}
return nil
}
func (t *TextBankCard ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
type TextMentionName struct {
Text RichTextClass
UserID int64
}
const TextMentionNameTypeID = 0x1a9fbfc
func (t TextMentionName ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextMentionName {}
_ bin .Decoder = &TextMentionName {}
_ bin .BareEncoder = &TextMentionName {}
_ bin .BareDecoder = &TextMentionName {}
_ RichTextClass = &TextMentionName {}
)
func (t *TextMentionName ) Zero () bool {
if t == nil {
return true
}
if !(t .Text == nil ) {
return false
}
if !(t .UserID == 0 ) {
return false
}
return true
}
func (t *TextMentionName ) String () string {
if t == nil {
return "TextMentionName(nil)"
}
type Alias TextMentionName
return fmt .Sprintf ("TextMentionName%+v" , Alias (*t ))
}
func (t *TextMentionName ) FillFrom (from interface {
GetText () (value RichTextClass )
GetUserID () (value int64 )
}) {
t .Text = from .GetText ()
t .UserID = from .GetUserID ()
}
func (*TextMentionName ) TypeID () uint32 {
return TextMentionNameTypeID
}
func (*TextMentionName ) TypeName () string {
return "textMentionName"
}
func (t *TextMentionName ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textMentionName" ,
ID : TextMentionNameTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (t *TextMentionName ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMentionName#1a9fbfc as nil" )
}
b .PutID (TextMentionNameTypeID )
return t .EncodeBare (b )
}
func (t *TextMentionName ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textMentionName#1a9fbfc as nil" )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textMentionName#1a9fbfc: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textMentionName#1a9fbfc: field text: %w" , err )
}
b .PutLong (t .UserID )
return nil
}
func (t *TextMentionName ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMentionName#1a9fbfc to nil" )
}
if err := b .ConsumeID (TextMentionNameTypeID ); err != nil {
return fmt .Errorf ("unable to decode textMentionName#1a9fbfc: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextMentionName ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textMentionName#1a9fbfc to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textMentionName#1a9fbfc: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode textMentionName#1a9fbfc: field user_id: %w" , err )
}
t .UserID = value
}
return nil
}
func (t *TextMentionName ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextMentionName ) GetUserID () (value int64 ) {
if t == nil {
return
}
return t .UserID
}
type TextDate struct {
Flags bin .Fields
Relative bool
ShortTime bool
LongTime bool
ShortDate bool
LongDate bool
DayOfWeek bool
Text RichTextClass
Date int
}
const TextDateTypeID = 0xa5b45e2b
func (t TextDate ) construct () RichTextClass { return &t }
var (
_ bin .Encoder = &TextDate {}
_ bin .Decoder = &TextDate {}
_ bin .BareEncoder = &TextDate {}
_ bin .BareDecoder = &TextDate {}
_ RichTextClass = &TextDate {}
)
func (t *TextDate ) Zero () bool {
if t == nil {
return true
}
if !(t .Flags .Zero ()) {
return false
}
if !(t .Relative == false ) {
return false
}
if !(t .ShortTime == false ) {
return false
}
if !(t .LongTime == false ) {
return false
}
if !(t .ShortDate == false ) {
return false
}
if !(t .LongDate == false ) {
return false
}
if !(t .DayOfWeek == false ) {
return false
}
if !(t .Text == nil ) {
return false
}
if !(t .Date == 0 ) {
return false
}
return true
}
func (t *TextDate ) String () string {
if t == nil {
return "TextDate(nil)"
}
type Alias TextDate
return fmt .Sprintf ("TextDate%+v" , Alias (*t ))
}
func (t *TextDate ) FillFrom (from interface {
GetRelative () (value bool )
GetShortTime () (value bool )
GetLongTime () (value bool )
GetShortDate () (value bool )
GetLongDate () (value bool )
GetDayOfWeek () (value bool )
GetText () (value RichTextClass )
GetDate () (value int )
}) {
t .Relative = from .GetRelative ()
t .ShortTime = from .GetShortTime ()
t .LongTime = from .GetLongTime ()
t .ShortDate = from .GetShortDate ()
t .LongDate = from .GetLongDate ()
t .DayOfWeek = from .GetDayOfWeek ()
t .Text = from .GetText ()
t .Date = from .GetDate ()
}
func (*TextDate ) TypeID () uint32 {
return TextDateTypeID
}
func (*TextDate ) TypeName () string {
return "textDate"
}
func (t *TextDate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "textDate" ,
ID : TextDateTypeID ,
}
if t == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Relative" ,
SchemaName : "relative" ,
Null : !t .Flags .Has (0 ),
},
{
Name : "ShortTime" ,
SchemaName : "short_time" ,
Null : !t .Flags .Has (1 ),
},
{
Name : "LongTime" ,
SchemaName : "long_time" ,
Null : !t .Flags .Has (2 ),
},
{
Name : "ShortDate" ,
SchemaName : "short_date" ,
Null : !t .Flags .Has (3 ),
},
{
Name : "LongDate" ,
SchemaName : "long_date" ,
Null : !t .Flags .Has (4 ),
},
{
Name : "DayOfWeek" ,
SchemaName : "day_of_week" ,
Null : !t .Flags .Has (5 ),
},
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (t *TextDate ) SetFlags () {
if !(t .Relative == false ) {
t .Flags .Set (0 )
}
if !(t .ShortTime == false ) {
t .Flags .Set (1 )
}
if !(t .LongTime == false ) {
t .Flags .Set (2 )
}
if !(t .ShortDate == false ) {
t .Flags .Set (3 )
}
if !(t .LongDate == false ) {
t .Flags .Set (4 )
}
if !(t .DayOfWeek == false ) {
t .Flags .Set (5 )
}
}
func (t *TextDate ) Encode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textDate#a5b45e2b as nil" )
}
b .PutID (TextDateTypeID )
return t .EncodeBare (b )
}
func (t *TextDate ) EncodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't encode textDate#a5b45e2b as nil" )
}
t .SetFlags ()
if err := t .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textDate#a5b45e2b: field flags: %w" , err )
}
if t .Text == nil {
return fmt .Errorf ("unable to encode textDate#a5b45e2b: field text is nil" )
}
if err := t .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode textDate#a5b45e2b: field text: %w" , err )
}
b .PutInt (t .Date )
return nil
}
func (t *TextDate ) Decode (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textDate#a5b45e2b to nil" )
}
if err := b .ConsumeID (TextDateTypeID ); err != nil {
return fmt .Errorf ("unable to decode textDate#a5b45e2b: %w" , err )
}
return t .DecodeBare (b )
}
func (t *TextDate ) DecodeBare (b *bin .Buffer ) error {
if t == nil {
return fmt .Errorf ("can't decode textDate#a5b45e2b to nil" )
}
{
if err := t .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode textDate#a5b45e2b: field flags: %w" , err )
}
}
t .Relative = t .Flags .Has (0 )
t .ShortTime = t .Flags .Has (1 )
t .LongTime = t .Flags .Has (2 )
t .ShortDate = t .Flags .Has (3 )
t .LongDate = t .Flags .Has (4 )
t .DayOfWeek = t .Flags .Has (5 )
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode textDate#a5b45e2b: field text: %w" , err )
}
t .Text = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode textDate#a5b45e2b: field date: %w" , err )
}
t .Date = value
}
return nil
}
func (t *TextDate ) SetRelative (value bool ) {
if value {
t .Flags .Set (0 )
t .Relative = true
} else {
t .Flags .Unset (0 )
t .Relative = false
}
}
func (t *TextDate ) GetRelative () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (0 )
}
func (t *TextDate ) SetShortTime (value bool ) {
if value {
t .Flags .Set (1 )
t .ShortTime = true
} else {
t .Flags .Unset (1 )
t .ShortTime = false
}
}
func (t *TextDate ) GetShortTime () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (1 )
}
func (t *TextDate ) SetLongTime (value bool ) {
if value {
t .Flags .Set (2 )
t .LongTime = true
} else {
t .Flags .Unset (2 )
t .LongTime = false
}
}
func (t *TextDate ) GetLongTime () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (2 )
}
func (t *TextDate ) SetShortDate (value bool ) {
if value {
t .Flags .Set (3 )
t .ShortDate = true
} else {
t .Flags .Unset (3 )
t .ShortDate = false
}
}
func (t *TextDate ) GetShortDate () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (3 )
}
func (t *TextDate ) SetLongDate (value bool ) {
if value {
t .Flags .Set (4 )
t .LongDate = true
} else {
t .Flags .Unset (4 )
t .LongDate = false
}
}
func (t *TextDate ) GetLongDate () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (4 )
}
func (t *TextDate ) SetDayOfWeek (value bool ) {
if value {
t .Flags .Set (5 )
t .DayOfWeek = true
} else {
t .Flags .Unset (5 )
t .DayOfWeek = false
}
}
func (t *TextDate ) GetDayOfWeek () (value bool ) {
if t == nil {
return
}
return t .Flags .Has (5 )
}
func (t *TextDate ) GetText () (value RichTextClass ) {
if t == nil {
return
}
return t .Text
}
func (t *TextDate ) GetDate () (value int ) {
if t == nil {
return
}
return t .Date
}
const RichTextClassName = "RichText"
type RichTextClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () RichTextClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeRichText (buf *bin .Buffer ) (RichTextClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case TextEmptyTypeID :
v := TextEmpty {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextPlainTypeID :
v := TextPlain {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextBoldTypeID :
v := TextBold {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextItalicTypeID :
v := TextItalic {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextUnderlineTypeID :
v := TextUnderline {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextStrikeTypeID :
v := TextStrike {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextFixedTypeID :
v := TextFixed {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextURLTypeID :
v := TextURL {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextEmailTypeID :
v := TextEmail {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextConcatTypeID :
v := TextConcat {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextSubscriptTypeID :
v := TextSubscript {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextSuperscriptTypeID :
v := TextSuperscript {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextMarkedTypeID :
v := TextMarked {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextPhoneTypeID :
v := TextPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextImageTypeID :
v := TextImage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextAnchorTypeID :
v := TextAnchor {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextMathTypeID :
v := TextMath {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextCustomEmojiTypeID :
v := TextCustomEmoji {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextSpoilerTypeID :
v := TextSpoiler {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextMentionTypeID :
v := TextMention {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextHashtagTypeID :
v := TextHashtag {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextBotCommandTypeID :
v := TextBotCommand {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextCashtagTypeID :
v := TextCashtag {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextAutoURLTypeID :
v := TextAutoURL {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextAutoEmailTypeID :
v := TextAutoEmail {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextAutoPhoneTypeID :
v := TextAutoPhone {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextBankCardTypeID :
v := TextBankCard {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextMentionNameTypeID :
v := TextMentionName {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
case TextDateTypeID :
v := TextDate {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode RichTextClass: %w" , bin .NewUnexpectedID (id ))
}
}
type RichTextBox struct {
RichText RichTextClass
}
func (b *RichTextBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode RichTextBox to nil" )
}
v , err := DecodeRichText (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .RichText = v
return nil
}
func (b *RichTextBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .RichText == nil {
return fmt .Errorf ("unable to encode RichTextClass as nil" )
}
return b .RichText .Encode (buf )
}
The pages are generated with Golds v0.8.4 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .