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 PageBlockUnsupported struct {
}
const PageBlockUnsupportedTypeID = 0x13567e8a
func (p PageBlockUnsupported ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockUnsupported {}
_ bin .Decoder = &PageBlockUnsupported {}
_ bin .BareEncoder = &PageBlockUnsupported {}
_ bin .BareDecoder = &PageBlockUnsupported {}
_ PageBlockClass = &PageBlockUnsupported {}
)
func (p *PageBlockUnsupported ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PageBlockUnsupported ) String () string {
if p == nil {
return "PageBlockUnsupported(nil)"
}
type Alias PageBlockUnsupported
return fmt .Sprintf ("PageBlockUnsupported%+v" , Alias (*p ))
}
func (*PageBlockUnsupported ) TypeID () uint32 {
return PageBlockUnsupportedTypeID
}
func (*PageBlockUnsupported ) TypeName () string {
return "pageBlockUnsupported"
}
func (p *PageBlockUnsupported ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockUnsupported" ,
ID : PageBlockUnsupportedTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PageBlockUnsupported ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockUnsupported#13567e8a as nil" )
}
b .PutID (PageBlockUnsupportedTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockUnsupported ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockUnsupported#13567e8a as nil" )
}
return nil
}
func (p *PageBlockUnsupported ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockUnsupported#13567e8a to nil" )
}
if err := b .ConsumeID (PageBlockUnsupportedTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockUnsupported#13567e8a: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockUnsupported ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockUnsupported#13567e8a to nil" )
}
return nil
}
type PageBlockTitle struct {
Text RichTextClass
}
const PageBlockTitleTypeID = 0x70abc3fd
func (p PageBlockTitle ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockTitle {}
_ bin .Decoder = &PageBlockTitle {}
_ bin .BareEncoder = &PageBlockTitle {}
_ bin .BareDecoder = &PageBlockTitle {}
_ PageBlockClass = &PageBlockTitle {}
)
func (p *PageBlockTitle ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockTitle ) String () string {
if p == nil {
return "PageBlockTitle(nil)"
}
type Alias PageBlockTitle
return fmt .Sprintf ("PageBlockTitle%+v" , Alias (*p ))
}
func (p *PageBlockTitle ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockTitle ) TypeID () uint32 {
return PageBlockTitleTypeID
}
func (*PageBlockTitle ) TypeName () string {
return "pageBlockTitle"
}
func (p *PageBlockTitle ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockTitle" ,
ID : PageBlockTitleTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockTitle ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockTitle#70abc3fd as nil" )
}
b .PutID (PageBlockTitleTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockTitle ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockTitle#70abc3fd as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockTitle#70abc3fd: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockTitle#70abc3fd: field text: %w" , err )
}
return nil
}
func (p *PageBlockTitle ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockTitle#70abc3fd to nil" )
}
if err := b .ConsumeID (PageBlockTitleTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockTitle#70abc3fd: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockTitle ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockTitle#70abc3fd to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockTitle#70abc3fd: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockTitle ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockSubtitle struct {
Text RichTextClass
}
const PageBlockSubtitleTypeID = 0x8ffa9a1f
func (p PageBlockSubtitle ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockSubtitle {}
_ bin .Decoder = &PageBlockSubtitle {}
_ bin .BareEncoder = &PageBlockSubtitle {}
_ bin .BareDecoder = &PageBlockSubtitle {}
_ PageBlockClass = &PageBlockSubtitle {}
)
func (p *PageBlockSubtitle ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockSubtitle ) String () string {
if p == nil {
return "PageBlockSubtitle(nil)"
}
type Alias PageBlockSubtitle
return fmt .Sprintf ("PageBlockSubtitle%+v" , Alias (*p ))
}
func (p *PageBlockSubtitle ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockSubtitle ) TypeID () uint32 {
return PageBlockSubtitleTypeID
}
func (*PageBlockSubtitle ) TypeName () string {
return "pageBlockSubtitle"
}
func (p *PageBlockSubtitle ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockSubtitle" ,
ID : PageBlockSubtitleTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockSubtitle ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSubtitle#8ffa9a1f as nil" )
}
b .PutID (PageBlockSubtitleTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockSubtitle ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSubtitle#8ffa9a1f as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockSubtitle#8ffa9a1f: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockSubtitle#8ffa9a1f: field text: %w" , err )
}
return nil
}
func (p *PageBlockSubtitle ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSubtitle#8ffa9a1f to nil" )
}
if err := b .ConsumeID (PageBlockSubtitleTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockSubtitle#8ffa9a1f: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockSubtitle ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSubtitle#8ffa9a1f to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockSubtitle#8ffa9a1f: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockSubtitle ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockAuthorDate struct {
Author RichTextClass
PublishedDate int
}
const PageBlockAuthorDateTypeID = 0xbaafe5e0
func (p PageBlockAuthorDate ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockAuthorDate {}
_ bin .Decoder = &PageBlockAuthorDate {}
_ bin .BareEncoder = &PageBlockAuthorDate {}
_ bin .BareDecoder = &PageBlockAuthorDate {}
_ PageBlockClass = &PageBlockAuthorDate {}
)
func (p *PageBlockAuthorDate ) Zero () bool {
if p == nil {
return true
}
if !(p .Author == nil ) {
return false
}
if !(p .PublishedDate == 0 ) {
return false
}
return true
}
func (p *PageBlockAuthorDate ) String () string {
if p == nil {
return "PageBlockAuthorDate(nil)"
}
type Alias PageBlockAuthorDate
return fmt .Sprintf ("PageBlockAuthorDate%+v" , Alias (*p ))
}
func (p *PageBlockAuthorDate ) FillFrom (from interface {
GetAuthor () (value RichTextClass )
GetPublishedDate () (value int )
}) {
p .Author = from .GetAuthor ()
p .PublishedDate = from .GetPublishedDate ()
}
func (*PageBlockAuthorDate ) TypeID () uint32 {
return PageBlockAuthorDateTypeID
}
func (*PageBlockAuthorDate ) TypeName () string {
return "pageBlockAuthorDate"
}
func (p *PageBlockAuthorDate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockAuthorDate" ,
ID : PageBlockAuthorDateTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Author" ,
SchemaName : "author" ,
},
{
Name : "PublishedDate" ,
SchemaName : "published_date" ,
},
}
return typ
}
func (p *PageBlockAuthorDate ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAuthorDate#baafe5e0 as nil" )
}
b .PutID (PageBlockAuthorDateTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockAuthorDate ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAuthorDate#baafe5e0 as nil" )
}
if p .Author == nil {
return fmt .Errorf ("unable to encode pageBlockAuthorDate#baafe5e0: field author is nil" )
}
if err := p .Author .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockAuthorDate#baafe5e0: field author: %w" , err )
}
b .PutInt (p .PublishedDate )
return nil
}
func (p *PageBlockAuthorDate ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAuthorDate#baafe5e0 to nil" )
}
if err := b .ConsumeID (PageBlockAuthorDateTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockAuthorDate#baafe5e0: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockAuthorDate ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAuthorDate#baafe5e0 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockAuthorDate#baafe5e0: field author: %w" , err )
}
p .Author = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockAuthorDate#baafe5e0: field published_date: %w" , err )
}
p .PublishedDate = value
}
return nil
}
func (p *PageBlockAuthorDate ) GetAuthor () (value RichTextClass ) {
if p == nil {
return
}
return p .Author
}
func (p *PageBlockAuthorDate ) GetPublishedDate () (value int ) {
if p == nil {
return
}
return p .PublishedDate
}
type PageBlockHeader struct {
Text RichTextClass
}
const PageBlockHeaderTypeID = 0xbfd064ec
func (p PageBlockHeader ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockHeader {}
_ bin .Decoder = &PageBlockHeader {}
_ bin .BareEncoder = &PageBlockHeader {}
_ bin .BareDecoder = &PageBlockHeader {}
_ PageBlockClass = &PageBlockHeader {}
)
func (p *PageBlockHeader ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockHeader ) String () string {
if p == nil {
return "PageBlockHeader(nil)"
}
type Alias PageBlockHeader
return fmt .Sprintf ("PageBlockHeader%+v" , Alias (*p ))
}
func (p *PageBlockHeader ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockHeader ) TypeID () uint32 {
return PageBlockHeaderTypeID
}
func (*PageBlockHeader ) TypeName () string {
return "pageBlockHeader"
}
func (p *PageBlockHeader ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockHeader" ,
ID : PageBlockHeaderTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockHeader ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockHeader#bfd064ec as nil" )
}
b .PutID (PageBlockHeaderTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockHeader ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockHeader#bfd064ec as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockHeader#bfd064ec: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockHeader#bfd064ec: field text: %w" , err )
}
return nil
}
func (p *PageBlockHeader ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockHeader#bfd064ec to nil" )
}
if err := b .ConsumeID (PageBlockHeaderTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockHeader#bfd064ec: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockHeader ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockHeader#bfd064ec to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockHeader#bfd064ec: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockHeader ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockSubheader struct {
Text RichTextClass
}
const PageBlockSubheaderTypeID = 0xf12bb6e1
func (p PageBlockSubheader ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockSubheader {}
_ bin .Decoder = &PageBlockSubheader {}
_ bin .BareEncoder = &PageBlockSubheader {}
_ bin .BareDecoder = &PageBlockSubheader {}
_ PageBlockClass = &PageBlockSubheader {}
)
func (p *PageBlockSubheader ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockSubheader ) String () string {
if p == nil {
return "PageBlockSubheader(nil)"
}
type Alias PageBlockSubheader
return fmt .Sprintf ("PageBlockSubheader%+v" , Alias (*p ))
}
func (p *PageBlockSubheader ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockSubheader ) TypeID () uint32 {
return PageBlockSubheaderTypeID
}
func (*PageBlockSubheader ) TypeName () string {
return "pageBlockSubheader"
}
func (p *PageBlockSubheader ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockSubheader" ,
ID : PageBlockSubheaderTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockSubheader ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSubheader#f12bb6e1 as nil" )
}
b .PutID (PageBlockSubheaderTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockSubheader ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSubheader#f12bb6e1 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockSubheader#f12bb6e1: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockSubheader#f12bb6e1: field text: %w" , err )
}
return nil
}
func (p *PageBlockSubheader ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSubheader#f12bb6e1 to nil" )
}
if err := b .ConsumeID (PageBlockSubheaderTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockSubheader#f12bb6e1: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockSubheader ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSubheader#f12bb6e1 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockSubheader#f12bb6e1: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockSubheader ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockParagraph struct {
Text RichTextClass
}
const PageBlockParagraphTypeID = 0x467a0766
func (p PageBlockParagraph ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockParagraph {}
_ bin .Decoder = &PageBlockParagraph {}
_ bin .BareEncoder = &PageBlockParagraph {}
_ bin .BareDecoder = &PageBlockParagraph {}
_ PageBlockClass = &PageBlockParagraph {}
)
func (p *PageBlockParagraph ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockParagraph ) String () string {
if p == nil {
return "PageBlockParagraph(nil)"
}
type Alias PageBlockParagraph
return fmt .Sprintf ("PageBlockParagraph%+v" , Alias (*p ))
}
func (p *PageBlockParagraph ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockParagraph ) TypeID () uint32 {
return PageBlockParagraphTypeID
}
func (*PageBlockParagraph ) TypeName () string {
return "pageBlockParagraph"
}
func (p *PageBlockParagraph ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockParagraph" ,
ID : PageBlockParagraphTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockParagraph ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockParagraph#467a0766 as nil" )
}
b .PutID (PageBlockParagraphTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockParagraph ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockParagraph#467a0766 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockParagraph#467a0766: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockParagraph#467a0766: field text: %w" , err )
}
return nil
}
func (p *PageBlockParagraph ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockParagraph#467a0766 to nil" )
}
if err := b .ConsumeID (PageBlockParagraphTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockParagraph#467a0766: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockParagraph ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockParagraph#467a0766 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockParagraph#467a0766: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockParagraph ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockPreformatted struct {
Text RichTextClass
Language string
}
const PageBlockPreformattedTypeID = 0xc070d93e
func (p PageBlockPreformatted ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockPreformatted {}
_ bin .Decoder = &PageBlockPreformatted {}
_ bin .BareEncoder = &PageBlockPreformatted {}
_ bin .BareDecoder = &PageBlockPreformatted {}
_ PageBlockClass = &PageBlockPreformatted {}
)
func (p *PageBlockPreformatted ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
if !(p .Language == "" ) {
return false
}
return true
}
func (p *PageBlockPreformatted ) String () string {
if p == nil {
return "PageBlockPreformatted(nil)"
}
type Alias PageBlockPreformatted
return fmt .Sprintf ("PageBlockPreformatted%+v" , Alias (*p ))
}
func (p *PageBlockPreformatted ) FillFrom (from interface {
GetText () (value RichTextClass )
GetLanguage () (value string )
}) {
p .Text = from .GetText ()
p .Language = from .GetLanguage ()
}
func (*PageBlockPreformatted ) TypeID () uint32 {
return PageBlockPreformattedTypeID
}
func (*PageBlockPreformatted ) TypeName () string {
return "pageBlockPreformatted"
}
func (p *PageBlockPreformatted ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockPreformatted" ,
ID : PageBlockPreformattedTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Language" ,
SchemaName : "language" ,
},
}
return typ
}
func (p *PageBlockPreformatted ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPreformatted#c070d93e as nil" )
}
b .PutID (PageBlockPreformattedTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockPreformatted ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPreformatted#c070d93e as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockPreformatted#c070d93e: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockPreformatted#c070d93e: field text: %w" , err )
}
b .PutString (p .Language )
return nil
}
func (p *PageBlockPreformatted ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPreformatted#c070d93e to nil" )
}
if err := b .ConsumeID (PageBlockPreformattedTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockPreformatted#c070d93e: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockPreformatted ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPreformatted#c070d93e to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPreformatted#c070d93e: field text: %w" , err )
}
p .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPreformatted#c070d93e: field language: %w" , err )
}
p .Language = value
}
return nil
}
func (p *PageBlockPreformatted ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
func (p *PageBlockPreformatted ) GetLanguage () (value string ) {
if p == nil {
return
}
return p .Language
}
type PageBlockFooter struct {
Text RichTextClass
}
const PageBlockFooterTypeID = 0x48870999
func (p PageBlockFooter ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockFooter {}
_ bin .Decoder = &PageBlockFooter {}
_ bin .BareEncoder = &PageBlockFooter {}
_ bin .BareDecoder = &PageBlockFooter {}
_ PageBlockClass = &PageBlockFooter {}
)
func (p *PageBlockFooter ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockFooter ) String () string {
if p == nil {
return "PageBlockFooter(nil)"
}
type Alias PageBlockFooter
return fmt .Sprintf ("PageBlockFooter%+v" , Alias (*p ))
}
func (p *PageBlockFooter ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockFooter ) TypeID () uint32 {
return PageBlockFooterTypeID
}
func (*PageBlockFooter ) TypeName () string {
return "pageBlockFooter"
}
func (p *PageBlockFooter ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockFooter" ,
ID : PageBlockFooterTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockFooter ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockFooter#48870999 as nil" )
}
b .PutID (PageBlockFooterTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockFooter ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockFooter#48870999 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockFooter#48870999: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockFooter#48870999: field text: %w" , err )
}
return nil
}
func (p *PageBlockFooter ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockFooter#48870999 to nil" )
}
if err := b .ConsumeID (PageBlockFooterTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockFooter#48870999: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockFooter ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockFooter#48870999 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockFooter#48870999: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockFooter ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockDivider struct {
}
const PageBlockDividerTypeID = 0xdb20b188
func (p PageBlockDivider ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockDivider {}
_ bin .Decoder = &PageBlockDivider {}
_ bin .BareEncoder = &PageBlockDivider {}
_ bin .BareDecoder = &PageBlockDivider {}
_ PageBlockClass = &PageBlockDivider {}
)
func (p *PageBlockDivider ) Zero () bool {
if p == nil {
return true
}
return true
}
func (p *PageBlockDivider ) String () string {
if p == nil {
return "PageBlockDivider(nil)"
}
type Alias PageBlockDivider
return fmt .Sprintf ("PageBlockDivider%+v" , Alias (*p ))
}
func (*PageBlockDivider ) TypeID () uint32 {
return PageBlockDividerTypeID
}
func (*PageBlockDivider ) TypeName () string {
return "pageBlockDivider"
}
func (p *PageBlockDivider ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockDivider" ,
ID : PageBlockDividerTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (p *PageBlockDivider ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockDivider#db20b188 as nil" )
}
b .PutID (PageBlockDividerTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockDivider ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockDivider#db20b188 as nil" )
}
return nil
}
func (p *PageBlockDivider ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockDivider#db20b188 to nil" )
}
if err := b .ConsumeID (PageBlockDividerTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockDivider#db20b188: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockDivider ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockDivider#db20b188 to nil" )
}
return nil
}
type PageBlockAnchor struct {
Name string
}
const PageBlockAnchorTypeID = 0xce0d37b0
func (p PageBlockAnchor ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockAnchor {}
_ bin .Decoder = &PageBlockAnchor {}
_ bin .BareEncoder = &PageBlockAnchor {}
_ bin .BareDecoder = &PageBlockAnchor {}
_ PageBlockClass = &PageBlockAnchor {}
)
func (p *PageBlockAnchor ) Zero () bool {
if p == nil {
return true
}
if !(p .Name == "" ) {
return false
}
return true
}
func (p *PageBlockAnchor ) String () string {
if p == nil {
return "PageBlockAnchor(nil)"
}
type Alias PageBlockAnchor
return fmt .Sprintf ("PageBlockAnchor%+v" , Alias (*p ))
}
func (p *PageBlockAnchor ) FillFrom (from interface {
GetName () (value string )
}) {
p .Name = from .GetName ()
}
func (*PageBlockAnchor ) TypeID () uint32 {
return PageBlockAnchorTypeID
}
func (*PageBlockAnchor ) TypeName () string {
return "pageBlockAnchor"
}
func (p *PageBlockAnchor ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockAnchor" ,
ID : PageBlockAnchorTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Name" ,
SchemaName : "name" ,
},
}
return typ
}
func (p *PageBlockAnchor ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAnchor#ce0d37b0 as nil" )
}
b .PutID (PageBlockAnchorTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockAnchor ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAnchor#ce0d37b0 as nil" )
}
b .PutString (p .Name )
return nil
}
func (p *PageBlockAnchor ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAnchor#ce0d37b0 to nil" )
}
if err := b .ConsumeID (PageBlockAnchorTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockAnchor#ce0d37b0: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockAnchor ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAnchor#ce0d37b0 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockAnchor#ce0d37b0: field name: %w" , err )
}
p .Name = value
}
return nil
}
func (p *PageBlockAnchor ) GetName () (value string ) {
if p == nil {
return
}
return p .Name
}
type PageBlockList struct {
Items []PageListItemClass
}
const PageBlockListTypeID = 0xe4e88011
func (p PageBlockList ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockList {}
_ bin .Decoder = &PageBlockList {}
_ bin .BareEncoder = &PageBlockList {}
_ bin .BareDecoder = &PageBlockList {}
_ PageBlockClass = &PageBlockList {}
)
func (p *PageBlockList ) Zero () bool {
if p == nil {
return true
}
if !(p .Items == nil ) {
return false
}
return true
}
func (p *PageBlockList ) String () string {
if p == nil {
return "PageBlockList(nil)"
}
type Alias PageBlockList
return fmt .Sprintf ("PageBlockList%+v" , Alias (*p ))
}
func (p *PageBlockList ) FillFrom (from interface {
GetItems () (value []PageListItemClass )
}) {
p .Items = from .GetItems ()
}
func (*PageBlockList ) TypeID () uint32 {
return PageBlockListTypeID
}
func (*PageBlockList ) TypeName () string {
return "pageBlockList"
}
func (p *PageBlockList ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockList" ,
ID : PageBlockListTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Items" ,
SchemaName : "items" ,
},
}
return typ
}
func (p *PageBlockList ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockList#e4e88011 as nil" )
}
b .PutID (PageBlockListTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockList ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockList#e4e88011 as nil" )
}
b .PutVectorHeader (len (p .Items ))
for idx , v := range p .Items {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockList#e4e88011: field items element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockList#e4e88011: field items element with index %d: %w" , idx , err )
}
}
return nil
}
func (p *PageBlockList ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockList#e4e88011 to nil" )
}
if err := b .ConsumeID (PageBlockListTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockList#e4e88011: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockList ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockList#e4e88011 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockList#e4e88011: field items: %w" , err )
}
if headerLen > 0 {
p .Items = make ([]PageListItemClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageListItem (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockList#e4e88011: field items: %w" , err )
}
p .Items = append (p .Items , value )
}
}
return nil
}
func (p *PageBlockList ) GetItems () (value []PageListItemClass ) {
if p == nil {
return
}
return p .Items
}
func (p *PageBlockList ) MapItems () (value PageListItemClassArray ) {
return PageListItemClassArray (p .Items )
}
type PageBlockBlockquote struct {
Text RichTextClass
Caption RichTextClass
}
const PageBlockBlockquoteTypeID = 0x263d7c26
func (p PageBlockBlockquote ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockBlockquote {}
_ bin .Decoder = &PageBlockBlockquote {}
_ bin .BareEncoder = &PageBlockBlockquote {}
_ bin .BareDecoder = &PageBlockBlockquote {}
_ PageBlockClass = &PageBlockBlockquote {}
)
func (p *PageBlockBlockquote ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
if !(p .Caption == nil ) {
return false
}
return true
}
func (p *PageBlockBlockquote ) String () string {
if p == nil {
return "PageBlockBlockquote(nil)"
}
type Alias PageBlockBlockquote
return fmt .Sprintf ("PageBlockBlockquote%+v" , Alias (*p ))
}
func (p *PageBlockBlockquote ) FillFrom (from interface {
GetText () (value RichTextClass )
GetCaption () (value RichTextClass )
}) {
p .Text = from .GetText ()
p .Caption = from .GetCaption ()
}
func (*PageBlockBlockquote ) TypeID () uint32 {
return PageBlockBlockquoteTypeID
}
func (*PageBlockBlockquote ) TypeName () string {
return "pageBlockBlockquote"
}
func (p *PageBlockBlockquote ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockBlockquote" ,
ID : PageBlockBlockquoteTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockBlockquote ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockBlockquote#263d7c26 as nil" )
}
b .PutID (PageBlockBlockquoteTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockBlockquote ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockBlockquote#263d7c26 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockBlockquote#263d7c26: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockBlockquote#263d7c26: field text: %w" , err )
}
if p .Caption == nil {
return fmt .Errorf ("unable to encode pageBlockBlockquote#263d7c26: field caption is nil" )
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockBlockquote#263d7c26: field caption: %w" , err )
}
return nil
}
func (p *PageBlockBlockquote ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockBlockquote#263d7c26 to nil" )
}
if err := b .ConsumeID (PageBlockBlockquoteTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockBlockquote#263d7c26: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockBlockquote ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockBlockquote#263d7c26 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockBlockquote#263d7c26: field text: %w" , err )
}
p .Text = value
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockBlockquote#263d7c26: field caption: %w" , err )
}
p .Caption = value
}
return nil
}
func (p *PageBlockBlockquote ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
func (p *PageBlockBlockquote ) GetCaption () (value RichTextClass ) {
if p == nil {
return
}
return p .Caption
}
type PageBlockPullquote struct {
Text RichTextClass
Caption RichTextClass
}
const PageBlockPullquoteTypeID = 0x4f4456d3
func (p PageBlockPullquote ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockPullquote {}
_ bin .Decoder = &PageBlockPullquote {}
_ bin .BareEncoder = &PageBlockPullquote {}
_ bin .BareDecoder = &PageBlockPullquote {}
_ PageBlockClass = &PageBlockPullquote {}
)
func (p *PageBlockPullquote ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
if !(p .Caption == nil ) {
return false
}
return true
}
func (p *PageBlockPullquote ) String () string {
if p == nil {
return "PageBlockPullquote(nil)"
}
type Alias PageBlockPullquote
return fmt .Sprintf ("PageBlockPullquote%+v" , Alias (*p ))
}
func (p *PageBlockPullquote ) FillFrom (from interface {
GetText () (value RichTextClass )
GetCaption () (value RichTextClass )
}) {
p .Text = from .GetText ()
p .Caption = from .GetCaption ()
}
func (*PageBlockPullquote ) TypeID () uint32 {
return PageBlockPullquoteTypeID
}
func (*PageBlockPullquote ) TypeName () string {
return "pageBlockPullquote"
}
func (p *PageBlockPullquote ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockPullquote" ,
ID : PageBlockPullquoteTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockPullquote ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPullquote#4f4456d3 as nil" )
}
b .PutID (PageBlockPullquoteTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockPullquote ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPullquote#4f4456d3 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockPullquote#4f4456d3: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockPullquote#4f4456d3: field text: %w" , err )
}
if p .Caption == nil {
return fmt .Errorf ("unable to encode pageBlockPullquote#4f4456d3: field caption is nil" )
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockPullquote#4f4456d3: field caption: %w" , err )
}
return nil
}
func (p *PageBlockPullquote ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPullquote#4f4456d3 to nil" )
}
if err := b .ConsumeID (PageBlockPullquoteTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockPullquote#4f4456d3: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockPullquote ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPullquote#4f4456d3 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPullquote#4f4456d3: field text: %w" , err )
}
p .Text = value
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPullquote#4f4456d3: field caption: %w" , err )
}
p .Caption = value
}
return nil
}
func (p *PageBlockPullquote ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
func (p *PageBlockPullquote ) GetCaption () (value RichTextClass ) {
if p == nil {
return
}
return p .Caption
}
type PageBlockPhoto struct {
Flags bin .Fields
PhotoID int64
Caption PageCaption
URL string
WebpageID int64
}
const PageBlockPhotoTypeID = 0x1759c560
func (p PageBlockPhoto ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockPhoto {}
_ bin .Decoder = &PageBlockPhoto {}
_ bin .BareEncoder = &PageBlockPhoto {}
_ bin .BareDecoder = &PageBlockPhoto {}
_ PageBlockClass = &PageBlockPhoto {}
)
func (p *PageBlockPhoto ) Zero () bool {
if p == nil {
return true
}
if !(p .Flags .Zero ()) {
return false
}
if !(p .PhotoID == 0 ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
if !(p .URL == "" ) {
return false
}
if !(p .WebpageID == 0 ) {
return false
}
return true
}
func (p *PageBlockPhoto ) String () string {
if p == nil {
return "PageBlockPhoto(nil)"
}
type Alias PageBlockPhoto
return fmt .Sprintf ("PageBlockPhoto%+v" , Alias (*p ))
}
func (p *PageBlockPhoto ) FillFrom (from interface {
GetPhotoID () (value int64 )
GetCaption () (value PageCaption )
GetURL () (value string , ok bool )
GetWebpageID () (value int64 , ok bool )
}) {
p .PhotoID = from .GetPhotoID ()
p .Caption = from .GetCaption ()
if val , ok := from .GetURL (); ok {
p .URL = val
}
if val , ok := from .GetWebpageID (); ok {
p .WebpageID = val
}
}
func (*PageBlockPhoto ) TypeID () uint32 {
return PageBlockPhotoTypeID
}
func (*PageBlockPhoto ) TypeName () string {
return "pageBlockPhoto"
}
func (p *PageBlockPhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockPhoto" ,
ID : PageBlockPhotoTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "PhotoID" ,
SchemaName : "photo_id" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
{
Name : "URL" ,
SchemaName : "url" ,
Null : !p .Flags .Has (0 ),
},
{
Name : "WebpageID" ,
SchemaName : "webpage_id" ,
Null : !p .Flags .Has (0 ),
},
}
return typ
}
func (p *PageBlockPhoto ) SetFlags () {
if !(p .URL == "" ) {
p .Flags .Set (0 )
}
if !(p .WebpageID == 0 ) {
p .Flags .Set (0 )
}
}
func (p *PageBlockPhoto ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPhoto#1759c560 as nil" )
}
b .PutID (PageBlockPhotoTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockPhoto ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockPhoto#1759c560 as nil" )
}
p .SetFlags ()
if err := p .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockPhoto#1759c560: field flags: %w" , err )
}
b .PutLong (p .PhotoID )
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockPhoto#1759c560: field caption: %w" , err )
}
if p .Flags .Has (0 ) {
b .PutString (p .URL )
}
if p .Flags .Has (0 ) {
b .PutLong (p .WebpageID )
}
return nil
}
func (p *PageBlockPhoto ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPhoto#1759c560 to nil" )
}
if err := b .ConsumeID (PageBlockPhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockPhoto ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockPhoto#1759c560 to nil" )
}
{
if err := p .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: field flags: %w" , err )
}
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: field photo_id: %w" , err )
}
p .PhotoID = value
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: field caption: %w" , err )
}
}
if p .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: field url: %w" , err )
}
p .URL = value
}
if p .Flags .Has (0 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockPhoto#1759c560: field webpage_id: %w" , err )
}
p .WebpageID = value
}
return nil
}
func (p *PageBlockPhoto ) GetPhotoID () (value int64 ) {
if p == nil {
return
}
return p .PhotoID
}
func (p *PageBlockPhoto ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
func (p *PageBlockPhoto ) SetURL (value string ) {
p .Flags .Set (0 )
p .URL = value
}
func (p *PageBlockPhoto ) GetURL () (value string , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (0 ) {
return value , false
}
return p .URL , true
}
func (p *PageBlockPhoto ) SetWebpageID (value int64 ) {
p .Flags .Set (0 )
p .WebpageID = value
}
func (p *PageBlockPhoto ) GetWebpageID () (value int64 , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (0 ) {
return value , false
}
return p .WebpageID , true
}
type PageBlockVideo struct {
Flags bin .Fields
Autoplay bool
Loop bool
VideoID int64
Caption PageCaption
}
const PageBlockVideoTypeID = 0x7c8fe7b6
func (p PageBlockVideo ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockVideo {}
_ bin .Decoder = &PageBlockVideo {}
_ bin .BareEncoder = &PageBlockVideo {}
_ bin .BareDecoder = &PageBlockVideo {}
_ PageBlockClass = &PageBlockVideo {}
)
func (p *PageBlockVideo ) Zero () bool {
if p == nil {
return true
}
if !(p .Flags .Zero ()) {
return false
}
if !(p .Autoplay == false ) {
return false
}
if !(p .Loop == false ) {
return false
}
if !(p .VideoID == 0 ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockVideo ) String () string {
if p == nil {
return "PageBlockVideo(nil)"
}
type Alias PageBlockVideo
return fmt .Sprintf ("PageBlockVideo%+v" , Alias (*p ))
}
func (p *PageBlockVideo ) FillFrom (from interface {
GetAutoplay () (value bool )
GetLoop () (value bool )
GetVideoID () (value int64 )
GetCaption () (value PageCaption )
}) {
p .Autoplay = from .GetAutoplay ()
p .Loop = from .GetLoop ()
p .VideoID = from .GetVideoID ()
p .Caption = from .GetCaption ()
}
func (*PageBlockVideo ) TypeID () uint32 {
return PageBlockVideoTypeID
}
func (*PageBlockVideo ) TypeName () string {
return "pageBlockVideo"
}
func (p *PageBlockVideo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockVideo" ,
ID : PageBlockVideoTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Autoplay" ,
SchemaName : "autoplay" ,
Null : !p .Flags .Has (0 ),
},
{
Name : "Loop" ,
SchemaName : "loop" ,
Null : !p .Flags .Has (1 ),
},
{
Name : "VideoID" ,
SchemaName : "video_id" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockVideo ) SetFlags () {
if !(p .Autoplay == false ) {
p .Flags .Set (0 )
}
if !(p .Loop == false ) {
p .Flags .Set (1 )
}
}
func (p *PageBlockVideo ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockVideo#7c8fe7b6 as nil" )
}
b .PutID (PageBlockVideoTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockVideo ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockVideo#7c8fe7b6 as nil" )
}
p .SetFlags ()
if err := p .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockVideo#7c8fe7b6: field flags: %w" , err )
}
b .PutLong (p .VideoID )
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockVideo#7c8fe7b6: field caption: %w" , err )
}
return nil
}
func (p *PageBlockVideo ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockVideo#7c8fe7b6 to nil" )
}
if err := b .ConsumeID (PageBlockVideoTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockVideo#7c8fe7b6: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockVideo ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockVideo#7c8fe7b6 to nil" )
}
{
if err := p .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockVideo#7c8fe7b6: field flags: %w" , err )
}
}
p .Autoplay = p .Flags .Has (0 )
p .Loop = p .Flags .Has (1 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockVideo#7c8fe7b6: field video_id: %w" , err )
}
p .VideoID = value
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockVideo#7c8fe7b6: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockVideo ) SetAutoplay (value bool ) {
if value {
p .Flags .Set (0 )
p .Autoplay = true
} else {
p .Flags .Unset (0 )
p .Autoplay = false
}
}
func (p *PageBlockVideo ) GetAutoplay () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (0 )
}
func (p *PageBlockVideo ) SetLoop (value bool ) {
if value {
p .Flags .Set (1 )
p .Loop = true
} else {
p .Flags .Unset (1 )
p .Loop = false
}
}
func (p *PageBlockVideo ) GetLoop () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (1 )
}
func (p *PageBlockVideo ) GetVideoID () (value int64 ) {
if p == nil {
return
}
return p .VideoID
}
func (p *PageBlockVideo ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
type PageBlockCover struct {
Cover PageBlockClass
}
const PageBlockCoverTypeID = 0x39f23300
func (p PageBlockCover ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockCover {}
_ bin .Decoder = &PageBlockCover {}
_ bin .BareEncoder = &PageBlockCover {}
_ bin .BareDecoder = &PageBlockCover {}
_ PageBlockClass = &PageBlockCover {}
)
func (p *PageBlockCover ) Zero () bool {
if p == nil {
return true
}
if !(p .Cover == nil ) {
return false
}
return true
}
func (p *PageBlockCover ) String () string {
if p == nil {
return "PageBlockCover(nil)"
}
type Alias PageBlockCover
return fmt .Sprintf ("PageBlockCover%+v" , Alias (*p ))
}
func (p *PageBlockCover ) FillFrom (from interface {
GetCover () (value PageBlockClass )
}) {
p .Cover = from .GetCover ()
}
func (*PageBlockCover ) TypeID () uint32 {
return PageBlockCoverTypeID
}
func (*PageBlockCover ) TypeName () string {
return "pageBlockCover"
}
func (p *PageBlockCover ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockCover" ,
ID : PageBlockCoverTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Cover" ,
SchemaName : "cover" ,
},
}
return typ
}
func (p *PageBlockCover ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockCover#39f23300 as nil" )
}
b .PutID (PageBlockCoverTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockCover ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockCover#39f23300 as nil" )
}
if p .Cover == nil {
return fmt .Errorf ("unable to encode pageBlockCover#39f23300: field cover is nil" )
}
if err := p .Cover .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockCover#39f23300: field cover: %w" , err )
}
return nil
}
func (p *PageBlockCover ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockCover#39f23300 to nil" )
}
if err := b .ConsumeID (PageBlockCoverTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockCover#39f23300: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockCover ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockCover#39f23300 to nil" )
}
{
value , err := DecodePageBlock (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockCover#39f23300: field cover: %w" , err )
}
p .Cover = value
}
return nil
}
func (p *PageBlockCover ) GetCover () (value PageBlockClass ) {
if p == nil {
return
}
return p .Cover
}
type PageBlockEmbed struct {
Flags bin .Fields
FullWidth bool
AllowScrolling bool
URL string
HTML string
PosterPhotoID int64
W int
H int
Caption PageCaption
}
const PageBlockEmbedTypeID = 0xa8718dc5
func (p PageBlockEmbed ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockEmbed {}
_ bin .Decoder = &PageBlockEmbed {}
_ bin .BareEncoder = &PageBlockEmbed {}
_ bin .BareDecoder = &PageBlockEmbed {}
_ PageBlockClass = &PageBlockEmbed {}
)
func (p *PageBlockEmbed ) Zero () bool {
if p == nil {
return true
}
if !(p .Flags .Zero ()) {
return false
}
if !(p .FullWidth == false ) {
return false
}
if !(p .AllowScrolling == false ) {
return false
}
if !(p .URL == "" ) {
return false
}
if !(p .HTML == "" ) {
return false
}
if !(p .PosterPhotoID == 0 ) {
return false
}
if !(p .W == 0 ) {
return false
}
if !(p .H == 0 ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockEmbed ) String () string {
if p == nil {
return "PageBlockEmbed(nil)"
}
type Alias PageBlockEmbed
return fmt .Sprintf ("PageBlockEmbed%+v" , Alias (*p ))
}
func (p *PageBlockEmbed ) FillFrom (from interface {
GetFullWidth () (value bool )
GetAllowScrolling () (value bool )
GetURL () (value string , ok bool )
GetHTML () (value string , ok bool )
GetPosterPhotoID () (value int64 , ok bool )
GetW () (value int , ok bool )
GetH () (value int , ok bool )
GetCaption () (value PageCaption )
}) {
p .FullWidth = from .GetFullWidth ()
p .AllowScrolling = from .GetAllowScrolling ()
if val , ok := from .GetURL (); ok {
p .URL = val
}
if val , ok := from .GetHTML (); ok {
p .HTML = val
}
if val , ok := from .GetPosterPhotoID (); ok {
p .PosterPhotoID = val
}
if val , ok := from .GetW (); ok {
p .W = val
}
if val , ok := from .GetH (); ok {
p .H = val
}
p .Caption = from .GetCaption ()
}
func (*PageBlockEmbed ) TypeID () uint32 {
return PageBlockEmbedTypeID
}
func (*PageBlockEmbed ) TypeName () string {
return "pageBlockEmbed"
}
func (p *PageBlockEmbed ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockEmbed" ,
ID : PageBlockEmbedTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FullWidth" ,
SchemaName : "full_width" ,
Null : !p .Flags .Has (0 ),
},
{
Name : "AllowScrolling" ,
SchemaName : "allow_scrolling" ,
Null : !p .Flags .Has (3 ),
},
{
Name : "URL" ,
SchemaName : "url" ,
Null : !p .Flags .Has (1 ),
},
{
Name : "HTML" ,
SchemaName : "html" ,
Null : !p .Flags .Has (2 ),
},
{
Name : "PosterPhotoID" ,
SchemaName : "poster_photo_id" ,
Null : !p .Flags .Has (4 ),
},
{
Name : "W" ,
SchemaName : "w" ,
Null : !p .Flags .Has (5 ),
},
{
Name : "H" ,
SchemaName : "h" ,
Null : !p .Flags .Has (5 ),
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockEmbed ) SetFlags () {
if !(p .FullWidth == false ) {
p .Flags .Set (0 )
}
if !(p .AllowScrolling == false ) {
p .Flags .Set (3 )
}
if !(p .URL == "" ) {
p .Flags .Set (1 )
}
if !(p .HTML == "" ) {
p .Flags .Set (2 )
}
if !(p .PosterPhotoID == 0 ) {
p .Flags .Set (4 )
}
if !(p .W == 0 ) {
p .Flags .Set (5 )
}
if !(p .H == 0 ) {
p .Flags .Set (5 )
}
}
func (p *PageBlockEmbed ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockEmbed#a8718dc5 as nil" )
}
b .PutID (PageBlockEmbedTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockEmbed ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockEmbed#a8718dc5 as nil" )
}
p .SetFlags ()
if err := p .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockEmbed#a8718dc5: field flags: %w" , err )
}
if p .Flags .Has (1 ) {
b .PutString (p .URL )
}
if p .Flags .Has (2 ) {
b .PutString (p .HTML )
}
if p .Flags .Has (4 ) {
b .PutLong (p .PosterPhotoID )
}
if p .Flags .Has (5 ) {
b .PutInt (p .W )
}
if p .Flags .Has (5 ) {
b .PutInt (p .H )
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockEmbed#a8718dc5: field caption: %w" , err )
}
return nil
}
func (p *PageBlockEmbed ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockEmbed#a8718dc5 to nil" )
}
if err := b .ConsumeID (PageBlockEmbedTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockEmbed ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockEmbed#a8718dc5 to nil" )
}
{
if err := p .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field flags: %w" , err )
}
}
p .FullWidth = p .Flags .Has (0 )
p .AllowScrolling = p .Flags .Has (3 )
if p .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field url: %w" , err )
}
p .URL = value
}
if p .Flags .Has (2 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field html: %w" , err )
}
p .HTML = value
}
if p .Flags .Has (4 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field poster_photo_id: %w" , err )
}
p .PosterPhotoID = value
}
if p .Flags .Has (5 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field w: %w" , err )
}
p .W = value
}
if p .Flags .Has (5 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field h: %w" , err )
}
p .H = value
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbed#a8718dc5: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockEmbed ) SetFullWidth (value bool ) {
if value {
p .Flags .Set (0 )
p .FullWidth = true
} else {
p .Flags .Unset (0 )
p .FullWidth = false
}
}
func (p *PageBlockEmbed ) GetFullWidth () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (0 )
}
func (p *PageBlockEmbed ) SetAllowScrolling (value bool ) {
if value {
p .Flags .Set (3 )
p .AllowScrolling = true
} else {
p .Flags .Unset (3 )
p .AllowScrolling = false
}
}
func (p *PageBlockEmbed ) GetAllowScrolling () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (3 )
}
func (p *PageBlockEmbed ) SetURL (value string ) {
p .Flags .Set (1 )
p .URL = value
}
func (p *PageBlockEmbed ) GetURL () (value string , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (1 ) {
return value , false
}
return p .URL , true
}
func (p *PageBlockEmbed ) SetHTML (value string ) {
p .Flags .Set (2 )
p .HTML = value
}
func (p *PageBlockEmbed ) GetHTML () (value string , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (2 ) {
return value , false
}
return p .HTML , true
}
func (p *PageBlockEmbed ) SetPosterPhotoID (value int64 ) {
p .Flags .Set (4 )
p .PosterPhotoID = value
}
func (p *PageBlockEmbed ) GetPosterPhotoID () (value int64 , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (4 ) {
return value , false
}
return p .PosterPhotoID , true
}
func (p *PageBlockEmbed ) SetW (value int ) {
p .Flags .Set (5 )
p .W = value
}
func (p *PageBlockEmbed ) GetW () (value int , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (5 ) {
return value , false
}
return p .W , true
}
func (p *PageBlockEmbed ) SetH (value int ) {
p .Flags .Set (5 )
p .H = value
}
func (p *PageBlockEmbed ) GetH () (value int , ok bool ) {
if p == nil {
return
}
if !p .Flags .Has (5 ) {
return value , false
}
return p .H , true
}
func (p *PageBlockEmbed ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
type PageBlockEmbedPost struct {
URL string
WebpageID int64
AuthorPhotoID int64
Author string
Date int
Blocks []PageBlockClass
Caption PageCaption
}
const PageBlockEmbedPostTypeID = 0xf259a80b
func (p PageBlockEmbedPost ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockEmbedPost {}
_ bin .Decoder = &PageBlockEmbedPost {}
_ bin .BareEncoder = &PageBlockEmbedPost {}
_ bin .BareDecoder = &PageBlockEmbedPost {}
_ PageBlockClass = &PageBlockEmbedPost {}
)
func (p *PageBlockEmbedPost ) Zero () bool {
if p == nil {
return true
}
if !(p .URL == "" ) {
return false
}
if !(p .WebpageID == 0 ) {
return false
}
if !(p .AuthorPhotoID == 0 ) {
return false
}
if !(p .Author == "" ) {
return false
}
if !(p .Date == 0 ) {
return false
}
if !(p .Blocks == nil ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockEmbedPost ) String () string {
if p == nil {
return "PageBlockEmbedPost(nil)"
}
type Alias PageBlockEmbedPost
return fmt .Sprintf ("PageBlockEmbedPost%+v" , Alias (*p ))
}
func (p *PageBlockEmbedPost ) FillFrom (from interface {
GetURL () (value string )
GetWebpageID () (value int64 )
GetAuthorPhotoID () (value int64 )
GetAuthor () (value string )
GetDate () (value int )
GetBlocks () (value []PageBlockClass )
GetCaption () (value PageCaption )
}) {
p .URL = from .GetURL ()
p .WebpageID = from .GetWebpageID ()
p .AuthorPhotoID = from .GetAuthorPhotoID ()
p .Author = from .GetAuthor ()
p .Date = from .GetDate ()
p .Blocks = from .GetBlocks ()
p .Caption = from .GetCaption ()
}
func (*PageBlockEmbedPost ) TypeID () uint32 {
return PageBlockEmbedPostTypeID
}
func (*PageBlockEmbedPost ) TypeName () string {
return "pageBlockEmbedPost"
}
func (p *PageBlockEmbedPost ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockEmbedPost" ,
ID : PageBlockEmbedPostTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "URL" ,
SchemaName : "url" ,
},
{
Name : "WebpageID" ,
SchemaName : "webpage_id" ,
},
{
Name : "AuthorPhotoID" ,
SchemaName : "author_photo_id" ,
},
{
Name : "Author" ,
SchemaName : "author" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
{
Name : "Blocks" ,
SchemaName : "blocks" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockEmbedPost ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockEmbedPost#f259a80b as nil" )
}
b .PutID (PageBlockEmbedPostTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockEmbedPost ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockEmbedPost#f259a80b as nil" )
}
b .PutString (p .URL )
b .PutLong (p .WebpageID )
b .PutLong (p .AuthorPhotoID )
b .PutString (p .Author )
b .PutInt (p .Date )
b .PutVectorHeader (len (p .Blocks ))
for idx , v := range p .Blocks {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockEmbedPost#f259a80b: field blocks element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockEmbedPost#f259a80b: field blocks element with index %d: %w" , idx , err )
}
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockEmbedPost#f259a80b: field caption: %w" , err )
}
return nil
}
func (p *PageBlockEmbedPost ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockEmbedPost#f259a80b to nil" )
}
if err := b .ConsumeID (PageBlockEmbedPostTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockEmbedPost ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockEmbedPost#f259a80b to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field url: %w" , err )
}
p .URL = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field webpage_id: %w" , err )
}
p .WebpageID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field author_photo_id: %w" , err )
}
p .AuthorPhotoID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field author: %w" , err )
}
p .Author = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field date: %w" , err )
}
p .Date = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field blocks: %w" , err )
}
if headerLen > 0 {
p .Blocks = make ([]PageBlockClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageBlock (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field blocks: %w" , err )
}
p .Blocks = append (p .Blocks , value )
}
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockEmbedPost#f259a80b: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockEmbedPost ) GetURL () (value string ) {
if p == nil {
return
}
return p .URL
}
func (p *PageBlockEmbedPost ) GetWebpageID () (value int64 ) {
if p == nil {
return
}
return p .WebpageID
}
func (p *PageBlockEmbedPost ) GetAuthorPhotoID () (value int64 ) {
if p == nil {
return
}
return p .AuthorPhotoID
}
func (p *PageBlockEmbedPost ) GetAuthor () (value string ) {
if p == nil {
return
}
return p .Author
}
func (p *PageBlockEmbedPost ) GetDate () (value int ) {
if p == nil {
return
}
return p .Date
}
func (p *PageBlockEmbedPost ) GetBlocks () (value []PageBlockClass ) {
if p == nil {
return
}
return p .Blocks
}
func (p *PageBlockEmbedPost ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
func (p *PageBlockEmbedPost ) MapBlocks () (value PageBlockClassArray ) {
return PageBlockClassArray (p .Blocks )
}
type PageBlockCollage struct {
Items []PageBlockClass
Caption PageCaption
}
const PageBlockCollageTypeID = 0x65a0fa4d
func (p PageBlockCollage ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockCollage {}
_ bin .Decoder = &PageBlockCollage {}
_ bin .BareEncoder = &PageBlockCollage {}
_ bin .BareDecoder = &PageBlockCollage {}
_ PageBlockClass = &PageBlockCollage {}
)
func (p *PageBlockCollage ) Zero () bool {
if p == nil {
return true
}
if !(p .Items == nil ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockCollage ) String () string {
if p == nil {
return "PageBlockCollage(nil)"
}
type Alias PageBlockCollage
return fmt .Sprintf ("PageBlockCollage%+v" , Alias (*p ))
}
func (p *PageBlockCollage ) FillFrom (from interface {
GetItems () (value []PageBlockClass )
GetCaption () (value PageCaption )
}) {
p .Items = from .GetItems ()
p .Caption = from .GetCaption ()
}
func (*PageBlockCollage ) TypeID () uint32 {
return PageBlockCollageTypeID
}
func (*PageBlockCollage ) TypeName () string {
return "pageBlockCollage"
}
func (p *PageBlockCollage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockCollage" ,
ID : PageBlockCollageTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Items" ,
SchemaName : "items" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockCollage ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockCollage#65a0fa4d as nil" )
}
b .PutID (PageBlockCollageTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockCollage ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockCollage#65a0fa4d as nil" )
}
b .PutVectorHeader (len (p .Items ))
for idx , v := range p .Items {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockCollage#65a0fa4d: field items element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockCollage#65a0fa4d: field items element with index %d: %w" , idx , err )
}
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockCollage#65a0fa4d: field caption: %w" , err )
}
return nil
}
func (p *PageBlockCollage ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockCollage#65a0fa4d to nil" )
}
if err := b .ConsumeID (PageBlockCollageTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockCollage#65a0fa4d: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockCollage ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockCollage#65a0fa4d to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockCollage#65a0fa4d: field items: %w" , err )
}
if headerLen > 0 {
p .Items = make ([]PageBlockClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageBlock (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockCollage#65a0fa4d: field items: %w" , err )
}
p .Items = append (p .Items , value )
}
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockCollage#65a0fa4d: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockCollage ) GetItems () (value []PageBlockClass ) {
if p == nil {
return
}
return p .Items
}
func (p *PageBlockCollage ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
func (p *PageBlockCollage ) MapItems () (value PageBlockClassArray ) {
return PageBlockClassArray (p .Items )
}
type PageBlockSlideshow struct {
Items []PageBlockClass
Caption PageCaption
}
const PageBlockSlideshowTypeID = 0x31f9590
func (p PageBlockSlideshow ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockSlideshow {}
_ bin .Decoder = &PageBlockSlideshow {}
_ bin .BareEncoder = &PageBlockSlideshow {}
_ bin .BareDecoder = &PageBlockSlideshow {}
_ PageBlockClass = &PageBlockSlideshow {}
)
func (p *PageBlockSlideshow ) Zero () bool {
if p == nil {
return true
}
if !(p .Items == nil ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockSlideshow ) String () string {
if p == nil {
return "PageBlockSlideshow(nil)"
}
type Alias PageBlockSlideshow
return fmt .Sprintf ("PageBlockSlideshow%+v" , Alias (*p ))
}
func (p *PageBlockSlideshow ) FillFrom (from interface {
GetItems () (value []PageBlockClass )
GetCaption () (value PageCaption )
}) {
p .Items = from .GetItems ()
p .Caption = from .GetCaption ()
}
func (*PageBlockSlideshow ) TypeID () uint32 {
return PageBlockSlideshowTypeID
}
func (*PageBlockSlideshow ) TypeName () string {
return "pageBlockSlideshow"
}
func (p *PageBlockSlideshow ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockSlideshow" ,
ID : PageBlockSlideshowTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Items" ,
SchemaName : "items" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockSlideshow ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSlideshow#31f9590 as nil" )
}
b .PutID (PageBlockSlideshowTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockSlideshow ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockSlideshow#31f9590 as nil" )
}
b .PutVectorHeader (len (p .Items ))
for idx , v := range p .Items {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockSlideshow#31f9590: field items element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockSlideshow#31f9590: field items element with index %d: %w" , idx , err )
}
}
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockSlideshow#31f9590: field caption: %w" , err )
}
return nil
}
func (p *PageBlockSlideshow ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSlideshow#31f9590 to nil" )
}
if err := b .ConsumeID (PageBlockSlideshowTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockSlideshow#31f9590: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockSlideshow ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockSlideshow#31f9590 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockSlideshow#31f9590: field items: %w" , err )
}
if headerLen > 0 {
p .Items = make ([]PageBlockClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageBlock (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockSlideshow#31f9590: field items: %w" , err )
}
p .Items = append (p .Items , value )
}
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockSlideshow#31f9590: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockSlideshow ) GetItems () (value []PageBlockClass ) {
if p == nil {
return
}
return p .Items
}
func (p *PageBlockSlideshow ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
func (p *PageBlockSlideshow ) MapItems () (value PageBlockClassArray ) {
return PageBlockClassArray (p .Items )
}
type PageBlockChannel struct {
Channel ChatClass
}
const PageBlockChannelTypeID = 0xef1751b5
func (p PageBlockChannel ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockChannel {}
_ bin .Decoder = &PageBlockChannel {}
_ bin .BareEncoder = &PageBlockChannel {}
_ bin .BareDecoder = &PageBlockChannel {}
_ PageBlockClass = &PageBlockChannel {}
)
func (p *PageBlockChannel ) Zero () bool {
if p == nil {
return true
}
if !(p .Channel == nil ) {
return false
}
return true
}
func (p *PageBlockChannel ) String () string {
if p == nil {
return "PageBlockChannel(nil)"
}
type Alias PageBlockChannel
return fmt .Sprintf ("PageBlockChannel%+v" , Alias (*p ))
}
func (p *PageBlockChannel ) FillFrom (from interface {
GetChannel () (value ChatClass )
}) {
p .Channel = from .GetChannel ()
}
func (*PageBlockChannel ) TypeID () uint32 {
return PageBlockChannelTypeID
}
func (*PageBlockChannel ) TypeName () string {
return "pageBlockChannel"
}
func (p *PageBlockChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockChannel" ,
ID : PageBlockChannelTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Channel" ,
SchemaName : "channel" ,
},
}
return typ
}
func (p *PageBlockChannel ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockChannel#ef1751b5 as nil" )
}
b .PutID (PageBlockChannelTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockChannel ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockChannel#ef1751b5 as nil" )
}
if p .Channel == nil {
return fmt .Errorf ("unable to encode pageBlockChannel#ef1751b5: field channel is nil" )
}
if err := p .Channel .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockChannel#ef1751b5: field channel: %w" , err )
}
return nil
}
func (p *PageBlockChannel ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockChannel#ef1751b5 to nil" )
}
if err := b .ConsumeID (PageBlockChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockChannel#ef1751b5: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockChannel ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockChannel#ef1751b5 to nil" )
}
{
value , err := DecodeChat (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockChannel#ef1751b5: field channel: %w" , err )
}
p .Channel = value
}
return nil
}
func (p *PageBlockChannel ) GetChannel () (value ChatClass ) {
if p == nil {
return
}
return p .Channel
}
type PageBlockAudio struct {
AudioID int64
Caption PageCaption
}
const PageBlockAudioTypeID = 0x804361ea
func (p PageBlockAudio ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockAudio {}
_ bin .Decoder = &PageBlockAudio {}
_ bin .BareEncoder = &PageBlockAudio {}
_ bin .BareDecoder = &PageBlockAudio {}
_ PageBlockClass = &PageBlockAudio {}
)
func (p *PageBlockAudio ) Zero () bool {
if p == nil {
return true
}
if !(p .AudioID == 0 ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockAudio ) String () string {
if p == nil {
return "PageBlockAudio(nil)"
}
type Alias PageBlockAudio
return fmt .Sprintf ("PageBlockAudio%+v" , Alias (*p ))
}
func (p *PageBlockAudio ) FillFrom (from interface {
GetAudioID () (value int64 )
GetCaption () (value PageCaption )
}) {
p .AudioID = from .GetAudioID ()
p .Caption = from .GetCaption ()
}
func (*PageBlockAudio ) TypeID () uint32 {
return PageBlockAudioTypeID
}
func (*PageBlockAudio ) TypeName () string {
return "pageBlockAudio"
}
func (p *PageBlockAudio ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockAudio" ,
ID : PageBlockAudioTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "AudioID" ,
SchemaName : "audio_id" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockAudio ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAudio#804361ea as nil" )
}
b .PutID (PageBlockAudioTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockAudio ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockAudio#804361ea as nil" )
}
b .PutLong (p .AudioID )
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockAudio#804361ea: field caption: %w" , err )
}
return nil
}
func (p *PageBlockAudio ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAudio#804361ea to nil" )
}
if err := b .ConsumeID (PageBlockAudioTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockAudio#804361ea: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockAudio ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockAudio#804361ea to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockAudio#804361ea: field audio_id: %w" , err )
}
p .AudioID = value
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockAudio#804361ea: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockAudio ) GetAudioID () (value int64 ) {
if p == nil {
return
}
return p .AudioID
}
func (p *PageBlockAudio ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
type PageBlockKicker struct {
Text RichTextClass
}
const PageBlockKickerTypeID = 0x1e148390
func (p PageBlockKicker ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockKicker {}
_ bin .Decoder = &PageBlockKicker {}
_ bin .BareEncoder = &PageBlockKicker {}
_ bin .BareDecoder = &PageBlockKicker {}
_ PageBlockClass = &PageBlockKicker {}
)
func (p *PageBlockKicker ) Zero () bool {
if p == nil {
return true
}
if !(p .Text == nil ) {
return false
}
return true
}
func (p *PageBlockKicker ) String () string {
if p == nil {
return "PageBlockKicker(nil)"
}
type Alias PageBlockKicker
return fmt .Sprintf ("PageBlockKicker%+v" , Alias (*p ))
}
func (p *PageBlockKicker ) FillFrom (from interface {
GetText () (value RichTextClass )
}) {
p .Text = from .GetText ()
}
func (*PageBlockKicker ) TypeID () uint32 {
return PageBlockKickerTypeID
}
func (*PageBlockKicker ) TypeName () string {
return "pageBlockKicker"
}
func (p *PageBlockKicker ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockKicker" ,
ID : PageBlockKickerTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (p *PageBlockKicker ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockKicker#1e148390 as nil" )
}
b .PutID (PageBlockKickerTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockKicker ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockKicker#1e148390 as nil" )
}
if p .Text == nil {
return fmt .Errorf ("unable to encode pageBlockKicker#1e148390: field text is nil" )
}
if err := p .Text .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockKicker#1e148390: field text: %w" , err )
}
return nil
}
func (p *PageBlockKicker ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockKicker#1e148390 to nil" )
}
if err := b .ConsumeID (PageBlockKickerTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockKicker#1e148390: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockKicker ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockKicker#1e148390 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockKicker#1e148390: field text: %w" , err )
}
p .Text = value
}
return nil
}
func (p *PageBlockKicker ) GetText () (value RichTextClass ) {
if p == nil {
return
}
return p .Text
}
type PageBlockTable struct {
Flags bin .Fields
Bordered bool
Striped bool
Title RichTextClass
Rows []PageTableRow
}
const PageBlockTableTypeID = 0xbf4dea82
func (p PageBlockTable ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockTable {}
_ bin .Decoder = &PageBlockTable {}
_ bin .BareEncoder = &PageBlockTable {}
_ bin .BareDecoder = &PageBlockTable {}
_ PageBlockClass = &PageBlockTable {}
)
func (p *PageBlockTable ) Zero () bool {
if p == nil {
return true
}
if !(p .Flags .Zero ()) {
return false
}
if !(p .Bordered == false ) {
return false
}
if !(p .Striped == false ) {
return false
}
if !(p .Title == nil ) {
return false
}
if !(p .Rows == nil ) {
return false
}
return true
}
func (p *PageBlockTable ) String () string {
if p == nil {
return "PageBlockTable(nil)"
}
type Alias PageBlockTable
return fmt .Sprintf ("PageBlockTable%+v" , Alias (*p ))
}
func (p *PageBlockTable ) FillFrom (from interface {
GetBordered () (value bool )
GetStriped () (value bool )
GetTitle () (value RichTextClass )
GetRows () (value []PageTableRow )
}) {
p .Bordered = from .GetBordered ()
p .Striped = from .GetStriped ()
p .Title = from .GetTitle ()
p .Rows = from .GetRows ()
}
func (*PageBlockTable ) TypeID () uint32 {
return PageBlockTableTypeID
}
func (*PageBlockTable ) TypeName () string {
return "pageBlockTable"
}
func (p *PageBlockTable ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockTable" ,
ID : PageBlockTableTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Bordered" ,
SchemaName : "bordered" ,
Null : !p .Flags .Has (0 ),
},
{
Name : "Striped" ,
SchemaName : "striped" ,
Null : !p .Flags .Has (1 ),
},
{
Name : "Title" ,
SchemaName : "title" ,
},
{
Name : "Rows" ,
SchemaName : "rows" ,
},
}
return typ
}
func (p *PageBlockTable ) SetFlags () {
if !(p .Bordered == false ) {
p .Flags .Set (0 )
}
if !(p .Striped == false ) {
p .Flags .Set (1 )
}
}
func (p *PageBlockTable ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockTable#bf4dea82 as nil" )
}
b .PutID (PageBlockTableTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockTable ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockTable#bf4dea82 as nil" )
}
p .SetFlags ()
if err := p .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockTable#bf4dea82: field flags: %w" , err )
}
if p .Title == nil {
return fmt .Errorf ("unable to encode pageBlockTable#bf4dea82: field title is nil" )
}
if err := p .Title .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockTable#bf4dea82: field title: %w" , err )
}
b .PutVectorHeader (len (p .Rows ))
for idx , v := range p .Rows {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockTable#bf4dea82: field rows element with index %d: %w" , idx , err )
}
}
return nil
}
func (p *PageBlockTable ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockTable#bf4dea82 to nil" )
}
if err := b .ConsumeID (PageBlockTableTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockTable#bf4dea82: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockTable ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockTable#bf4dea82 to nil" )
}
{
if err := p .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockTable#bf4dea82: field flags: %w" , err )
}
}
p .Bordered = p .Flags .Has (0 )
p .Striped = p .Flags .Has (1 )
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockTable#bf4dea82: field title: %w" , err )
}
p .Title = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockTable#bf4dea82: field rows: %w" , err )
}
if headerLen > 0 {
p .Rows = make ([]PageTableRow , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value PageTableRow
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockTable#bf4dea82: field rows: %w" , err )
}
p .Rows = append (p .Rows , value )
}
}
return nil
}
func (p *PageBlockTable ) SetBordered (value bool ) {
if value {
p .Flags .Set (0 )
p .Bordered = true
} else {
p .Flags .Unset (0 )
p .Bordered = false
}
}
func (p *PageBlockTable ) GetBordered () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (0 )
}
func (p *PageBlockTable ) SetStriped (value bool ) {
if value {
p .Flags .Set (1 )
p .Striped = true
} else {
p .Flags .Unset (1 )
p .Striped = false
}
}
func (p *PageBlockTable ) GetStriped () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (1 )
}
func (p *PageBlockTable ) GetTitle () (value RichTextClass ) {
if p == nil {
return
}
return p .Title
}
func (p *PageBlockTable ) GetRows () (value []PageTableRow ) {
if p == nil {
return
}
return p .Rows
}
type PageBlockOrderedList struct {
Items []PageListOrderedItemClass
}
const PageBlockOrderedListTypeID = 0x9a8ae1e1
func (p PageBlockOrderedList ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockOrderedList {}
_ bin .Decoder = &PageBlockOrderedList {}
_ bin .BareEncoder = &PageBlockOrderedList {}
_ bin .BareDecoder = &PageBlockOrderedList {}
_ PageBlockClass = &PageBlockOrderedList {}
)
func (p *PageBlockOrderedList ) Zero () bool {
if p == nil {
return true
}
if !(p .Items == nil ) {
return false
}
return true
}
func (p *PageBlockOrderedList ) String () string {
if p == nil {
return "PageBlockOrderedList(nil)"
}
type Alias PageBlockOrderedList
return fmt .Sprintf ("PageBlockOrderedList%+v" , Alias (*p ))
}
func (p *PageBlockOrderedList ) FillFrom (from interface {
GetItems () (value []PageListOrderedItemClass )
}) {
p .Items = from .GetItems ()
}
func (*PageBlockOrderedList ) TypeID () uint32 {
return PageBlockOrderedListTypeID
}
func (*PageBlockOrderedList ) TypeName () string {
return "pageBlockOrderedList"
}
func (p *PageBlockOrderedList ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockOrderedList" ,
ID : PageBlockOrderedListTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Items" ,
SchemaName : "items" ,
},
}
return typ
}
func (p *PageBlockOrderedList ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockOrderedList#9a8ae1e1 as nil" )
}
b .PutID (PageBlockOrderedListTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockOrderedList ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockOrderedList#9a8ae1e1 as nil" )
}
b .PutVectorHeader (len (p .Items ))
for idx , v := range p .Items {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockOrderedList#9a8ae1e1: field items element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockOrderedList#9a8ae1e1: field items element with index %d: %w" , idx , err )
}
}
return nil
}
func (p *PageBlockOrderedList ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockOrderedList#9a8ae1e1 to nil" )
}
if err := b .ConsumeID (PageBlockOrderedListTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockOrderedList#9a8ae1e1: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockOrderedList ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockOrderedList#9a8ae1e1 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockOrderedList#9a8ae1e1: field items: %w" , err )
}
if headerLen > 0 {
p .Items = make ([]PageListOrderedItemClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageListOrderedItem (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockOrderedList#9a8ae1e1: field items: %w" , err )
}
p .Items = append (p .Items , value )
}
}
return nil
}
func (p *PageBlockOrderedList ) GetItems () (value []PageListOrderedItemClass ) {
if p == nil {
return
}
return p .Items
}
func (p *PageBlockOrderedList ) MapItems () (value PageListOrderedItemClassArray ) {
return PageListOrderedItemClassArray (p .Items )
}
type PageBlockDetails struct {
Flags bin .Fields
Open bool
Blocks []PageBlockClass
Title RichTextClass
}
const PageBlockDetailsTypeID = 0x76768bed
func (p PageBlockDetails ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockDetails {}
_ bin .Decoder = &PageBlockDetails {}
_ bin .BareEncoder = &PageBlockDetails {}
_ bin .BareDecoder = &PageBlockDetails {}
_ PageBlockClass = &PageBlockDetails {}
)
func (p *PageBlockDetails ) Zero () bool {
if p == nil {
return true
}
if !(p .Flags .Zero ()) {
return false
}
if !(p .Open == false ) {
return false
}
if !(p .Blocks == nil ) {
return false
}
if !(p .Title == nil ) {
return false
}
return true
}
func (p *PageBlockDetails ) String () string {
if p == nil {
return "PageBlockDetails(nil)"
}
type Alias PageBlockDetails
return fmt .Sprintf ("PageBlockDetails%+v" , Alias (*p ))
}
func (p *PageBlockDetails ) FillFrom (from interface {
GetOpen () (value bool )
GetBlocks () (value []PageBlockClass )
GetTitle () (value RichTextClass )
}) {
p .Open = from .GetOpen ()
p .Blocks = from .GetBlocks ()
p .Title = from .GetTitle ()
}
func (*PageBlockDetails ) TypeID () uint32 {
return PageBlockDetailsTypeID
}
func (*PageBlockDetails ) TypeName () string {
return "pageBlockDetails"
}
func (p *PageBlockDetails ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockDetails" ,
ID : PageBlockDetailsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Open" ,
SchemaName : "open" ,
Null : !p .Flags .Has (0 ),
},
{
Name : "Blocks" ,
SchemaName : "blocks" ,
},
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (p *PageBlockDetails ) SetFlags () {
if !(p .Open == false ) {
p .Flags .Set (0 )
}
}
func (p *PageBlockDetails ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockDetails#76768bed as nil" )
}
b .PutID (PageBlockDetailsTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockDetails ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockDetails#76768bed as nil" )
}
p .SetFlags ()
if err := p .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockDetails#76768bed: field flags: %w" , err )
}
b .PutVectorHeader (len (p .Blocks ))
for idx , v := range p .Blocks {
if v == nil {
return fmt .Errorf ("unable to encode pageBlockDetails#76768bed: field blocks element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockDetails#76768bed: field blocks element with index %d: %w" , idx , err )
}
}
if p .Title == nil {
return fmt .Errorf ("unable to encode pageBlockDetails#76768bed: field title is nil" )
}
if err := p .Title .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockDetails#76768bed: field title: %w" , err )
}
return nil
}
func (p *PageBlockDetails ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockDetails#76768bed to nil" )
}
if err := b .ConsumeID (PageBlockDetailsTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockDetails#76768bed: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockDetails ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockDetails#76768bed to nil" )
}
{
if err := p .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockDetails#76768bed: field flags: %w" , err )
}
}
p .Open = p .Flags .Has (0 )
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockDetails#76768bed: field blocks: %w" , err )
}
if headerLen > 0 {
p .Blocks = make ([]PageBlockClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePageBlock (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockDetails#76768bed: field blocks: %w" , err )
}
p .Blocks = append (p .Blocks , value )
}
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockDetails#76768bed: field title: %w" , err )
}
p .Title = value
}
return nil
}
func (p *PageBlockDetails ) SetOpen (value bool ) {
if value {
p .Flags .Set (0 )
p .Open = true
} else {
p .Flags .Unset (0 )
p .Open = false
}
}
func (p *PageBlockDetails ) GetOpen () (value bool ) {
if p == nil {
return
}
return p .Flags .Has (0 )
}
func (p *PageBlockDetails ) GetBlocks () (value []PageBlockClass ) {
if p == nil {
return
}
return p .Blocks
}
func (p *PageBlockDetails ) GetTitle () (value RichTextClass ) {
if p == nil {
return
}
return p .Title
}
func (p *PageBlockDetails ) MapBlocks () (value PageBlockClassArray ) {
return PageBlockClassArray (p .Blocks )
}
type PageBlockRelatedArticles struct {
Title RichTextClass
Articles []PageRelatedArticle
}
const PageBlockRelatedArticlesTypeID = 0x16115a96
func (p PageBlockRelatedArticles ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockRelatedArticles {}
_ bin .Decoder = &PageBlockRelatedArticles {}
_ bin .BareEncoder = &PageBlockRelatedArticles {}
_ bin .BareDecoder = &PageBlockRelatedArticles {}
_ PageBlockClass = &PageBlockRelatedArticles {}
)
func (p *PageBlockRelatedArticles ) Zero () bool {
if p == nil {
return true
}
if !(p .Title == nil ) {
return false
}
if !(p .Articles == nil ) {
return false
}
return true
}
func (p *PageBlockRelatedArticles ) String () string {
if p == nil {
return "PageBlockRelatedArticles(nil)"
}
type Alias PageBlockRelatedArticles
return fmt .Sprintf ("PageBlockRelatedArticles%+v" , Alias (*p ))
}
func (p *PageBlockRelatedArticles ) FillFrom (from interface {
GetTitle () (value RichTextClass )
GetArticles () (value []PageRelatedArticle )
}) {
p .Title = from .GetTitle ()
p .Articles = from .GetArticles ()
}
func (*PageBlockRelatedArticles ) TypeID () uint32 {
return PageBlockRelatedArticlesTypeID
}
func (*PageBlockRelatedArticles ) TypeName () string {
return "pageBlockRelatedArticles"
}
func (p *PageBlockRelatedArticles ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockRelatedArticles" ,
ID : PageBlockRelatedArticlesTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
{
Name : "Articles" ,
SchemaName : "articles" ,
},
}
return typ
}
func (p *PageBlockRelatedArticles ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockRelatedArticles#16115a96 as nil" )
}
b .PutID (PageBlockRelatedArticlesTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockRelatedArticles ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockRelatedArticles#16115a96 as nil" )
}
if p .Title == nil {
return fmt .Errorf ("unable to encode pageBlockRelatedArticles#16115a96: field title is nil" )
}
if err := p .Title .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockRelatedArticles#16115a96: field title: %w" , err )
}
b .PutVectorHeader (len (p .Articles ))
for idx , v := range p .Articles {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockRelatedArticles#16115a96: field articles element with index %d: %w" , idx , err )
}
}
return nil
}
func (p *PageBlockRelatedArticles ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockRelatedArticles#16115a96 to nil" )
}
if err := b .ConsumeID (PageBlockRelatedArticlesTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockRelatedArticles#16115a96: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockRelatedArticles ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockRelatedArticles#16115a96 to nil" )
}
{
value , err := DecodeRichText (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockRelatedArticles#16115a96: field title: %w" , err )
}
p .Title = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockRelatedArticles#16115a96: field articles: %w" , err )
}
if headerLen > 0 {
p .Articles = make ([]PageRelatedArticle , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value PageRelatedArticle
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockRelatedArticles#16115a96: field articles: %w" , err )
}
p .Articles = append (p .Articles , value )
}
}
return nil
}
func (p *PageBlockRelatedArticles ) GetTitle () (value RichTextClass ) {
if p == nil {
return
}
return p .Title
}
func (p *PageBlockRelatedArticles ) GetArticles () (value []PageRelatedArticle ) {
if p == nil {
return
}
return p .Articles
}
type PageBlockMap struct {
Geo GeoPointClass
Zoom int
W int
H int
Caption PageCaption
}
const PageBlockMapTypeID = 0xa44f3ef6
func (p PageBlockMap ) construct () PageBlockClass { return &p }
var (
_ bin .Encoder = &PageBlockMap {}
_ bin .Decoder = &PageBlockMap {}
_ bin .BareEncoder = &PageBlockMap {}
_ bin .BareDecoder = &PageBlockMap {}
_ PageBlockClass = &PageBlockMap {}
)
func (p *PageBlockMap ) Zero () bool {
if p == nil {
return true
}
if !(p .Geo == nil ) {
return false
}
if !(p .Zoom == 0 ) {
return false
}
if !(p .W == 0 ) {
return false
}
if !(p .H == 0 ) {
return false
}
if !(p .Caption .Zero ()) {
return false
}
return true
}
func (p *PageBlockMap ) String () string {
if p == nil {
return "PageBlockMap(nil)"
}
type Alias PageBlockMap
return fmt .Sprintf ("PageBlockMap%+v" , Alias (*p ))
}
func (p *PageBlockMap ) FillFrom (from interface {
GetGeo () (value GeoPointClass )
GetZoom () (value int )
GetW () (value int )
GetH () (value int )
GetCaption () (value PageCaption )
}) {
p .Geo = from .GetGeo ()
p .Zoom = from .GetZoom ()
p .W = from .GetW ()
p .H = from .GetH ()
p .Caption = from .GetCaption ()
}
func (*PageBlockMap ) TypeID () uint32 {
return PageBlockMapTypeID
}
func (*PageBlockMap ) TypeName () string {
return "pageBlockMap"
}
func (p *PageBlockMap ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "pageBlockMap" ,
ID : PageBlockMapTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Geo" ,
SchemaName : "geo" ,
},
{
Name : "Zoom" ,
SchemaName : "zoom" ,
},
{
Name : "W" ,
SchemaName : "w" ,
},
{
Name : "H" ,
SchemaName : "h" ,
},
{
Name : "Caption" ,
SchemaName : "caption" ,
},
}
return typ
}
func (p *PageBlockMap ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockMap#a44f3ef6 as nil" )
}
b .PutID (PageBlockMapTypeID )
return p .EncodeBare (b )
}
func (p *PageBlockMap ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode pageBlockMap#a44f3ef6 as nil" )
}
if p .Geo == nil {
return fmt .Errorf ("unable to encode pageBlockMap#a44f3ef6: field geo is nil" )
}
if err := p .Geo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockMap#a44f3ef6: field geo: %w" , err )
}
b .PutInt (p .Zoom )
b .PutInt (p .W )
b .PutInt (p .H )
if err := p .Caption .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode pageBlockMap#a44f3ef6: field caption: %w" , err )
}
return nil
}
func (p *PageBlockMap ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockMap#a44f3ef6 to nil" )
}
if err := b .ConsumeID (PageBlockMapTypeID ); err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: %w" , err )
}
return p .DecodeBare (b )
}
func (p *PageBlockMap ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode pageBlockMap#a44f3ef6 to nil" )
}
{
value , err := DecodeGeoPoint (b )
if err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: field geo: %w" , err )
}
p .Geo = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: field zoom: %w" , err )
}
p .Zoom = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: field w: %w" , err )
}
p .W = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: field h: %w" , err )
}
p .H = value
}
{
if err := p .Caption .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode pageBlockMap#a44f3ef6: field caption: %w" , err )
}
}
return nil
}
func (p *PageBlockMap ) GetGeo () (value GeoPointClass ) {
if p == nil {
return
}
return p .Geo
}
func (p *PageBlockMap ) GetZoom () (value int ) {
if p == nil {
return
}
return p .Zoom
}
func (p *PageBlockMap ) GetW () (value int ) {
if p == nil {
return
}
return p .W
}
func (p *PageBlockMap ) GetH () (value int ) {
if p == nil {
return
}
return p .H
}
func (p *PageBlockMap ) GetCaption () (value PageCaption ) {
if p == nil {
return
}
return p .Caption
}
const PageBlockClassName = "PageBlock"
type PageBlockClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () PageBlockClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodePageBlock (buf *bin .Buffer ) (PageBlockClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case PageBlockUnsupportedTypeID :
v := PageBlockUnsupported {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockTitleTypeID :
v := PageBlockTitle {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockSubtitleTypeID :
v := PageBlockSubtitle {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockAuthorDateTypeID :
v := PageBlockAuthorDate {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockHeaderTypeID :
v := PageBlockHeader {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockSubheaderTypeID :
v := PageBlockSubheader {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockParagraphTypeID :
v := PageBlockParagraph {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockPreformattedTypeID :
v := PageBlockPreformatted {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockFooterTypeID :
v := PageBlockFooter {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockDividerTypeID :
v := PageBlockDivider {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockAnchorTypeID :
v := PageBlockAnchor {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockListTypeID :
v := PageBlockList {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockBlockquoteTypeID :
v := PageBlockBlockquote {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockPullquoteTypeID :
v := PageBlockPullquote {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockPhotoTypeID :
v := PageBlockPhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockVideoTypeID :
v := PageBlockVideo {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockCoverTypeID :
v := PageBlockCover {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockEmbedTypeID :
v := PageBlockEmbed {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockEmbedPostTypeID :
v := PageBlockEmbedPost {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockCollageTypeID :
v := PageBlockCollage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockSlideshowTypeID :
v := PageBlockSlideshow {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockChannelTypeID :
v := PageBlockChannel {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockAudioTypeID :
v := PageBlockAudio {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockKickerTypeID :
v := PageBlockKicker {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockTableTypeID :
v := PageBlockTable {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockOrderedListTypeID :
v := PageBlockOrderedList {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockDetailsTypeID :
v := PageBlockDetails {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockRelatedArticlesTypeID :
v := PageBlockRelatedArticles {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
case PageBlockMapTypeID :
v := PageBlockMap {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode PageBlockClass: %w" , bin .NewUnexpectedID (id ))
}
}
type PageBlockBox struct {
PageBlock PageBlockClass
}
func (b *PageBlockBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode PageBlockBox to nil" )
}
v , err := DecodePageBlock (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .PageBlock = v
return nil
}
func (b *PageBlockBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .PageBlock == nil {
return fmt .Errorf ("unable to encode PageBlockClass as nil" )
}
return b .PageBlock .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 .