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

// MediaAreaVenue represents TL type `mediaAreaVenue#be82db9c`.
// Represents a location tag attached to a story¹, with additional venue information.
//
// Links:
//  1. https://core.telegram.org/api/stories
//
// See https://core.telegram.org/constructor/mediaAreaVenue for reference.
type MediaAreaVenue struct {
	// The size and location of the media area corresponding to the location sticker on top
	// of the story media.
	Coordinates MediaAreaCoordinates
	// Coordinates of the venue
	Geo GeoPointClass
	// Venue name
	Title string
	// Address
	Address string
	// Venue provider: currently only "foursquare" needs to be supported.
	Provider string
	// Venue ID in the provider's database
	VenueID string
	// Venue type in the provider's database
	VenueType string
}

// MediaAreaVenueTypeID is TL type id of MediaAreaVenue.
const MediaAreaVenueTypeID = 0xbe82db9c

// construct implements constructor of MediaAreaClass.
func ( MediaAreaVenue) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &MediaAreaVenue{}
)

func ( *MediaAreaVenue) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.Geo == nil) {
		return false
	}
	if !(.Title == "") {
		return false
	}
	if !(.Address == "") {
		return false
	}
	if !(.Provider == "") {
		return false
	}
	if !(.VenueID == "") {
		return false
	}
	if !(.VenueType == "") {
		return false
	}

	return true
}

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

// FillFrom fills MediaAreaVenue from given interface.
func ( *MediaAreaVenue) ( interface {
	() ( MediaAreaCoordinates)
	() ( GeoPointClass)
	() ( string)
	() ( string)
	() ( string)
	() ( string)
	() ( string)
}) {
	.Coordinates = .()
	.Geo = .()
	.Title = .()
	.Address = .()
	.Provider = .()
	.VenueID = .()
	.VenueType = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MediaAreaVenue) () tdp.Type {
	 := tdp.Type{
		Name: "mediaAreaVenue",
		ID:   MediaAreaVenueTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "Geo",
			SchemaName: "geo",
		},
		{
			Name:       "Title",
			SchemaName: "title",
		},
		{
			Name:       "Address",
			SchemaName: "address",
		},
		{
			Name:       "Provider",
			SchemaName: "provider",
		},
		{
			Name:       "VenueID",
			SchemaName: "venue_id",
		},
		{
			Name:       "VenueType",
			SchemaName: "venue_type",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaVenue#be82db9c as nil")
	}
	.PutID(MediaAreaVenueTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaVenue#be82db9c as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaVenue#be82db9c: field coordinates: %w", )
	}
	if .Geo == nil {
		return fmt.Errorf("unable to encode mediaAreaVenue#be82db9c: field geo is nil")
	}
	if  := .Geo.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaVenue#be82db9c: field geo: %w", )
	}
	.PutString(.Title)
	.PutString(.Address)
	.PutString(.Provider)
	.PutString(.VenueID)
	.PutString(.VenueType)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode mediaAreaVenue#be82db9c to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field coordinates: %w", )
		}
	}
	{
		,  := DecodeGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field geo: %w", )
		}
		.Geo = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field title: %w", )
		}
		.Title = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field address: %w", )
		}
		.Address = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field provider: %w", )
		}
		.Provider = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field venue_id: %w", )
		}
		.VenueID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaVenue#be82db9c: field venue_type: %w", )
		}
		.VenueType = 
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *MediaAreaVenue) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

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

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

// GetAddress returns value of Address field.
func ( *MediaAreaVenue) () ( string) {
	if  == nil {
		return
	}
	return .Address
}

// GetProvider returns value of Provider field.
func ( *MediaAreaVenue) () ( string) {
	if  == nil {
		return
	}
	return .Provider
}

// GetVenueID returns value of VenueID field.
func ( *MediaAreaVenue) () ( string) {
	if  == nil {
		return
	}
	return .VenueID
}

// GetVenueType returns value of VenueType field.
func ( *MediaAreaVenue) () ( string) {
	if  == nil {
		return
	}
	return .VenueType
}

// InputMediaAreaVenue represents TL type `inputMediaAreaVenue#b282217f`.
// Represents a location tag¹ attached to a story², with additional venue information.
//
// Links:
//  1. https://core.telegram.org/api/stories#media-areas
//  2. https://core.telegram.org/api/stories
//
// See https://core.telegram.org/constructor/inputMediaAreaVenue for reference.
type InputMediaAreaVenue struct {
	// The size and location of the media area corresponding to the location sticker on top
	// of the story media.
	Coordinates MediaAreaCoordinates
	// The query_id from messages.botResults¹, see here »² for more info.
	//
	// Links:
	//  1) https://core.telegram.org/constructor/messages.botResults
	//  2) https://core.telegram.org/api/stories#media-areas
	QueryID int64
	// The id of the chosen result, see here »¹ for more info.
	//
	// Links:
	//  1) https://core.telegram.org/api/stories#media-areas
	ResultID string
}

// InputMediaAreaVenueTypeID is TL type id of InputMediaAreaVenue.
const InputMediaAreaVenueTypeID = 0xb282217f

// construct implements constructor of MediaAreaClass.
func ( InputMediaAreaVenue) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &InputMediaAreaVenue{}
)

func ( *InputMediaAreaVenue) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.QueryID == 0) {
		return false
	}
	if !(.ResultID == "") {
		return false
	}

	return true
}

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

// FillFrom fills InputMediaAreaVenue from given interface.
func ( *InputMediaAreaVenue) ( interface {
	() ( MediaAreaCoordinates)
	() ( int64)
	() ( string)
}) {
	.Coordinates = .()
	.QueryID = .()
	.ResultID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InputMediaAreaVenue) () tdp.Type {
	 := tdp.Type{
		Name: "inputMediaAreaVenue",
		ID:   InputMediaAreaVenueTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "QueryID",
			SchemaName: "query_id",
		},
		{
			Name:       "ResultID",
			SchemaName: "result_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputMediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMediaAreaVenue#b282217f as nil")
	}
	.PutID(InputMediaAreaVenueTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputMediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMediaAreaVenue#b282217f as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode inputMediaAreaVenue#b282217f: field coordinates: %w", )
	}
	.PutLong(.QueryID)
	.PutString(.ResultID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputMediaAreaVenue) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputMediaAreaVenue#b282217f to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaVenue#b282217f: field coordinates: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaVenue#b282217f: field query_id: %w", )
		}
		.QueryID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaVenue#b282217f: field result_id: %w", )
		}
		.ResultID = 
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *InputMediaAreaVenue) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

// GetQueryID returns value of QueryID field.
func ( *InputMediaAreaVenue) () ( int64) {
	if  == nil {
		return
	}
	return .QueryID
}

// GetResultID returns value of ResultID field.
func ( *InputMediaAreaVenue) () ( string) {
	if  == nil {
		return
	}
	return .ResultID
}

// MediaAreaGeoPoint represents TL type `mediaAreaGeoPoint#df8b3b22`.
// Represents a geolocation tag attached to a story¹.
//
// Links:
//  1. https://core.telegram.org/api/stories
//
// See https://core.telegram.org/constructor/mediaAreaGeoPoint for reference.
type MediaAreaGeoPoint struct {
	// The size and position of the media area corresponding to the location sticker on top
	// of the story media.
	Coordinates MediaAreaCoordinates
	// Coordinates of the geolocation tag.
	Geo GeoPointClass
}

// MediaAreaGeoPointTypeID is TL type id of MediaAreaGeoPoint.
const MediaAreaGeoPointTypeID = 0xdf8b3b22

// construct implements constructor of MediaAreaClass.
func ( MediaAreaGeoPoint) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &MediaAreaGeoPoint{}
)

func ( *MediaAreaGeoPoint) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.Geo == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MediaAreaGeoPoint from given interface.
func ( *MediaAreaGeoPoint) ( interface {
	() ( MediaAreaCoordinates)
	() ( GeoPointClass)
}) {
	.Coordinates = .()
	.Geo = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MediaAreaGeoPoint) () tdp.Type {
	 := tdp.Type{
		Name: "mediaAreaGeoPoint",
		ID:   MediaAreaGeoPointTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "Geo",
			SchemaName: "geo",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MediaAreaGeoPoint) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaGeoPoint#df8b3b22 as nil")
	}
	.PutID(MediaAreaGeoPointTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MediaAreaGeoPoint) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaGeoPoint#df8b3b22 as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaGeoPoint#df8b3b22: field coordinates: %w", )
	}
	if .Geo == nil {
		return fmt.Errorf("unable to encode mediaAreaGeoPoint#df8b3b22: field geo is nil")
	}
	if  := .Geo.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaGeoPoint#df8b3b22: field geo: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MediaAreaGeoPoint) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode mediaAreaGeoPoint#df8b3b22 to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode mediaAreaGeoPoint#df8b3b22: field coordinates: %w", )
		}
	}
	{
		,  := DecodeGeoPoint()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaGeoPoint#df8b3b22: field geo: %w", )
		}
		.Geo = 
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *MediaAreaGeoPoint) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

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

// MediaAreaSuggestedReaction represents TL type `mediaAreaSuggestedReaction#14455871`.
// Represents a reaction bubble.
//
// See https://core.telegram.org/constructor/mediaAreaSuggestedReaction for reference.
type MediaAreaSuggestedReaction struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether the reaction bubble has a dark background.
	Dark bool
	// Whether the reaction bubble is mirrored (see here »¹ for more info).
	//
	// Links:
	//  1) https://core.telegram.org/api/stories#reactions
	Flipped bool
	// The coordinates of the media area corresponding to the reaction button.
	Coordinates MediaAreaCoordinates
	// The reaction that should be sent when this area is clicked.
	Reaction ReactionClass
}

// MediaAreaSuggestedReactionTypeID is TL type id of MediaAreaSuggestedReaction.
const MediaAreaSuggestedReactionTypeID = 0x14455871

// construct implements constructor of MediaAreaClass.
func ( MediaAreaSuggestedReaction) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &MediaAreaSuggestedReaction{}
)

func ( *MediaAreaSuggestedReaction) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Dark == false) {
		return false
	}
	if !(.Flipped == false) {
		return false
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.Reaction == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MediaAreaSuggestedReaction from given interface.
func ( *MediaAreaSuggestedReaction) ( interface {
	() ( bool)
	() ( bool)
	() ( MediaAreaCoordinates)
	() ( ReactionClass)
}) {
	.Dark = .()
	.Flipped = .()
	.Coordinates = .()
	.Reaction = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MediaAreaSuggestedReaction) () tdp.Type {
	 := tdp.Type{
		Name: "mediaAreaSuggestedReaction",
		ID:   MediaAreaSuggestedReactionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Dark",
			SchemaName: "dark",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Flipped",
			SchemaName: "flipped",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "Reaction",
			SchemaName: "reaction",
		},
	}
	return 
}

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

// Encode implements bin.Encoder.
func ( *MediaAreaSuggestedReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaSuggestedReaction#14455871 as nil")
	}
	.PutID(MediaAreaSuggestedReactionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MediaAreaSuggestedReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaSuggestedReaction#14455871 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaSuggestedReaction#14455871: field flags: %w", )
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaSuggestedReaction#14455871: field coordinates: %w", )
	}
	if .Reaction == nil {
		return fmt.Errorf("unable to encode mediaAreaSuggestedReaction#14455871: field reaction is nil")
	}
	if  := .Reaction.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaSuggestedReaction#14455871: field reaction: %w", )
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MediaAreaSuggestedReaction) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode mediaAreaSuggestedReaction#14455871 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode mediaAreaSuggestedReaction#14455871: field flags: %w", )
		}
	}
	.Dark = .Flags.Has(0)
	.Flipped = .Flags.Has(1)
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode mediaAreaSuggestedReaction#14455871: field coordinates: %w", )
		}
	}
	{
		,  := DecodeReaction()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaSuggestedReaction#14455871: field reaction: %w", )
		}
		.Reaction = 
	}
	return nil
}

// SetDark sets value of Dark conditional field.
func ( *MediaAreaSuggestedReaction) ( bool) {
	if  {
		.Flags.Set(0)
		.Dark = true
	} else {
		.Flags.Unset(0)
		.Dark = false
	}
}

// GetDark returns value of Dark conditional field.
func ( *MediaAreaSuggestedReaction) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetFlipped sets value of Flipped conditional field.
func ( *MediaAreaSuggestedReaction) ( bool) {
	if  {
		.Flags.Set(1)
		.Flipped = true
	} else {
		.Flags.Unset(1)
		.Flipped = false
	}
}

// GetFlipped returns value of Flipped conditional field.
func ( *MediaAreaSuggestedReaction) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetCoordinates returns value of Coordinates field.
func ( *MediaAreaSuggestedReaction) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

// GetReaction returns value of Reaction field.
func ( *MediaAreaSuggestedReaction) () ( ReactionClass) {
	if  == nil {
		return
	}
	return .Reaction
}

// MediaAreaChannelPost represents TL type `mediaAreaChannelPost#770416af`.
//
// See https://core.telegram.org/constructor/mediaAreaChannelPost for reference.
type MediaAreaChannelPost struct {
	// Coordinates field of MediaAreaChannelPost.
	Coordinates MediaAreaCoordinates
	// ChannelID field of MediaAreaChannelPost.
	ChannelID int64
	// MsgID field of MediaAreaChannelPost.
	MsgID int
}

// MediaAreaChannelPostTypeID is TL type id of MediaAreaChannelPost.
const MediaAreaChannelPostTypeID = 0x770416af

// construct implements constructor of MediaAreaClass.
func ( MediaAreaChannelPost) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &MediaAreaChannelPost{}
)

func ( *MediaAreaChannelPost) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.ChannelID == 0) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MediaAreaChannelPost from given interface.
func ( *MediaAreaChannelPost) ( interface {
	() ( MediaAreaCoordinates)
	() ( int64)
	() ( int)
}) {
	.Coordinates = .()
	.ChannelID = .()
	.MsgID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MediaAreaChannelPost) () tdp.Type {
	 := tdp.Type{
		Name: "mediaAreaChannelPost",
		ID:   MediaAreaChannelPostTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "ChannelID",
			SchemaName: "channel_id",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaChannelPost#770416af as nil")
	}
	.PutID(MediaAreaChannelPostTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode mediaAreaChannelPost#770416af as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode mediaAreaChannelPost#770416af: field coordinates: %w", )
	}
	.PutLong(.ChannelID)
	.PutInt(.MsgID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode mediaAreaChannelPost#770416af to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field coordinates: %w", )
		}
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field channel_id: %w", )
		}
		.ChannelID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field msg_id: %w", )
		}
		.MsgID = 
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *MediaAreaChannelPost) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

// GetChannelID returns value of ChannelID field.
func ( *MediaAreaChannelPost) () ( int64) {
	if  == nil {
		return
	}
	return .ChannelID
}

// GetMsgID returns value of MsgID field.
func ( *MediaAreaChannelPost) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// InputMediaAreaChannelPost represents TL type `inputMediaAreaChannelPost#2271f2bf`.
//
// See https://core.telegram.org/constructor/inputMediaAreaChannelPost for reference.
type InputMediaAreaChannelPost struct {
	// Coordinates field of InputMediaAreaChannelPost.
	Coordinates MediaAreaCoordinates
	// Channel field of InputMediaAreaChannelPost.
	Channel InputChannelClass
	// MsgID field of InputMediaAreaChannelPost.
	MsgID int
}

// InputMediaAreaChannelPostTypeID is TL type id of InputMediaAreaChannelPost.
const InputMediaAreaChannelPostTypeID = 0x2271f2bf

// construct implements constructor of MediaAreaClass.
func ( InputMediaAreaChannelPost) () MediaAreaClass { return & }

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

	_ MediaAreaClass = &InputMediaAreaChannelPost{}
)

func ( *InputMediaAreaChannelPost) () bool {
	if  == nil {
		return true
	}
	if !(.Coordinates.Zero()) {
		return false
	}
	if !(.Channel == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}

	return true
}

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

// FillFrom fills InputMediaAreaChannelPost from given interface.
func ( *InputMediaAreaChannelPost) ( interface {
	() ( MediaAreaCoordinates)
	() ( InputChannelClass)
	() ( int)
}) {
	.Coordinates = .()
	.Channel = .()
	.MsgID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InputMediaAreaChannelPost) () tdp.Type {
	 := tdp.Type{
		Name: "inputMediaAreaChannelPost",
		ID:   InputMediaAreaChannelPostTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Coordinates",
			SchemaName: "coordinates",
		},
		{
			Name:       "Channel",
			SchemaName: "channel",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputMediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMediaAreaChannelPost#2271f2bf as nil")
	}
	.PutID(InputMediaAreaChannelPostTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputMediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMediaAreaChannelPost#2271f2bf as nil")
	}
	if  := .Coordinates.Encode();  != nil {
		return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field coordinates: %w", )
	}
	if .Channel == nil {
		return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field channel is nil")
	}
	if  := .Channel.Encode();  != nil {
		return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field channel: %w", )
	}
	.PutInt(.MsgID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputMediaAreaChannelPost) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputMediaAreaChannelPost#2271f2bf to nil")
	}
	{
		if  := .Coordinates.Decode();  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field coordinates: %w", )
		}
	}
	{
		,  := DecodeInputChannel()
		if  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field channel: %w", )
		}
		.Channel = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field msg_id: %w", )
		}
		.MsgID = 
	}
	return nil
}

// GetCoordinates returns value of Coordinates field.
func ( *InputMediaAreaChannelPost) () ( MediaAreaCoordinates) {
	if  == nil {
		return
	}
	return .Coordinates
}

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

// GetMsgID returns value of MsgID field.
func ( *InputMediaAreaChannelPost) () ( int) {
	if  == nil {
		return
	}
	return .MsgID
}

// MediaAreaClassName is schema name of MediaAreaClass.
const MediaAreaClassName = "MediaArea"

// MediaAreaClass represents MediaArea generic type.
//
// See https://core.telegram.org/type/MediaArea for reference.
//
// Example:
//
//	g, err := tg.DecodeMediaArea(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.MediaAreaVenue: // mediaAreaVenue#be82db9c
//	case *tg.InputMediaAreaVenue: // inputMediaAreaVenue#b282217f
//	case *tg.MediaAreaGeoPoint: // mediaAreaGeoPoint#df8b3b22
//	case *tg.MediaAreaSuggestedReaction: // mediaAreaSuggestedReaction#14455871
//	case *tg.MediaAreaChannelPost: // mediaAreaChannelPost#770416af
//	case *tg.InputMediaAreaChannelPost: // inputMediaAreaChannelPost#2271f2bf
//	default: panic(v)
//	}
type MediaAreaClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() MediaAreaClass

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

	// The size and location of the media area corresponding to the location sticker on top
	// of the story media.
	GetCoordinates() (value MediaAreaCoordinates)
}

// DecodeMediaArea implements binary de-serialization for MediaAreaClass.
func ( *bin.Buffer) (MediaAreaClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case MediaAreaVenueTypeID:
		// Decoding mediaAreaVenue#be82db9c.
		 := MediaAreaVenue{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	case InputMediaAreaVenueTypeID:
		// Decoding inputMediaAreaVenue#b282217f.
		 := InputMediaAreaVenue{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	case MediaAreaGeoPointTypeID:
		// Decoding mediaAreaGeoPoint#df8b3b22.
		 := MediaAreaGeoPoint{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	case MediaAreaSuggestedReactionTypeID:
		// Decoding mediaAreaSuggestedReaction#14455871.
		 := MediaAreaSuggestedReaction{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	case MediaAreaChannelPostTypeID:
		// Decoding mediaAreaChannelPost#770416af.
		 := MediaAreaChannelPost{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	case InputMediaAreaChannelPostTypeID:
		// Decoding inputMediaAreaChannelPost#2271f2bf.
		 := InputMediaAreaChannelPost{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", bin.NewUnexpectedID())
	}
}

// MediaArea boxes the MediaAreaClass providing a helper.
type MediaAreaBox struct {
	MediaArea MediaAreaClass
}

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

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