// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// PageBlockUnsupported represents TL type `pageBlockUnsupported#13567e8a`.
// Unsupported IV element
//
// See https://core.telegram.org/constructor/pageBlockUnsupported for reference.
type PageBlockUnsupported struct {
}

// PageBlockUnsupportedTypeID is TL type id of PageBlockUnsupported.
const PageBlockUnsupportedTypeID = 0x13567e8a

// construct implements constructor of PageBlockClass.
func ( PageBlockUnsupported) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockUnsupported{}
)

func ( *PageBlockUnsupported) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockUnsupported) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockUnsupported",
		ID:   PageBlockUnsupportedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockUnsupported) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockUnsupported#13567e8a as nil")
	}
	.PutID(PageBlockUnsupportedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockUnsupported) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockUnsupported#13567e8a as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockUnsupported) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockUnsupported#13567e8a to nil")
	}
	return nil
}

// PageBlockTitle represents TL type `pageBlockTitle#70abc3fd`.
// Title
//
// See https://core.telegram.org/constructor/pageBlockTitle for reference.
type PageBlockTitle struct {
	// Title
	Text RichTextClass
}

// PageBlockTitleTypeID is TL type id of PageBlockTitle.
const PageBlockTitleTypeID = 0x70abc3fd

// construct implements constructor of PageBlockClass.
func ( PageBlockTitle) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockTitle{}
)

func ( *PageBlockTitle) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockTitle from given interface.
func ( *PageBlockTitle) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockTitle) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockTitle",
		ID:   PageBlockTitleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockTitle#70abc3fd as nil")
	}
	.PutID(PageBlockTitleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockTitle#70abc3fd as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockTitle#70abc3fd: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockTitle#70abc3fd: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockTitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockTitle#70abc3fd to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockTitle#70abc3fd: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockTitle) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockSubtitle represents TL type `pageBlockSubtitle#8ffa9a1f`.
// Subtitle
//
// See https://core.telegram.org/constructor/pageBlockSubtitle for reference.
type PageBlockSubtitle struct {
	// Text
	Text RichTextClass
}

// PageBlockSubtitleTypeID is TL type id of PageBlockSubtitle.
const PageBlockSubtitleTypeID = 0x8ffa9a1f

// construct implements constructor of PageBlockClass.
func ( PageBlockSubtitle) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockSubtitle{}
)

func ( *PageBlockSubtitle) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockSubtitle from given interface.
func ( *PageBlockSubtitle) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockSubtitle) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockSubtitle",
		ID:   PageBlockSubtitleTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockSubtitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSubtitle#8ffa9a1f as nil")
	}
	.PutID(PageBlockSubtitleTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockSubtitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSubtitle#8ffa9a1f as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockSubtitle#8ffa9a1f: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockSubtitle#8ffa9a1f: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockSubtitle) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockSubtitle#8ffa9a1f to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockSubtitle#8ffa9a1f: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockSubtitle) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockAuthorDate represents TL type `pageBlockAuthorDate#baafe5e0`.
// Author and date of creation of article
//
// See https://core.telegram.org/constructor/pageBlockAuthorDate for reference.
type PageBlockAuthorDate struct {
	// Author name
	Author RichTextClass
	// Date of publication
	PublishedDate int
}

// PageBlockAuthorDateTypeID is TL type id of PageBlockAuthorDate.
const PageBlockAuthorDateTypeID = 0xbaafe5e0

// construct implements constructor of PageBlockClass.
func ( PageBlockAuthorDate) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockAuthorDate{}
)

func ( *PageBlockAuthorDate) () bool {
	if  == nil {
		return true
	}
	if !(.Author == nil) {
		return false
	}
	if !(.PublishedDate == 0) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockAuthorDate from given interface.
func ( *PageBlockAuthorDate) ( interface {
	() ( RichTextClass)
	() ( int)
}) {
	.Author = .()
	.PublishedDate = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockAuthorDate) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockAuthorDate",
		ID:   PageBlockAuthorDateTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Author",
			SchemaName: "author",
		},
		{
			Name:       "PublishedDate",
			SchemaName: "published_date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockAuthorDate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAuthorDate#baafe5e0 as nil")
	}
	.PutID(PageBlockAuthorDateTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockAuthorDate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAuthorDate#baafe5e0 as nil")
	}
	if .Author == nil {
		return fmt.Errorf("unable to encode pageBlockAuthorDate#baafe5e0: field author is nil")
	}
	if  := .Author.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockAuthorDate#baafe5e0: field author: %w", )
	}
	.PutInt(.PublishedDate)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockAuthorDate) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockAuthorDate#baafe5e0 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockAuthorDate#baafe5e0: field author: %w", )
		}
		.Author = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockAuthorDate#baafe5e0: field published_date: %w", )
		}
		.PublishedDate = 
	}
	return nil
}

// GetAuthor returns value of Author field.
func ( *PageBlockAuthorDate) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Author
}

// GetPublishedDate returns value of PublishedDate field.
func ( *PageBlockAuthorDate) () ( int) {
	if  == nil {
		return
	}
	return .PublishedDate
}

// PageBlockHeader represents TL type `pageBlockHeader#bfd064ec`.
// Page header
//
// See https://core.telegram.org/constructor/pageBlockHeader for reference.
type PageBlockHeader struct {
	// Contents
	Text RichTextClass
}

// PageBlockHeaderTypeID is TL type id of PageBlockHeader.
const PageBlockHeaderTypeID = 0xbfd064ec

// construct implements constructor of PageBlockClass.
func ( PageBlockHeader) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockHeader{}
)

func ( *PageBlockHeader) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockHeader from given interface.
func ( *PageBlockHeader) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockHeader) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockHeader",
		ID:   PageBlockHeaderTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockHeader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockHeader#bfd064ec as nil")
	}
	.PutID(PageBlockHeaderTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockHeader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockHeader#bfd064ec as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockHeader#bfd064ec: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockHeader#bfd064ec: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockHeader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockHeader#bfd064ec to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockHeader#bfd064ec: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockHeader) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockSubheader represents TL type `pageBlockSubheader#f12bb6e1`.
// Subheader
//
// See https://core.telegram.org/constructor/pageBlockSubheader for reference.
type PageBlockSubheader struct {
	// Subheader
	Text RichTextClass
}

// PageBlockSubheaderTypeID is TL type id of PageBlockSubheader.
const PageBlockSubheaderTypeID = 0xf12bb6e1

// construct implements constructor of PageBlockClass.
func ( PageBlockSubheader) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockSubheader{}
)

func ( *PageBlockSubheader) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockSubheader from given interface.
func ( *PageBlockSubheader) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockSubheader) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockSubheader",
		ID:   PageBlockSubheaderTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockSubheader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSubheader#f12bb6e1 as nil")
	}
	.PutID(PageBlockSubheaderTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockSubheader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSubheader#f12bb6e1 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockSubheader#f12bb6e1: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockSubheader#f12bb6e1: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockSubheader) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockSubheader#f12bb6e1 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockSubheader#f12bb6e1: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockSubheader) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockParagraph represents TL type `pageBlockParagraph#467a0766`.
// A paragraph
//
// See https://core.telegram.org/constructor/pageBlockParagraph for reference.
type PageBlockParagraph struct {
	// Text
	Text RichTextClass
}

// PageBlockParagraphTypeID is TL type id of PageBlockParagraph.
const PageBlockParagraphTypeID = 0x467a0766

// construct implements constructor of PageBlockClass.
func ( PageBlockParagraph) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockParagraph{}
)

func ( *PageBlockParagraph) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockParagraph from given interface.
func ( *PageBlockParagraph) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockParagraph) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockParagraph",
		ID:   PageBlockParagraphTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockParagraph) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockParagraph#467a0766 as nil")
	}
	.PutID(PageBlockParagraphTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockParagraph) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockParagraph#467a0766 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockParagraph#467a0766: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockParagraph#467a0766: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockParagraph) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockParagraph#467a0766 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockParagraph#467a0766: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockParagraph) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockPreformatted represents TL type `pageBlockPreformatted#c070d93e`.
// Preformatted (<pre> text)
//
// See https://core.telegram.org/constructor/pageBlockPreformatted for reference.
type PageBlockPreformatted struct {
	// Text
	Text RichTextClass
	// Programming language of preformatted text
	Language string
}

// PageBlockPreformattedTypeID is TL type id of PageBlockPreformatted.
const PageBlockPreformattedTypeID = 0xc070d93e

// construct implements constructor of PageBlockClass.
func ( PageBlockPreformatted) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockPreformatted{}
)

func ( *PageBlockPreformatted) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}
	if !(.Language == "") {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockPreformatted from given interface.
func ( *PageBlockPreformatted) ( interface {
	() ( RichTextClass)
	() ( string)
}) {
	.Text = .()
	.Language = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockPreformatted) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockPreformatted",
		ID:   PageBlockPreformattedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
		{
			Name:       "Language",
			SchemaName: "language",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockPreformatted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPreformatted#c070d93e as nil")
	}
	.PutID(PageBlockPreformattedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockPreformatted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPreformatted#c070d93e as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockPreformatted#c070d93e: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockPreformatted#c070d93e: field text: %w", )
	}
	.PutString(.Language)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockPreformatted) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockPreformatted#c070d93e to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPreformatted#c070d93e: field text: %w", )
		}
		.Text = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPreformatted#c070d93e: field language: %w", )
		}
		.Language = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockPreformatted) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// GetLanguage returns value of Language field.
func ( *PageBlockPreformatted) () ( string) {
	if  == nil {
		return
	}
	return .Language
}

// PageBlockFooter represents TL type `pageBlockFooter#48870999`.
// Page footer
//
// See https://core.telegram.org/constructor/pageBlockFooter for reference.
type PageBlockFooter struct {
	// Contents
	Text RichTextClass
}

// PageBlockFooterTypeID is TL type id of PageBlockFooter.
const PageBlockFooterTypeID = 0x48870999

// construct implements constructor of PageBlockClass.
func ( PageBlockFooter) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockFooter{}
)

func ( *PageBlockFooter) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockFooter from given interface.
func ( *PageBlockFooter) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockFooter) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockFooter",
		ID:   PageBlockFooterTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockFooter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockFooter#48870999 as nil")
	}
	.PutID(PageBlockFooterTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockFooter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockFooter#48870999 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockFooter#48870999: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockFooter#48870999: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockFooter) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockFooter#48870999 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockFooter#48870999: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockFooter) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockDivider represents TL type `pageBlockDivider#db20b188`.
// An empty block separating a page
//
// See https://core.telegram.org/constructor/pageBlockDivider for reference.
type PageBlockDivider struct {
}

// PageBlockDividerTypeID is TL type id of PageBlockDivider.
const PageBlockDividerTypeID = 0xdb20b188

// construct implements constructor of PageBlockClass.
func ( PageBlockDivider) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockDivider{}
)

func ( *PageBlockDivider) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockDivider) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockDivider",
		ID:   PageBlockDividerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockDivider) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockDivider#db20b188 as nil")
	}
	.PutID(PageBlockDividerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockDivider) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockDivider#db20b188 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockDivider) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockDivider#db20b188 to nil")
	}
	return nil
}

// PageBlockAnchor represents TL type `pageBlockAnchor#ce0d37b0`.
// Link to section within the page itself (like <a href="#target">anchor</a>)
//
// See https://core.telegram.org/constructor/pageBlockAnchor for reference.
type PageBlockAnchor struct {
	// Name of target section
	Name string
}

// PageBlockAnchorTypeID is TL type id of PageBlockAnchor.
const PageBlockAnchorTypeID = 0xce0d37b0

// construct implements constructor of PageBlockClass.
func ( PageBlockAnchor) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockAnchor{}
)

func ( *PageBlockAnchor) () bool {
	if  == nil {
		return true
	}
	if !(.Name == "") {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockAnchor from given interface.
func ( *PageBlockAnchor) ( interface {
	() ( string)
}) {
	.Name = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockAnchor) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockAnchor",
		ID:   PageBlockAnchorTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Name",
			SchemaName: "name",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockAnchor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAnchor#ce0d37b0 as nil")
	}
	.PutID(PageBlockAnchorTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockAnchor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAnchor#ce0d37b0 as nil")
	}
	.PutString(.Name)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockAnchor) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockAnchor#ce0d37b0 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockAnchor#ce0d37b0: field name: %w", )
		}
		.Name = 
	}
	return nil
}

// GetName returns value of Name field.
func ( *PageBlockAnchor) () ( string) {
	if  == nil {
		return
	}
	return .Name
}

// PageBlockList represents TL type `pageBlockList#e4e88011`.
// Unordered list of IV blocks
//
// See https://core.telegram.org/constructor/pageBlockList for reference.
type PageBlockList struct {
	// List of blocks in an IV page
	Items []PageListItemClass
}

// PageBlockListTypeID is TL type id of PageBlockList.
const PageBlockListTypeID = 0xe4e88011

// construct implements constructor of PageBlockClass.
func ( PageBlockList) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockList{}
)

func ( *PageBlockList) () bool {
	if  == nil {
		return true
	}
	if !(.Items == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockList from given interface.
func ( *PageBlockList) ( interface {
	() ( []PageListItemClass)
}) {
	.Items = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockList) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockList",
		ID:   PageBlockListTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Items",
			SchemaName: "items",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockList#e4e88011 as nil")
	}
	.PutID(PageBlockListTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockList#e4e88011 as nil")
	}
	.PutVectorHeader(len(.Items))
	for ,  := range .Items {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockList#e4e88011: field items element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockList#e4e88011: field items element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockList#e4e88011 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockList#e4e88011: field items: %w", )
		}

		if  > 0 {
			.Items = make([]PageListItemClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageListItem()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockList#e4e88011: field items: %w", )
			}
			.Items = append(.Items, )
		}
	}
	return nil
}

// GetItems returns value of Items field.
func ( *PageBlockList) () ( []PageListItemClass) {
	if  == nil {
		return
	}
	return .Items
}

// MapItems returns field Items wrapped in PageListItemClassArray helper.
func ( *PageBlockList) () ( PageListItemClassArray) {
	return PageListItemClassArray(.Items)
}

// PageBlockBlockquote represents TL type `pageBlockBlockquote#263d7c26`.
// Quote (equivalent to the HTML <blockquote>)
//
// See https://core.telegram.org/constructor/pageBlockBlockquote for reference.
type PageBlockBlockquote struct {
	// Quote contents
	Text RichTextClass
	// Caption
	Caption RichTextClass
}

// PageBlockBlockquoteTypeID is TL type id of PageBlockBlockquote.
const PageBlockBlockquoteTypeID = 0x263d7c26

// construct implements constructor of PageBlockClass.
func ( PageBlockBlockquote) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockBlockquote{}
)

func ( *PageBlockBlockquote) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}
	if !(.Caption == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockBlockquote from given interface.
func ( *PageBlockBlockquote) ( interface {
	() ( RichTextClass)
	() ( RichTextClass)
}) {
	.Text = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockBlockquote) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockBlockquote",
		ID:   PageBlockBlockquoteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockBlockquote#263d7c26 as nil")
	}
	.PutID(PageBlockBlockquoteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockBlockquote#263d7c26 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockBlockquote#263d7c26: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockBlockquote#263d7c26: field text: %w", )
	}
	if .Caption == nil {
		return fmt.Errorf("unable to encode pageBlockBlockquote#263d7c26: field caption is nil")
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockBlockquote#263d7c26: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockBlockquote#263d7c26 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockBlockquote#263d7c26: field text: %w", )
		}
		.Text = 
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockBlockquote#263d7c26: field caption: %w", )
		}
		.Caption = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockBlockquote) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// GetCaption returns value of Caption field.
func ( *PageBlockBlockquote) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockPullquote represents TL type `pageBlockPullquote#4f4456d3`.
// Pullquote
//
// See https://core.telegram.org/constructor/pageBlockPullquote for reference.
type PageBlockPullquote struct {
	// Text
	Text RichTextClass
	// Caption
	Caption RichTextClass
}

// PageBlockPullquoteTypeID is TL type id of PageBlockPullquote.
const PageBlockPullquoteTypeID = 0x4f4456d3

// construct implements constructor of PageBlockClass.
func ( PageBlockPullquote) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockPullquote{}
)

func ( *PageBlockPullquote) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}
	if !(.Caption == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockPullquote from given interface.
func ( *PageBlockPullquote) ( interface {
	() ( RichTextClass)
	() ( RichTextClass)
}) {
	.Text = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockPullquote) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockPullquote",
		ID:   PageBlockPullquoteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockPullquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPullquote#4f4456d3 as nil")
	}
	.PutID(PageBlockPullquoteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockPullquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPullquote#4f4456d3 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockPullquote#4f4456d3: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockPullquote#4f4456d3: field text: %w", )
	}
	if .Caption == nil {
		return fmt.Errorf("unable to encode pageBlockPullquote#4f4456d3: field caption is nil")
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockPullquote#4f4456d3: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockPullquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockPullquote#4f4456d3 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPullquote#4f4456d3: field text: %w", )
		}
		.Text = 
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPullquote#4f4456d3: field caption: %w", )
		}
		.Caption = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockPullquote) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// GetCaption returns value of Caption field.
func ( *PageBlockPullquote) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockPhoto represents TL type `pageBlockPhoto#1759c560`.
// A photo
//
// See https://core.telegram.org/constructor/pageBlockPhoto for reference.
type PageBlockPhoto struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Photo ID
	PhotoID int64
	// Caption
	Caption PageCaption
	// HTTP URL of page the photo leads to when clicked
	//
	// Use SetURL and GetURL helpers.
	URL string
	// ID of preview of the page the photo leads to when clicked
	//
	// Use SetWebpageID and GetWebpageID helpers.
	WebpageID int64
}

// PageBlockPhotoTypeID is TL type id of PageBlockPhoto.
const PageBlockPhotoTypeID = 0x1759c560

// construct implements constructor of PageBlockClass.
func ( PageBlockPhoto) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockPhoto{}
)

func ( *PageBlockPhoto) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.PhotoID == 0) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}
	if !(.URL == "") {
		return false
	}
	if !(.WebpageID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockPhoto from given interface.
func ( *PageBlockPhoto) ( interface {
	() ( int64)
	() ( PageCaption)
	() ( string,  bool)
	() ( int64,  bool)
}) {
	.PhotoID = .()
	.Caption = .()
	if ,  := .();  {
		.URL = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockPhoto) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockPhoto",
		ID:   PageBlockPhotoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PhotoID",
			SchemaName: "photo_id",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
		{
			Name:       "URL",
			SchemaName: "url",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "WebpageID",
			SchemaName: "webpage_id",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PageBlockPhoto) () {
	if !(.URL == "") {
		.Flags.Set(0)
	}
	if !(.WebpageID == 0) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *PageBlockPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPhoto#1759c560 as nil")
	}
	.PutID(PageBlockPhotoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockPhoto#1759c560 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockPhoto#1759c560: field flags: %w", )
	}
	.PutLong(.PhotoID)
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockPhoto#1759c560: field caption: %w", )
	}
	if .Flags.Has(0) {
		.PutString(.URL)
	}
	if .Flags.Has(0) {
		.PutLong(.WebpageID)
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockPhoto) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockPhoto#1759c560 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockPhoto#1759c560: field flags: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPhoto#1759c560: field photo_id: %w", )
		}
		.PhotoID = 
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockPhoto#1759c560: field caption: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPhoto#1759c560: field url: %w", )
		}
		.URL = 
	}
	if .Flags.Has(0) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockPhoto#1759c560: field webpage_id: %w", )
		}
		.WebpageID = 
	}
	return nil
}

// GetPhotoID returns value of PhotoID field.
func ( *PageBlockPhoto) () ( int64) {
	if  == nil {
		return
	}
	return .PhotoID
}

// GetCaption returns value of Caption field.
func ( *PageBlockPhoto) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// SetURL sets value of URL conditional field.
func ( *PageBlockPhoto) ( string) {
	.Flags.Set(0)
	.URL = 
}

// GetURL returns value of URL conditional field and
// boolean which is true if field was set.
func ( *PageBlockPhoto) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .URL, true
}

// SetWebpageID sets value of WebpageID conditional field.
func ( *PageBlockPhoto) ( int64) {
	.Flags.Set(0)
	.WebpageID = 
}

// GetWebpageID returns value of WebpageID conditional field and
// boolean which is true if field was set.
func ( *PageBlockPhoto) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .WebpageID, true
}

// PageBlockVideo represents TL type `pageBlockVideo#7c8fe7b6`.
// Video
//
// See https://core.telegram.org/constructor/pageBlockVideo for reference.
type PageBlockVideo struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the video is set to autoplay
	Autoplay bool
	// Whether the video is set to loop
	Loop bool
	// Video ID
	VideoID int64
	// Caption
	Caption PageCaption
}

// PageBlockVideoTypeID is TL type id of PageBlockVideo.
const PageBlockVideoTypeID = 0x7c8fe7b6

// construct implements constructor of PageBlockClass.
func ( PageBlockVideo) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockVideo{}
)

func ( *PageBlockVideo) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Autoplay == false) {
		return false
	}
	if !(.Loop == false) {
		return false
	}
	if !(.VideoID == 0) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockVideo from given interface.
func ( *PageBlockVideo) ( interface {
	() ( bool)
	() ( bool)
	() ( int64)
	() ( PageCaption)
}) {
	.Autoplay = .()
	.Loop = .()
	.VideoID = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockVideo) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockVideo",
		ID:   PageBlockVideoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Autoplay",
			SchemaName: "autoplay",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Loop",
			SchemaName: "loop",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "VideoID",
			SchemaName: "video_id",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PageBlockVideo) () {
	if !(.Autoplay == false) {
		.Flags.Set(0)
	}
	if !(.Loop == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *PageBlockVideo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockVideo#7c8fe7b6 as nil")
	}
	.PutID(PageBlockVideoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockVideo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockVideo#7c8fe7b6 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockVideo#7c8fe7b6: field flags: %w", )
	}
	.PutLong(.VideoID)
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockVideo#7c8fe7b6: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockVideo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockVideo#7c8fe7b6 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockVideo#7c8fe7b6: field flags: %w", )
		}
	}
	.Autoplay = .Flags.Has(0)
	.Loop = .Flags.Has(1)
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockVideo#7c8fe7b6: field video_id: %w", )
		}
		.VideoID = 
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockVideo#7c8fe7b6: field caption: %w", )
		}
	}
	return nil
}

// SetAutoplay sets value of Autoplay conditional field.
func ( *PageBlockVideo) ( bool) {
	if  {
		.Flags.Set(0)
		.Autoplay = true
	} else {
		.Flags.Unset(0)
		.Autoplay = false
	}
}

// GetAutoplay returns value of Autoplay conditional field.
func ( *PageBlockVideo) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetLoop sets value of Loop conditional field.
func ( *PageBlockVideo) ( bool) {
	if  {
		.Flags.Set(1)
		.Loop = true
	} else {
		.Flags.Unset(1)
		.Loop = false
	}
}

// GetLoop returns value of Loop conditional field.
func ( *PageBlockVideo) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetVideoID returns value of VideoID field.
func ( *PageBlockVideo) () ( int64) {
	if  == nil {
		return
	}
	return .VideoID
}

// GetCaption returns value of Caption field.
func ( *PageBlockVideo) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockCover represents TL type `pageBlockCover#39f23300`.
// A page cover
//
// See https://core.telegram.org/constructor/pageBlockCover for reference.
type PageBlockCover struct {
	// Cover
	Cover PageBlockClass
}

// PageBlockCoverTypeID is TL type id of PageBlockCover.
const PageBlockCoverTypeID = 0x39f23300

// construct implements constructor of PageBlockClass.
func ( PageBlockCover) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockCover{}
)

func ( *PageBlockCover) () bool {
	if  == nil {
		return true
	}
	if !(.Cover == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockCover from given interface.
func ( *PageBlockCover) ( interface {
	() ( PageBlockClass)
}) {
	.Cover = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockCover) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockCover",
		ID:   PageBlockCoverTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Cover",
			SchemaName: "cover",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockCover) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockCover#39f23300 as nil")
	}
	.PutID(PageBlockCoverTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockCover) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockCover#39f23300 as nil")
	}
	if .Cover == nil {
		return fmt.Errorf("unable to encode pageBlockCover#39f23300: field cover is nil")
	}
	if  := .Cover.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockCover#39f23300: field cover: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockCover) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockCover#39f23300 to nil")
	}
	{
		,  := DecodePageBlock()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockCover#39f23300: field cover: %w", )
		}
		.Cover = 
	}
	return nil
}

// GetCover returns value of Cover field.
func ( *PageBlockCover) () ( PageBlockClass) {
	if  == nil {
		return
	}
	return .Cover
}

// PageBlockEmbed represents TL type `pageBlockEmbed#a8718dc5`.
// An embedded webpage
//
// See https://core.telegram.org/constructor/pageBlockEmbed for reference.
type PageBlockEmbed struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the block should be full width
	FullWidth bool
	// Whether scrolling should be allowed
	AllowScrolling bool
	// Web page URL, if available
	//
	// Use SetURL and GetURL helpers.
	URL string
	// HTML-markup of the embedded page
	//
	// Use SetHTML and GetHTML helpers.
	HTML string
	// Poster photo, if available
	//
	// Use SetPosterPhotoID and GetPosterPhotoID helpers.
	PosterPhotoID int64
	// Block width, if known
	//
	// Use SetW and GetW helpers.
	W int
	// Block height, if known
	//
	// Use SetH and GetH helpers.
	H int
	// Caption
	Caption PageCaption
}

// PageBlockEmbedTypeID is TL type id of PageBlockEmbed.
const PageBlockEmbedTypeID = 0xa8718dc5

// construct implements constructor of PageBlockClass.
func ( PageBlockEmbed) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockEmbed{}
)

func ( *PageBlockEmbed) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.FullWidth == false) {
		return false
	}
	if !(.AllowScrolling == false) {
		return false
	}
	if !(.URL == "") {
		return false
	}
	if !(.HTML == "") {
		return false
	}
	if !(.PosterPhotoID == 0) {
		return false
	}
	if !(.W == 0) {
		return false
	}
	if !(.H == 0) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockEmbed from given interface.
func ( *PageBlockEmbed) ( interface {
	() ( bool)
	() ( bool)
	() ( string,  bool)
	() ( string,  bool)
	() ( int64,  bool)
	() ( int,  bool)
	() ( int,  bool)
	() ( PageCaption)
}) {
	.FullWidth = .()
	.AllowScrolling = .()
	if ,  := .();  {
		.URL = 
	}

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

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

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

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

	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockEmbed) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockEmbed",
		ID:   PageBlockEmbedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "FullWidth",
			SchemaName: "full_width",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "AllowScrolling",
			SchemaName: "allow_scrolling",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "URL",
			SchemaName: "url",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "HTML",
			SchemaName: "html",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "PosterPhotoID",
			SchemaName: "poster_photo_id",
			Null:       !.Flags.Has(4),
		},
		{
			Name:       "W",
			SchemaName: "w",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "H",
			SchemaName: "h",
			Null:       !.Flags.Has(5),
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PageBlockEmbed) () {
	if !(.FullWidth == false) {
		.Flags.Set(0)
	}
	if !(.AllowScrolling == false) {
		.Flags.Set(3)
	}
	if !(.URL == "") {
		.Flags.Set(1)
	}
	if !(.HTML == "") {
		.Flags.Set(2)
	}
	if !(.PosterPhotoID == 0) {
		.Flags.Set(4)
	}
	if !(.W == 0) {
		.Flags.Set(5)
	}
	if !(.H == 0) {
		.Flags.Set(5)
	}
}

// Encode implements bin.Encoder.
func ( *PageBlockEmbed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockEmbed#a8718dc5 as nil")
	}
	.PutID(PageBlockEmbedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockEmbed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockEmbed#a8718dc5 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockEmbed#a8718dc5: field flags: %w", )
	}
	if .Flags.Has(1) {
		.PutString(.URL)
	}
	if .Flags.Has(2) {
		.PutString(.HTML)
	}
	if .Flags.Has(4) {
		.PutLong(.PosterPhotoID)
	}
	if .Flags.Has(5) {
		.PutInt(.W)
	}
	if .Flags.Has(5) {
		.PutInt(.H)
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockEmbed#a8718dc5: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockEmbed) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockEmbed#a8718dc5 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field flags: %w", )
		}
	}
	.FullWidth = .Flags.Has(0)
	.AllowScrolling = .Flags.Has(3)
	if .Flags.Has(1) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field url: %w", )
		}
		.URL = 
	}
	if .Flags.Has(2) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field html: %w", )
		}
		.HTML = 
	}
	if .Flags.Has(4) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field poster_photo_id: %w", )
		}
		.PosterPhotoID = 
	}
	if .Flags.Has(5) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field w: %w", )
		}
		.W = 
	}
	if .Flags.Has(5) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field h: %w", )
		}
		.H = 
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbed#a8718dc5: field caption: %w", )
		}
	}
	return nil
}

// SetFullWidth sets value of FullWidth conditional field.
func ( *PageBlockEmbed) ( bool) {
	if  {
		.Flags.Set(0)
		.FullWidth = true
	} else {
		.Flags.Unset(0)
		.FullWidth = false
	}
}

// GetFullWidth returns value of FullWidth conditional field.
func ( *PageBlockEmbed) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetAllowScrolling sets value of AllowScrolling conditional field.
func ( *PageBlockEmbed) ( bool) {
	if  {
		.Flags.Set(3)
		.AllowScrolling = true
	} else {
		.Flags.Unset(3)
		.AllowScrolling = false
	}
}

// GetAllowScrolling returns value of AllowScrolling conditional field.
func ( *PageBlockEmbed) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// SetURL sets value of URL conditional field.
func ( *PageBlockEmbed) ( string) {
	.Flags.Set(1)
	.URL = 
}

// GetURL returns value of URL conditional field and
// boolean which is true if field was set.
func ( *PageBlockEmbed) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .URL, true
}

// SetHTML sets value of HTML conditional field.
func ( *PageBlockEmbed) ( string) {
	.Flags.Set(2)
	.HTML = 
}

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

// SetPosterPhotoID sets value of PosterPhotoID conditional field.
func ( *PageBlockEmbed) ( int64) {
	.Flags.Set(4)
	.PosterPhotoID = 
}

// GetPosterPhotoID returns value of PosterPhotoID conditional field and
// boolean which is true if field was set.
func ( *PageBlockEmbed) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .PosterPhotoID, true
}

// SetW sets value of W conditional field.
func ( *PageBlockEmbed) ( int) {
	.Flags.Set(5)
	.W = 
}

// GetW returns value of W conditional field and
// boolean which is true if field was set.
func ( *PageBlockEmbed) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(5) {
		return , false
	}
	return .W, true
}

// SetH sets value of H conditional field.
func ( *PageBlockEmbed) ( int) {
	.Flags.Set(5)
	.H = 
}

// GetH returns value of H conditional field and
// boolean which is true if field was set.
func ( *PageBlockEmbed) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(5) {
		return , false
	}
	return .H, true
}

// GetCaption returns value of Caption field.
func ( *PageBlockEmbed) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockEmbedPost represents TL type `pageBlockEmbedPost#f259a80b`.
// An embedded post
//
// See https://core.telegram.org/constructor/pageBlockEmbedPost for reference.
type PageBlockEmbedPost struct {
	// Web page URL
	URL string
	// ID of generated webpage preview
	WebpageID int64
	// ID of the author's photo
	AuthorPhotoID int64
	// Author name
	Author string
	// Creation date
	Date int
	// Post contents
	Blocks []PageBlockClass
	// Caption
	Caption PageCaption
}

// PageBlockEmbedPostTypeID is TL type id of PageBlockEmbedPost.
const PageBlockEmbedPostTypeID = 0xf259a80b

// construct implements constructor of PageBlockClass.
func ( PageBlockEmbedPost) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockEmbedPost{}
)

func ( *PageBlockEmbedPost) () bool {
	if  == nil {
		return true
	}
	if !(.URL == "") {
		return false
	}
	if !(.WebpageID == 0) {
		return false
	}
	if !(.AuthorPhotoID == 0) {
		return false
	}
	if !(.Author == "") {
		return false
	}
	if !(.Date == 0) {
		return false
	}
	if !(.Blocks == nil) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockEmbedPost from given interface.
func ( *PageBlockEmbedPost) ( interface {
	() ( string)
	() ( int64)
	() ( int64)
	() ( string)
	() ( int)
	() ( []PageBlockClass)
	() ( PageCaption)
}) {
	.URL = .()
	.WebpageID = .()
	.AuthorPhotoID = .()
	.Author = .()
	.Date = .()
	.Blocks = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockEmbedPost) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockEmbedPost",
		ID:   PageBlockEmbedPostTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.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 
}

// Encode implements bin.Encoder.
func ( *PageBlockEmbedPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockEmbedPost#f259a80b as nil")
	}
	.PutID(PageBlockEmbedPostTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockEmbedPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockEmbedPost#f259a80b as nil")
	}
	.PutString(.URL)
	.PutLong(.WebpageID)
	.PutLong(.AuthorPhotoID)
	.PutString(.Author)
	.PutInt(.Date)
	.PutVectorHeader(len(.Blocks))
	for ,  := range .Blocks {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockEmbedPost#f259a80b: field blocks element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockEmbedPost#f259a80b: field blocks element with index %d: %w", , )
		}
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockEmbedPost#f259a80b: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockEmbedPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockEmbedPost#f259a80b to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field url: %w", )
		}
		.URL = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field webpage_id: %w", )
		}
		.WebpageID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field author_photo_id: %w", )
		}
		.AuthorPhotoID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field author: %w", )
		}
		.Author = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field date: %w", )
		}
		.Date = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field blocks: %w", )
		}

		if  > 0 {
			.Blocks = make([]PageBlockClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageBlock()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field blocks: %w", )
			}
			.Blocks = append(.Blocks, )
		}
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockEmbedPost#f259a80b: field caption: %w", )
		}
	}
	return nil
}

// GetURL returns value of URL field.
func ( *PageBlockEmbedPost) () ( string) {
	if  == nil {
		return
	}
	return .URL
}

// GetWebpageID returns value of WebpageID field.
func ( *PageBlockEmbedPost) () ( int64) {
	if  == nil {
		return
	}
	return .WebpageID
}

// GetAuthorPhotoID returns value of AuthorPhotoID field.
func ( *PageBlockEmbedPost) () ( int64) {
	if  == nil {
		return
	}
	return .AuthorPhotoID
}

// GetAuthor returns value of Author field.
func ( *PageBlockEmbedPost) () ( string) {
	if  == nil {
		return
	}
	return .Author
}

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

// GetBlocks returns value of Blocks field.
func ( *PageBlockEmbedPost) () ( []PageBlockClass) {
	if  == nil {
		return
	}
	return .Blocks
}

// GetCaption returns value of Caption field.
func ( *PageBlockEmbedPost) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// MapBlocks returns field Blocks wrapped in PageBlockClassArray helper.
func ( *PageBlockEmbedPost) () ( PageBlockClassArray) {
	return PageBlockClassArray(.Blocks)
}

// PageBlockCollage represents TL type `pageBlockCollage#65a0fa4d`.
// Collage of media
//
// See https://core.telegram.org/constructor/pageBlockCollage for reference.
type PageBlockCollage struct {
	// Media elements
	Items []PageBlockClass
	// Caption
	Caption PageCaption
}

// PageBlockCollageTypeID is TL type id of PageBlockCollage.
const PageBlockCollageTypeID = 0x65a0fa4d

// construct implements constructor of PageBlockClass.
func ( PageBlockCollage) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockCollage{}
)

func ( *PageBlockCollage) () bool {
	if  == nil {
		return true
	}
	if !(.Items == nil) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockCollage from given interface.
func ( *PageBlockCollage) ( interface {
	() ( []PageBlockClass)
	() ( PageCaption)
}) {
	.Items = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockCollage) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockCollage",
		ID:   PageBlockCollageTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Items",
			SchemaName: "items",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockCollage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockCollage#65a0fa4d as nil")
	}
	.PutID(PageBlockCollageTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockCollage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockCollage#65a0fa4d as nil")
	}
	.PutVectorHeader(len(.Items))
	for ,  := range .Items {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockCollage#65a0fa4d: field items element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockCollage#65a0fa4d: field items element with index %d: %w", , )
		}
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockCollage#65a0fa4d: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockCollage) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockCollage#65a0fa4d to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockCollage#65a0fa4d: field items: %w", )
		}

		if  > 0 {
			.Items = make([]PageBlockClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageBlock()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockCollage#65a0fa4d: field items: %w", )
			}
			.Items = append(.Items, )
		}
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockCollage#65a0fa4d: field caption: %w", )
		}
	}
	return nil
}

// GetItems returns value of Items field.
func ( *PageBlockCollage) () ( []PageBlockClass) {
	if  == nil {
		return
	}
	return .Items
}

// GetCaption returns value of Caption field.
func ( *PageBlockCollage) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// MapItems returns field Items wrapped in PageBlockClassArray helper.
func ( *PageBlockCollage) () ( PageBlockClassArray) {
	return PageBlockClassArray(.Items)
}

// PageBlockSlideshow represents TL type `pageBlockSlideshow#31f9590`.
// Slideshow
//
// See https://core.telegram.org/constructor/pageBlockSlideshow for reference.
type PageBlockSlideshow struct {
	// Slideshow items
	Items []PageBlockClass
	// Caption
	Caption PageCaption
}

// PageBlockSlideshowTypeID is TL type id of PageBlockSlideshow.
const PageBlockSlideshowTypeID = 0x31f9590

// construct implements constructor of PageBlockClass.
func ( PageBlockSlideshow) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockSlideshow{}
)

func ( *PageBlockSlideshow) () bool {
	if  == nil {
		return true
	}
	if !(.Items == nil) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockSlideshow from given interface.
func ( *PageBlockSlideshow) ( interface {
	() ( []PageBlockClass)
	() ( PageCaption)
}) {
	.Items = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockSlideshow) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockSlideshow",
		ID:   PageBlockSlideshowTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Items",
			SchemaName: "items",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockSlideshow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSlideshow#31f9590 as nil")
	}
	.PutID(PageBlockSlideshowTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockSlideshow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockSlideshow#31f9590 as nil")
	}
	.PutVectorHeader(len(.Items))
	for ,  := range .Items {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockSlideshow#31f9590: field items element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockSlideshow#31f9590: field items element with index %d: %w", , )
		}
	}
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockSlideshow#31f9590: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockSlideshow) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockSlideshow#31f9590 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockSlideshow#31f9590: field items: %w", )
		}

		if  > 0 {
			.Items = make([]PageBlockClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageBlock()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockSlideshow#31f9590: field items: %w", )
			}
			.Items = append(.Items, )
		}
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockSlideshow#31f9590: field caption: %w", )
		}
	}
	return nil
}

// GetItems returns value of Items field.
func ( *PageBlockSlideshow) () ( []PageBlockClass) {
	if  == nil {
		return
	}
	return .Items
}

// GetCaption returns value of Caption field.
func ( *PageBlockSlideshow) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// MapItems returns field Items wrapped in PageBlockClassArray helper.
func ( *PageBlockSlideshow) () ( PageBlockClassArray) {
	return PageBlockClassArray(.Items)
}

// PageBlockChannel represents TL type `pageBlockChannel#ef1751b5`.
// Reference to a telegram channel
//
// See https://core.telegram.org/constructor/pageBlockChannel for reference.
type PageBlockChannel struct {
	// The channel/supergroup/chat
	Channel ChatClass
}

// PageBlockChannelTypeID is TL type id of PageBlockChannel.
const PageBlockChannelTypeID = 0xef1751b5

// construct implements constructor of PageBlockClass.
func ( PageBlockChannel) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockChannel{}
)

func ( *PageBlockChannel) () bool {
	if  == nil {
		return true
	}
	if !(.Channel == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockChannel from given interface.
func ( *PageBlockChannel) ( interface {
	() ( ChatClass)
}) {
	.Channel = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockChannel) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockChannel",
		ID:   PageBlockChannelTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Channel",
			SchemaName: "channel",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockChannel#ef1751b5 as nil")
	}
	.PutID(PageBlockChannelTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockChannel#ef1751b5 as nil")
	}
	if .Channel == nil {
		return fmt.Errorf("unable to encode pageBlockChannel#ef1751b5: field channel is nil")
	}
	if  := .Channel.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockChannel#ef1751b5: field channel: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockChannel) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockChannel#ef1751b5 to nil")
	}
	{
		,  := DecodeChat()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockChannel#ef1751b5: field channel: %w", )
		}
		.Channel = 
	}
	return nil
}

// GetChannel returns value of Channel field.
func ( *PageBlockChannel) () ( ChatClass) {
	if  == nil {
		return
	}
	return .Channel
}

// PageBlockAudio represents TL type `pageBlockAudio#804361ea`.
// Audio
//
// See https://core.telegram.org/constructor/pageBlockAudio for reference.
type PageBlockAudio struct {
	// Audio ID (to be fetched from the container page¹ constructor
	//
	// Links:
	//  1) https://core.telegram.org/constructor/page
	AudioID int64
	// Audio caption
	Caption PageCaption
}

// PageBlockAudioTypeID is TL type id of PageBlockAudio.
const PageBlockAudioTypeID = 0x804361ea

// construct implements constructor of PageBlockClass.
func ( PageBlockAudio) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockAudio{}
)

func ( *PageBlockAudio) () bool {
	if  == nil {
		return true
	}
	if !(.AudioID == 0) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockAudio from given interface.
func ( *PageBlockAudio) ( interface {
	() ( int64)
	() ( PageCaption)
}) {
	.AudioID = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockAudio) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockAudio",
		ID:   PageBlockAudioTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "AudioID",
			SchemaName: "audio_id",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAudio#804361ea as nil")
	}
	.PutID(PageBlockAudioTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockAudio#804361ea as nil")
	}
	.PutLong(.AudioID)
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockAudio#804361ea: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockAudio) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockAudio#804361ea to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockAudio#804361ea: field audio_id: %w", )
		}
		.AudioID = 
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockAudio#804361ea: field caption: %w", )
		}
	}
	return nil
}

// GetAudioID returns value of AudioID field.
func ( *PageBlockAudio) () ( int64) {
	if  == nil {
		return
	}
	return .AudioID
}

// GetCaption returns value of Caption field.
func ( *PageBlockAudio) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockKicker represents TL type `pageBlockKicker#1e148390`.
// Kicker
//
// See https://core.telegram.org/constructor/pageBlockKicker for reference.
type PageBlockKicker struct {
	// Contents
	Text RichTextClass
}

// PageBlockKickerTypeID is TL type id of PageBlockKicker.
const PageBlockKickerTypeID = 0x1e148390

// construct implements constructor of PageBlockClass.
func ( PageBlockKicker) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockKicker{}
)

func ( *PageBlockKicker) () bool {
	if  == nil {
		return true
	}
	if !(.Text == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockKicker from given interface.
func ( *PageBlockKicker) ( interface {
	() ( RichTextClass)
}) {
	.Text = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockKicker) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockKicker",
		ID:   PageBlockKickerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Text",
			SchemaName: "text",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockKicker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockKicker#1e148390 as nil")
	}
	.PutID(PageBlockKickerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockKicker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockKicker#1e148390 as nil")
	}
	if .Text == nil {
		return fmt.Errorf("unable to encode pageBlockKicker#1e148390: field text is nil")
	}
	if  := .Text.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockKicker#1e148390: field text: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockKicker) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockKicker#1e148390 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockKicker#1e148390: field text: %w", )
		}
		.Text = 
	}
	return nil
}

// GetText returns value of Text field.
func ( *PageBlockKicker) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Text
}

// PageBlockTable represents TL type `pageBlockTable#bf4dea82`.
// Table
//
// See https://core.telegram.org/constructor/pageBlockTable for reference.
type PageBlockTable struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Does the table have a visible border?
	Bordered bool
	// Is the table striped?
	Striped bool
	// Title
	Title RichTextClass
	// Table rows
	Rows []PageTableRow
}

// PageBlockTableTypeID is TL type id of PageBlockTable.
const PageBlockTableTypeID = 0xbf4dea82

// construct implements constructor of PageBlockClass.
func ( PageBlockTable) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockTable{}
)

func ( *PageBlockTable) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Bordered == false) {
		return false
	}
	if !(.Striped == false) {
		return false
	}
	if !(.Title == nil) {
		return false
	}
	if !(.Rows == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockTable from given interface.
func ( *PageBlockTable) ( interface {
	() ( bool)
	() ( bool)
	() ( RichTextClass)
	() ( []PageTableRow)
}) {
	.Bordered = .()
	.Striped = .()
	.Title = .()
	.Rows = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockTable) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockTable",
		ID:   PageBlockTableTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Bordered",
			SchemaName: "bordered",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Striped",
			SchemaName: "striped",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Rows",
			SchemaName: "rows",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PageBlockTable) () {
	if !(.Bordered == false) {
		.Flags.Set(0)
	}
	if !(.Striped == false) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *PageBlockTable) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockTable#bf4dea82 as nil")
	}
	.PutID(PageBlockTableTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockTable) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockTable#bf4dea82 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockTable#bf4dea82: field flags: %w", )
	}
	if .Title == nil {
		return fmt.Errorf("unable to encode pageBlockTable#bf4dea82: field title is nil")
	}
	if  := .Title.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockTable#bf4dea82: field title: %w", )
	}
	.PutVectorHeader(len(.Rows))
	for ,  := range .Rows {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockTable#bf4dea82: field rows element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockTable) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockTable#bf4dea82 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockTable#bf4dea82: field flags: %w", )
		}
	}
	.Bordered = .Flags.Has(0)
	.Striped = .Flags.Has(1)
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockTable#bf4dea82: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockTable#bf4dea82: field rows: %w", )
		}

		if  > 0 {
			.Rows = make([]PageTableRow, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  PageTableRow
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode pageBlockTable#bf4dea82: field rows: %w", )
			}
			.Rows = append(.Rows, )
		}
	}
	return nil
}

// SetBordered sets value of Bordered conditional field.
func ( *PageBlockTable) ( bool) {
	if  {
		.Flags.Set(0)
		.Bordered = true
	} else {
		.Flags.Unset(0)
		.Bordered = false
	}
}

// GetBordered returns value of Bordered conditional field.
func ( *PageBlockTable) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetStriped sets value of Striped conditional field.
func ( *PageBlockTable) ( bool) {
	if  {
		.Flags.Set(1)
		.Striped = true
	} else {
		.Flags.Unset(1)
		.Striped = false
	}
}

// GetStriped returns value of Striped conditional field.
func ( *PageBlockTable) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetTitle returns value of Title field.
func ( *PageBlockTable) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Title
}

// GetRows returns value of Rows field.
func ( *PageBlockTable) () ( []PageTableRow) {
	if  == nil {
		return
	}
	return .Rows
}

// PageBlockOrderedList represents TL type `pageBlockOrderedList#9a8ae1e1`.
// Ordered list of IV blocks
//
// See https://core.telegram.org/constructor/pageBlockOrderedList for reference.
type PageBlockOrderedList struct {
	// List items
	Items []PageListOrderedItemClass
}

// PageBlockOrderedListTypeID is TL type id of PageBlockOrderedList.
const PageBlockOrderedListTypeID = 0x9a8ae1e1

// construct implements constructor of PageBlockClass.
func ( PageBlockOrderedList) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockOrderedList{}
)

func ( *PageBlockOrderedList) () bool {
	if  == nil {
		return true
	}
	if !(.Items == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockOrderedList from given interface.
func ( *PageBlockOrderedList) ( interface {
	() ( []PageListOrderedItemClass)
}) {
	.Items = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockOrderedList) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockOrderedList",
		ID:   PageBlockOrderedListTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Items",
			SchemaName: "items",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockOrderedList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockOrderedList#9a8ae1e1 as nil")
	}
	.PutID(PageBlockOrderedListTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockOrderedList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockOrderedList#9a8ae1e1 as nil")
	}
	.PutVectorHeader(len(.Items))
	for ,  := range .Items {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockOrderedList#9a8ae1e1: field items element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockOrderedList#9a8ae1e1: field items element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockOrderedList) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockOrderedList#9a8ae1e1 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockOrderedList#9a8ae1e1: field items: %w", )
		}

		if  > 0 {
			.Items = make([]PageListOrderedItemClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageListOrderedItem()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockOrderedList#9a8ae1e1: field items: %w", )
			}
			.Items = append(.Items, )
		}
	}
	return nil
}

// GetItems returns value of Items field.
func ( *PageBlockOrderedList) () ( []PageListOrderedItemClass) {
	if  == nil {
		return
	}
	return .Items
}

// MapItems returns field Items wrapped in PageListOrderedItemClassArray helper.
func ( *PageBlockOrderedList) () ( PageListOrderedItemClassArray) {
	return PageListOrderedItemClassArray(.Items)
}

// PageBlockDetails represents TL type `pageBlockDetails#76768bed`.
// A collapsible details block
//
// See https://core.telegram.org/constructor/pageBlockDetails for reference.
type PageBlockDetails struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the block is open by default
	Open bool
	// Block contents
	Blocks []PageBlockClass
	// Always visible heading for the block
	Title RichTextClass
}

// PageBlockDetailsTypeID is TL type id of PageBlockDetails.
const PageBlockDetailsTypeID = 0x76768bed

// construct implements constructor of PageBlockClass.
func ( PageBlockDetails) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockDetails{}
)

func ( *PageBlockDetails) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Open == false) {
		return false
	}
	if !(.Blocks == nil) {
		return false
	}
	if !(.Title == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockDetails from given interface.
func ( *PageBlockDetails) ( interface {
	() ( bool)
	() ( []PageBlockClass)
	() ( RichTextClass)
}) {
	.Open = .()
	.Blocks = .()
	.Title = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockDetails) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockDetails",
		ID:   PageBlockDetailsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Open",
			SchemaName: "open",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Blocks",
			SchemaName: "blocks",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PageBlockDetails) () {
	if !(.Open == false) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *PageBlockDetails) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockDetails#76768bed as nil")
	}
	.PutID(PageBlockDetailsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockDetails) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockDetails#76768bed as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockDetails#76768bed: field flags: %w", )
	}
	.PutVectorHeader(len(.Blocks))
	for ,  := range .Blocks {
		if  == nil {
			return fmt.Errorf("unable to encode pageBlockDetails#76768bed: field blocks element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockDetails#76768bed: field blocks element with index %d: %w", , )
		}
	}
	if .Title == nil {
		return fmt.Errorf("unable to encode pageBlockDetails#76768bed: field title is nil")
	}
	if  := .Title.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockDetails#76768bed: field title: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockDetails) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockDetails#76768bed to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockDetails#76768bed: field flags: %w", )
		}
	}
	.Open = .Flags.Has(0)
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockDetails#76768bed: field blocks: %w", )
		}

		if  > 0 {
			.Blocks = make([]PageBlockClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodePageBlock()
			if  != nil {
				return fmt.Errorf("unable to decode pageBlockDetails#76768bed: field blocks: %w", )
			}
			.Blocks = append(.Blocks, )
		}
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockDetails#76768bed: field title: %w", )
		}
		.Title = 
	}
	return nil
}

// SetOpen sets value of Open conditional field.
func ( *PageBlockDetails) ( bool) {
	if  {
		.Flags.Set(0)
		.Open = true
	} else {
		.Flags.Unset(0)
		.Open = false
	}
}

// GetOpen returns value of Open conditional field.
func ( *PageBlockDetails) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// GetBlocks returns value of Blocks field.
func ( *PageBlockDetails) () ( []PageBlockClass) {
	if  == nil {
		return
	}
	return .Blocks
}

// GetTitle returns value of Title field.
func ( *PageBlockDetails) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Title
}

// MapBlocks returns field Blocks wrapped in PageBlockClassArray helper.
func ( *PageBlockDetails) () ( PageBlockClassArray) {
	return PageBlockClassArray(.Blocks)
}

// PageBlockRelatedArticles represents TL type `pageBlockRelatedArticles#16115a96`.
// Related articles
//
// See https://core.telegram.org/constructor/pageBlockRelatedArticles for reference.
type PageBlockRelatedArticles struct {
	// Title
	Title RichTextClass
	// Related articles
	Articles []PageRelatedArticle
}

// PageBlockRelatedArticlesTypeID is TL type id of PageBlockRelatedArticles.
const PageBlockRelatedArticlesTypeID = 0x16115a96

// construct implements constructor of PageBlockClass.
func ( PageBlockRelatedArticles) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockRelatedArticles{}
)

func ( *PageBlockRelatedArticles) () bool {
	if  == nil {
		return true
	}
	if !(.Title == nil) {
		return false
	}
	if !(.Articles == nil) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockRelatedArticles from given interface.
func ( *PageBlockRelatedArticles) ( interface {
	() ( RichTextClass)
	() ( []PageRelatedArticle)
}) {
	.Title = .()
	.Articles = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockRelatedArticles) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockRelatedArticles",
		ID:   PageBlockRelatedArticlesTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Articles",
			SchemaName: "articles",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockRelatedArticles) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockRelatedArticles#16115a96 as nil")
	}
	.PutID(PageBlockRelatedArticlesTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockRelatedArticles) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockRelatedArticles#16115a96 as nil")
	}
	if .Title == nil {
		return fmt.Errorf("unable to encode pageBlockRelatedArticles#16115a96: field title is nil")
	}
	if  := .Title.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockRelatedArticles#16115a96: field title: %w", )
	}
	.PutVectorHeader(len(.Articles))
	for ,  := range .Articles {
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode pageBlockRelatedArticles#16115a96: field articles element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockRelatedArticles) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockRelatedArticles#16115a96 to nil")
	}
	{
		,  := DecodeRichText()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockRelatedArticles#16115a96: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockRelatedArticles#16115a96: field articles: %w", )
		}

		if  > 0 {
			.Articles = make([]PageRelatedArticle, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			var  PageRelatedArticle
			if  := .Decode();  != nil {
				return fmt.Errorf("unable to decode pageBlockRelatedArticles#16115a96: field articles: %w", )
			}
			.Articles = append(.Articles, )
		}
	}
	return nil
}

// GetTitle returns value of Title field.
func ( *PageBlockRelatedArticles) () ( RichTextClass) {
	if  == nil {
		return
	}
	return .Title
}

// GetArticles returns value of Articles field.
func ( *PageBlockRelatedArticles) () ( []PageRelatedArticle) {
	if  == nil {
		return
	}
	return .Articles
}

// PageBlockMap represents TL type `pageBlockMap#a44f3ef6`.
// A map
//
// See https://core.telegram.org/constructor/pageBlockMap for reference.
type PageBlockMap struct {
	// Location of the map center
	Geo GeoPointClass
	// Map zoom level; 13-20
	Zoom int
	// Map width in pixels before applying scale; 16-102
	W int
	// Map height in pixels before applying scale; 16-1024
	H int
	// Caption
	Caption PageCaption
}

// PageBlockMapTypeID is TL type id of PageBlockMap.
const PageBlockMapTypeID = 0xa44f3ef6

// construct implements constructor of PageBlockClass.
func ( PageBlockMap) () PageBlockClass { return & }

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

	_ PageBlockClass = &PageBlockMap{}
)

func ( *PageBlockMap) () bool {
	if  == nil {
		return true
	}
	if !(.Geo == nil) {
		return false
	}
	if !(.Zoom == 0) {
		return false
	}
	if !(.W == 0) {
		return false
	}
	if !(.H == 0) {
		return false
	}
	if !(.Caption.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills PageBlockMap from given interface.
func ( *PageBlockMap) ( interface {
	() ( GeoPointClass)
	() ( int)
	() ( int)
	() ( int)
	() ( PageCaption)
}) {
	.Geo = .()
	.Zoom = .()
	.W = .()
	.H = .()
	.Caption = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *PageBlockMap) () tdp.Type {
	 := tdp.Type{
		Name: "pageBlockMap",
		ID:   PageBlockMapTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Geo",
			SchemaName: "geo",
		},
		{
			Name:       "Zoom",
			SchemaName: "zoom",
		},
		{
			Name:       "W",
			SchemaName: "w",
		},
		{
			Name:       "H",
			SchemaName: "h",
		},
		{
			Name:       "Caption",
			SchemaName: "caption",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PageBlockMap) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockMap#a44f3ef6 as nil")
	}
	.PutID(PageBlockMapTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PageBlockMap) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pageBlockMap#a44f3ef6 as nil")
	}
	if .Geo == nil {
		return fmt.Errorf("unable to encode pageBlockMap#a44f3ef6: field geo is nil")
	}
	if  := .Geo.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockMap#a44f3ef6: field geo: %w", )
	}
	.PutInt(.Zoom)
	.PutInt(.W)
	.PutInt(.H)
	if  := .Caption.Encode();  != nil {
		return fmt.Errorf("unable to encode pageBlockMap#a44f3ef6: field caption: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PageBlockMap) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pageBlockMap#a44f3ef6 to nil")
	}
	{
		,  := DecodeGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockMap#a44f3ef6: field geo: %w", )
		}
		.Geo = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockMap#a44f3ef6: field zoom: %w", )
		}
		.Zoom = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockMap#a44f3ef6: field w: %w", )
		}
		.W = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode pageBlockMap#a44f3ef6: field h: %w", )
		}
		.H = 
	}
	{
		if  := .Caption.Decode();  != nil {
			return fmt.Errorf("unable to decode pageBlockMap#a44f3ef6: field caption: %w", )
		}
	}
	return nil
}

// GetGeo returns value of Geo field.
func ( *PageBlockMap) () ( GeoPointClass) {
	if  == nil {
		return
	}
	return .Geo
}

// GetZoom returns value of Zoom field.
func ( *PageBlockMap) () ( int) {
	if  == nil {
		return
	}
	return .Zoom
}

// GetW returns value of W field.
func ( *PageBlockMap) () ( int) {
	if  == nil {
		return
	}
	return .W
}

// GetH returns value of H field.
func ( *PageBlockMap) () ( int) {
	if  == nil {
		return
	}
	return .H
}

// GetCaption returns value of Caption field.
func ( *PageBlockMap) () ( PageCaption) {
	if  == nil {
		return
	}
	return .Caption
}

// PageBlockClassName is schema name of PageBlockClass.
const PageBlockClassName = "PageBlock"

// PageBlockClass represents PageBlock generic type.
//
// See https://core.telegram.org/type/PageBlock for reference.
//
// Example:
//
//	g, err := tg.DecodePageBlock(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.PageBlockUnsupported: // pageBlockUnsupported#13567e8a
//	case *tg.PageBlockTitle: // pageBlockTitle#70abc3fd
//	case *tg.PageBlockSubtitle: // pageBlockSubtitle#8ffa9a1f
//	case *tg.PageBlockAuthorDate: // pageBlockAuthorDate#baafe5e0
//	case *tg.PageBlockHeader: // pageBlockHeader#bfd064ec
//	case *tg.PageBlockSubheader: // pageBlockSubheader#f12bb6e1
//	case *tg.PageBlockParagraph: // pageBlockParagraph#467a0766
//	case *tg.PageBlockPreformatted: // pageBlockPreformatted#c070d93e
//	case *tg.PageBlockFooter: // pageBlockFooter#48870999
//	case *tg.PageBlockDivider: // pageBlockDivider#db20b188
//	case *tg.PageBlockAnchor: // pageBlockAnchor#ce0d37b0
//	case *tg.PageBlockList: // pageBlockList#e4e88011
//	case *tg.PageBlockBlockquote: // pageBlockBlockquote#263d7c26
//	case *tg.PageBlockPullquote: // pageBlockPullquote#4f4456d3
//	case *tg.PageBlockPhoto: // pageBlockPhoto#1759c560
//	case *tg.PageBlockVideo: // pageBlockVideo#7c8fe7b6
//	case *tg.PageBlockCover: // pageBlockCover#39f23300
//	case *tg.PageBlockEmbed: // pageBlockEmbed#a8718dc5
//	case *tg.PageBlockEmbedPost: // pageBlockEmbedPost#f259a80b
//	case *tg.PageBlockCollage: // pageBlockCollage#65a0fa4d
//	case *tg.PageBlockSlideshow: // pageBlockSlideshow#31f9590
//	case *tg.PageBlockChannel: // pageBlockChannel#ef1751b5
//	case *tg.PageBlockAudio: // pageBlockAudio#804361ea
//	case *tg.PageBlockKicker: // pageBlockKicker#1e148390
//	case *tg.PageBlockTable: // pageBlockTable#bf4dea82
//	case *tg.PageBlockOrderedList: // pageBlockOrderedList#9a8ae1e1
//	case *tg.PageBlockDetails: // pageBlockDetails#76768bed
//	case *tg.PageBlockRelatedArticles: // pageBlockRelatedArticles#16115a96
//	case *tg.PageBlockMap: // pageBlockMap#a44f3ef6
//	default: panic(v)
//	}
type PageBlockClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() PageBlockClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool
}

// DecodePageBlock implements binary de-serialization for PageBlockClass.
func ( *bin.Buffer) (PageBlockClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case PageBlockUnsupportedTypeID:
		// Decoding pageBlockUnsupported#13567e8a.
		 := PageBlockUnsupported{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockTitleTypeID:
		// Decoding pageBlockTitle#70abc3fd.
		 := PageBlockTitle{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockSubtitleTypeID:
		// Decoding pageBlockSubtitle#8ffa9a1f.
		 := PageBlockSubtitle{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockAuthorDateTypeID:
		// Decoding pageBlockAuthorDate#baafe5e0.
		 := PageBlockAuthorDate{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockHeaderTypeID:
		// Decoding pageBlockHeader#bfd064ec.
		 := PageBlockHeader{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockSubheaderTypeID:
		// Decoding pageBlockSubheader#f12bb6e1.
		 := PageBlockSubheader{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockParagraphTypeID:
		// Decoding pageBlockParagraph#467a0766.
		 := PageBlockParagraph{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockPreformattedTypeID:
		// Decoding pageBlockPreformatted#c070d93e.
		 := PageBlockPreformatted{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockFooterTypeID:
		// Decoding pageBlockFooter#48870999.
		 := PageBlockFooter{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockDividerTypeID:
		// Decoding pageBlockDivider#db20b188.
		 := PageBlockDivider{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockAnchorTypeID:
		// Decoding pageBlockAnchor#ce0d37b0.
		 := PageBlockAnchor{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockListTypeID:
		// Decoding pageBlockList#e4e88011.
		 := PageBlockList{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockBlockquoteTypeID:
		// Decoding pageBlockBlockquote#263d7c26.
		 := PageBlockBlockquote{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockPullquoteTypeID:
		// Decoding pageBlockPullquote#4f4456d3.
		 := PageBlockPullquote{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockPhotoTypeID:
		// Decoding pageBlockPhoto#1759c560.
		 := PageBlockPhoto{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockVideoTypeID:
		// Decoding pageBlockVideo#7c8fe7b6.
		 := PageBlockVideo{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockCoverTypeID:
		// Decoding pageBlockCover#39f23300.
		 := PageBlockCover{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockEmbedTypeID:
		// Decoding pageBlockEmbed#a8718dc5.
		 := PageBlockEmbed{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockEmbedPostTypeID:
		// Decoding pageBlockEmbedPost#f259a80b.
		 := PageBlockEmbedPost{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockCollageTypeID:
		// Decoding pageBlockCollage#65a0fa4d.
		 := PageBlockCollage{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockSlideshowTypeID:
		// Decoding pageBlockSlideshow#31f9590.
		 := PageBlockSlideshow{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockChannelTypeID:
		// Decoding pageBlockChannel#ef1751b5.
		 := PageBlockChannel{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockAudioTypeID:
		// Decoding pageBlockAudio#804361ea.
		 := PageBlockAudio{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockKickerTypeID:
		// Decoding pageBlockKicker#1e148390.
		 := PageBlockKicker{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockTableTypeID:
		// Decoding pageBlockTable#bf4dea82.
		 := PageBlockTable{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockOrderedListTypeID:
		// Decoding pageBlockOrderedList#9a8ae1e1.
		 := PageBlockOrderedList{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockDetailsTypeID:
		// Decoding pageBlockDetails#76768bed.
		 := PageBlockDetails{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockRelatedArticlesTypeID:
		// Decoding pageBlockRelatedArticles#16115a96.
		 := PageBlockRelatedArticles{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	case PageBlockMapTypeID:
		// Decoding pageBlockMap#a44f3ef6.
		 := PageBlockMap{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PageBlockClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode PageBlockClass: %w", bin.NewUnexpectedID())
	}
}

// PageBlock boxes the PageBlockClass providing a helper.
type PageBlockBox struct {
	PageBlock PageBlockClass
}

// Decode implements bin.Decoder for PageBlockBox.
func ( *PageBlockBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode PageBlockBox to nil")
	}
	,  := DecodePageBlock()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.PageBlock = 
	return nil
}

// Encode implements bin.Encode for PageBlockBox.
func ( *PageBlockBox) ( *bin.Buffer) error {
	if  == nil || .PageBlock == nil {
		return fmt.Errorf("unable to encode PageBlockClass as nil")
	}
	return .PageBlock.Encode()
}