// 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{}
)

// WebPageAttributeTheme represents TL type `webPageAttributeTheme#54b56617`.
// Page theme
//
// See https://core.telegram.org/constructor/webPageAttributeTheme for reference.
type WebPageAttributeTheme struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Theme files
	//
	// Use SetDocuments and GetDocuments helpers.
	Documents []DocumentClass
	// Theme settings
	//
	// Use SetSettings and GetSettings helpers.
	Settings ThemeSettings
}

// WebPageAttributeThemeTypeID is TL type id of WebPageAttributeTheme.
const WebPageAttributeThemeTypeID = 0x54b56617

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeTheme) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeTheme{}
)

func ( *WebPageAttributeTheme) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Documents == nil) {
		return false
	}
	if !(.Settings.Zero()) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeTheme from given interface.
func ( *WebPageAttributeTheme) ( interface {
	() ( []DocumentClass,  bool)
	() ( ThemeSettings,  bool)
}) {
	if ,  := .();  {
		.Documents = 
	}

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

}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeTheme) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeTheme",
		ID:   WebPageAttributeThemeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Documents",
			SchemaName: "documents",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Settings",
			SchemaName: "settings",
			Null:       !.Flags.Has(1),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *WebPageAttributeTheme) () {
	if !(.Documents == nil) {
		.Flags.Set(0)
	}
	if !(.Settings.Zero()) {
		.Flags.Set(1)
	}
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeTheme#54b56617 as nil")
	}
	.PutID(WebPageAttributeThemeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeTheme#54b56617 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeTheme#54b56617: field flags: %w", )
	}
	if .Flags.Has(0) {
		.PutVectorHeader(len(.Documents))
		for ,  := range .Documents {
			if  == nil {
				return fmt.Errorf("unable to encode webPageAttributeTheme#54b56617: field documents element with index %d is nil", )
			}
			if  := .Encode();  != nil {
				return fmt.Errorf("unable to encode webPageAttributeTheme#54b56617: field documents element with index %d: %w", , )
			}
		}
	}
	if .Flags.Has(1) {
		if  := .Settings.Encode();  != nil {
			return fmt.Errorf("unable to encode webPageAttributeTheme#54b56617: field settings: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeTheme) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeTheme#54b56617 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode webPageAttributeTheme#54b56617: field flags: %w", )
		}
	}
	if .Flags.Has(0) {
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeTheme#54b56617: field documents: %w", )
		}

		if  > 0 {
			.Documents = make([]DocumentClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDocument()
			if  != nil {
				return fmt.Errorf("unable to decode webPageAttributeTheme#54b56617: field documents: %w", )
			}
			.Documents = append(.Documents, )
		}
	}
	if .Flags.Has(1) {
		if  := .Settings.Decode();  != nil {
			return fmt.Errorf("unable to decode webPageAttributeTheme#54b56617: field settings: %w", )
		}
	}
	return nil
}

// SetDocuments sets value of Documents conditional field.
func ( *WebPageAttributeTheme) ( []DocumentClass) {
	.Flags.Set(0)
	.Documents = 
}

// GetDocuments returns value of Documents conditional field and
// boolean which is true if field was set.
func ( *WebPageAttributeTheme) () ( []DocumentClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Documents, true
}

// SetSettings sets value of Settings conditional field.
func ( *WebPageAttributeTheme) ( ThemeSettings) {
	.Flags.Set(1)
	.Settings = 
}

// GetSettings returns value of Settings conditional field and
// boolean which is true if field was set.
func ( *WebPageAttributeTheme) () ( ThemeSettings,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .Settings, true
}

// MapDocuments returns field Documents wrapped in DocumentClassArray helper.
func ( *WebPageAttributeTheme) () ( DocumentClassArray,  bool) {
	if !.Flags.Has(0) {
		return , false
	}
	return DocumentClassArray(.Documents), true
}

// WebPageAttributeStory represents TL type `webPageAttributeStory#2e94c3e7`.
// Webpage preview of a Telegram story
//
// See https://core.telegram.org/constructor/webPageAttributeStory for reference.
type WebPageAttributeStory struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Peer that posted the story
	Peer PeerClass
	// Story ID¹
	//
	// Links:
	//  1) https://core.telegram.org/api/stories#watching-stories
	ID int
	// May contain the story, if not the story should be fetched when and if needed using
	// stories.getStoriesByID¹ with the above id and peer.
	//
	// Links:
	//  1) https://core.telegram.org/method/stories.getStoriesByID
	//
	// Use SetStory and GetStory helpers.
	Story StoryItemClass
}

// WebPageAttributeStoryTypeID is TL type id of WebPageAttributeStory.
const WebPageAttributeStoryTypeID = 0x2e94c3e7

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeStory) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeStory{}
)

func ( *WebPageAttributeStory) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.Story == nil) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeStory from given interface.
func ( *WebPageAttributeStory) ( interface {
	() ( PeerClass)
	() ( int)
	() ( StoryItemClass,  bool)
}) {
	.Peer = .()
	.ID = .()
	if ,  := .();  {
		.Story = 
	}

}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeStory) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeStory",
		ID:   WebPageAttributeStoryTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "Story",
			SchemaName: "story",
			Null:       !.Flags.Has(0),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *WebPageAttributeStory) () {
	if !(.Story == nil) {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStory#2e94c3e7 as nil")
	}
	.PutID(WebPageAttributeStoryTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStory#2e94c3e7 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeStory#2e94c3e7: field flags: %w", )
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode webPageAttributeStory#2e94c3e7: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeStory#2e94c3e7: field peer: %w", )
	}
	.PutInt(.ID)
	if .Flags.Has(0) {
		if .Story == nil {
			return fmt.Errorf("unable to encode webPageAttributeStory#2e94c3e7: field story is nil")
		}
		if  := .Story.Encode();  != nil {
			return fmt.Errorf("unable to encode webPageAttributeStory#2e94c3e7: field story: %w", )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeStory) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeStory#2e94c3e7 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStory#2e94c3e7: field flags: %w", )
		}
	}
	{
		,  := DecodePeer()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStory#2e94c3e7: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStory#2e94c3e7: field id: %w", )
		}
		.ID = 
	}
	if .Flags.Has(0) {
		,  := DecodeStoryItem()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStory#2e94c3e7: field story: %w", )
		}
		.Story = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *WebPageAttributeStory) () ( PeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetID returns value of ID field.
func ( *WebPageAttributeStory) () ( int) {
	if  == nil {
		return
	}
	return .ID
}

// SetStory sets value of Story conditional field.
func ( *WebPageAttributeStory) ( StoryItemClass) {
	.Flags.Set(0)
	.Story = 
}

// GetStory returns value of Story conditional field and
// boolean which is true if field was set.
func ( *WebPageAttributeStory) () ( StoryItemClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(0) {
		return , false
	}
	return .Story, true
}

// WebPageAttributeStickerSet represents TL type `webPageAttributeStickerSet#50cc03d3`.
// Contains info about a stickerset »¹, for a webPage² preview of a stickerset deep
// link »³ (the webPage⁓ will have a type of telegram_stickerset).
//
// Links:
//  1. https://core.telegram.org/api/stickers
//  2. https://core.telegram.org/constructor/webPage
//  3. https://core.telegram.org/api/links#stickerset-links
//  4. https://core.telegram.org/constructor/webPage
//
// See https://core.telegram.org/constructor/webPageAttributeStickerSet for reference.
type WebPageAttributeStickerSet struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether this i s a custom emoji stickerset¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	Emojis bool
	// Whether the color of this TGS custom emoji stickerset should be changed to the text
	// color when used in messages, the accent color if used as emoji status, white on chat
	// photos, or another appropriate color based on context.
	TextColor bool
	// A subset of the stickerset in the stickerset.
	Stickers []DocumentClass
}

// WebPageAttributeStickerSetTypeID is TL type id of WebPageAttributeStickerSet.
const WebPageAttributeStickerSetTypeID = 0x50cc03d3

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeStickerSet) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeStickerSet{}
)

func ( *WebPageAttributeStickerSet) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Emojis == false) {
		return false
	}
	if !(.TextColor == false) {
		return false
	}
	if !(.Stickers == nil) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeStickerSet from given interface.
func ( *WebPageAttributeStickerSet) ( interface {
	() ( bool)
	() ( bool)
	() ( []DocumentClass)
}) {
	.Emojis = .()
	.TextColor = .()
	.Stickers = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeStickerSet) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeStickerSet",
		ID:   WebPageAttributeStickerSetTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Emojis",
			SchemaName: "emojis",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "TextColor",
			SchemaName: "text_color",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Stickers",
			SchemaName: "stickers",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *WebPageAttributeStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStickerSet#50cc03d3 as nil")
	}
	.PutID(WebPageAttributeStickerSetTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStickerSet#50cc03d3 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeStickerSet#50cc03d3: field flags: %w", )
	}
	.PutVectorHeader(len(.Stickers))
	for ,  := range .Stickers {
		if  == nil {
			return fmt.Errorf("unable to encode webPageAttributeStickerSet#50cc03d3: field stickers element with index %d is nil", )
		}
		if  := .Encode();  != nil {
			return fmt.Errorf("unable to encode webPageAttributeStickerSet#50cc03d3: field stickers element with index %d: %w", , )
		}
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeStickerSet) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeStickerSet#50cc03d3 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStickerSet#50cc03d3: field flags: %w", )
		}
	}
	.Emojis = .Flags.Has(0)
	.TextColor = .Flags.Has(1)
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStickerSet#50cc03d3: field stickers: %w", )
		}

		if  > 0 {
			.Stickers = make([]DocumentClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDocument()
			if  != nil {
				return fmt.Errorf("unable to decode webPageAttributeStickerSet#50cc03d3: field stickers: %w", )
			}
			.Stickers = append(.Stickers, )
		}
	}
	return nil
}

// SetEmojis sets value of Emojis conditional field.
func ( *WebPageAttributeStickerSet) ( bool) {
	if  {
		.Flags.Set(0)
		.Emojis = true
	} else {
		.Flags.Unset(0)
		.Emojis = false
	}
}

// GetEmojis returns value of Emojis conditional field.
func ( *WebPageAttributeStickerSet) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetTextColor sets value of TextColor conditional field.
func ( *WebPageAttributeStickerSet) ( bool) {
	if  {
		.Flags.Set(1)
		.TextColor = true
	} else {
		.Flags.Unset(1)
		.TextColor = false
	}
}

// GetTextColor returns value of TextColor conditional field.
func ( *WebPageAttributeStickerSet) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetStickers returns value of Stickers field.
func ( *WebPageAttributeStickerSet) () ( []DocumentClass) {
	if  == nil {
		return
	}
	return .Stickers
}

// MapStickers returns field Stickers wrapped in DocumentClassArray helper.
func ( *WebPageAttributeStickerSet) () ( DocumentClassArray) {
	return DocumentClassArray(.Stickers)
}

// WebPageAttributeUniqueStarGift represents TL type `webPageAttributeUniqueStarGift#cf6f6db8`.
// Contains info about collectible gift »¹ for a webPage² preview of a collectible
// gift »³ (the webPage⁓ will have a type of telegram_nft).
//
// Links:
//  1. https://core.telegram.org/api/gifts#collectible-gifts
//  2. https://core.telegram.org/constructor/webPage
//  3. https://core.telegram.org/api/gifts#collectible-gifts
//  4. https://core.telegram.org/constructor/webPage
//
// See https://core.telegram.org/constructor/webPageAttributeUniqueStarGift for reference.
type WebPageAttributeUniqueStarGift struct {
	// The starGiftUnique¹ constructor.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/starGiftUnique
	Gift StarGiftClass
}

// WebPageAttributeUniqueStarGiftTypeID is TL type id of WebPageAttributeUniqueStarGift.
const WebPageAttributeUniqueStarGiftTypeID = 0xcf6f6db8

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeUniqueStarGift) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeUniqueStarGift{}
)

func ( *WebPageAttributeUniqueStarGift) () bool {
	if  == nil {
		return true
	}
	if !(.Gift == nil) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeUniqueStarGift from given interface.
func ( *WebPageAttributeUniqueStarGift) ( interface {
	() ( StarGiftClass)
}) {
	.Gift = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeUniqueStarGift) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeUniqueStarGift",
		ID:   WebPageAttributeUniqueStarGiftTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeUniqueStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeUniqueStarGift#cf6f6db8 as nil")
	}
	.PutID(WebPageAttributeUniqueStarGiftTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeUniqueStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeUniqueStarGift#cf6f6db8 as nil")
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode webPageAttributeUniqueStarGift#cf6f6db8: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeUniqueStarGift#cf6f6db8: field gift: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeUniqueStarGift) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeUniqueStarGift#cf6f6db8 to nil")
	}
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeUniqueStarGift#cf6f6db8: field gift: %w", )
		}
		.Gift = 
	}
	return nil
}

// GetGift returns value of Gift field.
func ( *WebPageAttributeUniqueStarGift) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// WebPageAttributeStarGiftCollection represents TL type `webPageAttributeStarGiftCollection#31cad303`.
// Contains info about a gift collection »¹ for a webPage² preview of a gift
// collection »³ (the webPage⁓ will have a type of telegram_collection).
//
// Links:
//  1. https://core.telegram.org/api/gifts#gift-collections
//  2. https://core.telegram.org/constructor/webPage
//  3. https://core.telegram.org/api/gifts#gift-collections
//  4. https://core.telegram.org/constructor/webPage
//
// See https://core.telegram.org/constructor/webPageAttributeStarGiftCollection for reference.
type WebPageAttributeStarGiftCollection struct {
	// Gifts in the collection.
	Icons []DocumentClass
}

// WebPageAttributeStarGiftCollectionTypeID is TL type id of WebPageAttributeStarGiftCollection.
const WebPageAttributeStarGiftCollectionTypeID = 0x31cad303

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeStarGiftCollection) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeStarGiftCollection{}
)

func ( *WebPageAttributeStarGiftCollection) () bool {
	if  == nil {
		return true
	}
	if !(.Icons == nil) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeStarGiftCollection from given interface.
func ( *WebPageAttributeStarGiftCollection) ( interface {
	() ( []DocumentClass)
}) {
	.Icons = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeStarGiftCollection) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeStarGiftCollection",
		ID:   WebPageAttributeStarGiftCollectionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Icons",
			SchemaName: "icons",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeStarGiftCollection) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStarGiftCollection#31cad303 as nil")
	}
	.PutID(WebPageAttributeStarGiftCollectionTypeID)
	return .EncodeBare()
}

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

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

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

		if  > 0 {
			.Icons = make([]DocumentClass, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := DecodeDocument()
			if  != nil {
				return fmt.Errorf("unable to decode webPageAttributeStarGiftCollection#31cad303: field icons: %w", )
			}
			.Icons = append(.Icons, )
		}
	}
	return nil
}

// GetIcons returns value of Icons field.
func ( *WebPageAttributeStarGiftCollection) () ( []DocumentClass) {
	if  == nil {
		return
	}
	return .Icons
}

// MapIcons returns field Icons wrapped in DocumentClassArray helper.
func ( *WebPageAttributeStarGiftCollection) () ( DocumentClassArray) {
	return DocumentClassArray(.Icons)
}

// WebPageAttributeStarGiftAuction represents TL type `webPageAttributeStarGiftAuction#1c641c2`.
// Contains info about a collectible gift auction »¹ for a webPage² preview of an
// auction »³ (the webPage⁓ will have a type of telegram_auction).
//
// Links:
//  1. https://core.telegram.org/api/auctions
//  2. https://core.telegram.org/constructor/webPage
//  3. https://core.telegram.org/api/auctions
//  4. https://core.telegram.org/constructor/webPage
//
// See https://core.telegram.org/constructor/webPageAttributeStarGiftAuction for reference.
type WebPageAttributeStarGiftAuction struct {
	// The gift linked to the auction
	Gift StarGiftClass
	// Date when the auction will end (UNIX timestamp)
	EndDate int
}

// WebPageAttributeStarGiftAuctionTypeID is TL type id of WebPageAttributeStarGiftAuction.
const WebPageAttributeStarGiftAuctionTypeID = 0x1c641c2

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeStarGiftAuction) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeStarGiftAuction{}
)

func ( *WebPageAttributeStarGiftAuction) () bool {
	if  == nil {
		return true
	}
	if !(.Gift == nil) {
		return false
	}
	if !(.EndDate == 0) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeStarGiftAuction from given interface.
func ( *WebPageAttributeStarGiftAuction) ( interface {
	() ( StarGiftClass)
	() ( int)
}) {
	.Gift = .()
	.EndDate = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeStarGiftAuction) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeStarGiftAuction",
		ID:   WebPageAttributeStarGiftAuctionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Gift",
			SchemaName: "gift",
		},
		{
			Name:       "EndDate",
			SchemaName: "end_date",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeStarGiftAuction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStarGiftAuction#1c641c2 as nil")
	}
	.PutID(WebPageAttributeStarGiftAuctionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeStarGiftAuction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeStarGiftAuction#1c641c2 as nil")
	}
	if .Gift == nil {
		return fmt.Errorf("unable to encode webPageAttributeStarGiftAuction#1c641c2: field gift is nil")
	}
	if  := .Gift.Encode();  != nil {
		return fmt.Errorf("unable to encode webPageAttributeStarGiftAuction#1c641c2: field gift: %w", )
	}
	.PutInt(.EndDate)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeStarGiftAuction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeStarGiftAuction#1c641c2 to nil")
	}
	{
		,  := DecodeStarGift()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStarGiftAuction#1c641c2: field gift: %w", )
		}
		.Gift = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeStarGiftAuction#1c641c2: field end_date: %w", )
		}
		.EndDate = 
	}
	return nil
}

// GetGift returns value of Gift field.
func ( *WebPageAttributeStarGiftAuction) () ( StarGiftClass) {
	if  == nil {
		return
	}
	return .Gift
}

// GetEndDate returns value of EndDate field.
func ( *WebPageAttributeStarGiftAuction) () ( int) {
	if  == nil {
		return
	}
	return .EndDate
}

// WebPageAttributeAiComposeTone represents TL type `webPageAttributeAiComposeTone#7781fe18`.
//
// See https://core.telegram.org/constructor/webPageAttributeAiComposeTone for reference.
type WebPageAttributeAiComposeTone struct {
	// EmojiID field of WebPageAttributeAiComposeTone.
	EmojiID int64
}

// WebPageAttributeAiComposeToneTypeID is TL type id of WebPageAttributeAiComposeTone.
const WebPageAttributeAiComposeToneTypeID = 0x7781fe18

// construct implements constructor of WebPageAttributeClass.
func ( WebPageAttributeAiComposeTone) () WebPageAttributeClass { return & }

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

	_ WebPageAttributeClass = &WebPageAttributeAiComposeTone{}
)

func ( *WebPageAttributeAiComposeTone) () bool {
	if  == nil {
		return true
	}
	if !(.EmojiID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills WebPageAttributeAiComposeTone from given interface.
func ( *WebPageAttributeAiComposeTone) ( interface {
	() ( int64)
}) {
	.EmojiID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *WebPageAttributeAiComposeTone) () tdp.Type {
	 := tdp.Type{
		Name: "webPageAttributeAiComposeTone",
		ID:   WebPageAttributeAiComposeToneTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "EmojiID",
			SchemaName: "emoji_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *WebPageAttributeAiComposeTone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeAiComposeTone#7781fe18 as nil")
	}
	.PutID(WebPageAttributeAiComposeToneTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *WebPageAttributeAiComposeTone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode webPageAttributeAiComposeTone#7781fe18 as nil")
	}
	.PutLong(.EmojiID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *WebPageAttributeAiComposeTone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode webPageAttributeAiComposeTone#7781fe18 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode webPageAttributeAiComposeTone#7781fe18: field emoji_id: %w", )
		}
		.EmojiID = 
	}
	return nil
}

// GetEmojiID returns value of EmojiID field.
func ( *WebPageAttributeAiComposeTone) () ( int64) {
	if  == nil {
		return
	}
	return .EmojiID
}

// WebPageAttributeClassName is schema name of WebPageAttributeClass.
const WebPageAttributeClassName = "WebPageAttribute"

// WebPageAttributeClass represents WebPageAttribute generic type.
//
// See https://core.telegram.org/type/WebPageAttribute for reference.
//
// Constructors:
//   - [WebPageAttributeTheme]
//   - [WebPageAttributeStory]
//   - [WebPageAttributeStickerSet]
//   - [WebPageAttributeUniqueStarGift]
//   - [WebPageAttributeStarGiftCollection]
//   - [WebPageAttributeStarGiftAuction]
//   - [WebPageAttributeAiComposeTone]
//
// Example:
//
//	g, err := tg.DecodeWebPageAttribute(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.WebPageAttributeTheme: // webPageAttributeTheme#54b56617
//	case *tg.WebPageAttributeStory: // webPageAttributeStory#2e94c3e7
//	case *tg.WebPageAttributeStickerSet: // webPageAttributeStickerSet#50cc03d3
//	case *tg.WebPageAttributeUniqueStarGift: // webPageAttributeUniqueStarGift#cf6f6db8
//	case *tg.WebPageAttributeStarGiftCollection: // webPageAttributeStarGiftCollection#31cad303
//	case *tg.WebPageAttributeStarGiftAuction: // webPageAttributeStarGiftAuction#1c641c2
//	case *tg.WebPageAttributeAiComposeTone: // webPageAttributeAiComposeTone#7781fe18
//	default: panic(v)
//	}
type WebPageAttributeClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() WebPageAttributeClass

	// 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
}

// DecodeWebPageAttribute implements binary de-serialization for WebPageAttributeClass.
func ( *bin.Buffer) (WebPageAttributeClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case WebPageAttributeThemeTypeID:
		// Decoding webPageAttributeTheme#54b56617.
		 := WebPageAttributeTheme{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeStoryTypeID:
		// Decoding webPageAttributeStory#2e94c3e7.
		 := WebPageAttributeStory{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeStickerSetTypeID:
		// Decoding webPageAttributeStickerSet#50cc03d3.
		 := WebPageAttributeStickerSet{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeUniqueStarGiftTypeID:
		// Decoding webPageAttributeUniqueStarGift#cf6f6db8.
		 := WebPageAttributeUniqueStarGift{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeStarGiftCollectionTypeID:
		// Decoding webPageAttributeStarGiftCollection#31cad303.
		 := WebPageAttributeStarGiftCollection{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeStarGiftAuctionTypeID:
		// Decoding webPageAttributeStarGiftAuction#1c641c2.
		 := WebPageAttributeStarGiftAuction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	case WebPageAttributeAiComposeToneTypeID:
		// Decoding webPageAttributeAiComposeTone#7781fe18.
		 := WebPageAttributeAiComposeTone{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode WebPageAttributeClass: %w", bin.NewUnexpectedID())
	}
}

// WebPageAttribute boxes the WebPageAttributeClass providing a helper.
type WebPageAttributeBox struct {
	WebPageAttribute WebPageAttributeClass
}

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

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