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
}
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
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.6.7 . (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .