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

// PaymentsGiveawayInfo represents TL type `payments.giveawayInfo#4367daa0`.
// Contains info about an ongoing giveaway¹.
// If neither the participating, joined_too_early_date, admin_disallowed_chat_id or
// disallowed_country flags are set, the user is not currently participating in the
// giveaway but could participate by joining all the channels specified in the
// messageMediaGiveaway¹.channels field.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//  2. https://core.telegram.org/constructor/messageMediaGiveaway
//
// See https://core.telegram.org/constructor/payments.giveawayInfo for reference.
type PaymentsGiveawayInfo struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// The current user is participating in the giveaway.
	Participating bool
	// If set, the giveaway has ended and the results are being prepared.
	PreparingResults bool
	// When was the giveaway started
	StartDate int
	// The current user can't participate in the giveaway, because they were already a member
	// of the channel when the giveaway started, and the only_new_subscribers was set when
	// starting the giveaway.
	//
	// Use SetJoinedTooEarlyDate and GetJoinedTooEarlyDate helpers.
	JoinedTooEarlyDate int
	// If set, the current user can't participate in the giveaway, because they are an
	// administrator in one of the channels (ID specified in this flag) that created the
	// giveaway.
	//
	// Use SetAdminDisallowedChatID and GetAdminDisallowedChatID helpers.
	AdminDisallowedChatID int64
	// If set, the current user can't participate in this giveaway, because their phone
	// number is from the specified disallowed country (specified as a two-letter ISO 3166-1
	// alpha-2 country code).
	//
	// Use SetDisallowedCountry and GetDisallowedCountry helpers.
	DisallowedCountry string
}

// PaymentsGiveawayInfoTypeID is TL type id of PaymentsGiveawayInfo.
const PaymentsGiveawayInfoTypeID = 0x4367daa0

// construct implements constructor of PaymentsGiveawayInfoClass.
func ( PaymentsGiveawayInfo) () PaymentsGiveawayInfoClass { return & }

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

	_ PaymentsGiveawayInfoClass = &PaymentsGiveawayInfo{}
)

func ( *PaymentsGiveawayInfo) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Participating == false) {
		return false
	}
	if !(.PreparingResults == false) {
		return false
	}
	if !(.StartDate == 0) {
		return false
	}
	if !(.JoinedTooEarlyDate == 0) {
		return false
	}
	if !(.AdminDisallowedChatID == 0) {
		return false
	}
	if !(.DisallowedCountry == "") {
		return false
	}

	return true
}

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

// FillFrom fills PaymentsGiveawayInfo from given interface.
func ( *PaymentsGiveawayInfo) ( interface {
	() ( bool)
	() ( bool)
	() ( int)
	() ( int,  bool)
	() ( int64,  bool)
	() ( string,  bool)
}) {
	.Participating = .()
	.PreparingResults = .()
	.StartDate = .()
	if ,  := .();  {
		.JoinedTooEarlyDate = 
	}

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

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

}

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

// TypeName returns name of type in TL schema.
func (*PaymentsGiveawayInfo) () string {
	return "payments.giveawayInfo"
}

// TypeInfo returns info about TL type.
func ( *PaymentsGiveawayInfo) () tdp.Type {
	 := tdp.Type{
		Name: "payments.giveawayInfo",
		ID:   PaymentsGiveawayInfoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Participating",
			SchemaName: "participating",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "PreparingResults",
			SchemaName: "preparing_results",
			Null:       !.Flags.Has(3),
		},
		{
			Name:       "StartDate",
			SchemaName: "start_date",
		},
		{
			Name:       "JoinedTooEarlyDate",
			SchemaName: "joined_too_early_date",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "AdminDisallowedChatID",
			SchemaName: "admin_disallowed_chat_id",
			Null:       !.Flags.Has(2),
		},
		{
			Name:       "DisallowedCountry",
			SchemaName: "disallowed_country",
			Null:       !.Flags.Has(4),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PaymentsGiveawayInfo) () {
	if !(.Participating == false) {
		.Flags.Set(0)
	}
	if !(.PreparingResults == false) {
		.Flags.Set(3)
	}
	if !(.JoinedTooEarlyDate == 0) {
		.Flags.Set(1)
	}
	if !(.AdminDisallowedChatID == 0) {
		.Flags.Set(2)
	}
	if !(.DisallowedCountry == "") {
		.Flags.Set(4)
	}
}

// Encode implements bin.Encoder.
func ( *PaymentsGiveawayInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.giveawayInfo#4367daa0 as nil")
	}
	.PutID(PaymentsGiveawayInfoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PaymentsGiveawayInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.giveawayInfo#4367daa0 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode payments.giveawayInfo#4367daa0: field flags: %w", )
	}
	.PutInt(.StartDate)
	if .Flags.Has(1) {
		.PutInt(.JoinedTooEarlyDate)
	}
	if .Flags.Has(2) {
		.PutLong(.AdminDisallowedChatID)
	}
	if .Flags.Has(4) {
		.PutString(.DisallowedCountry)
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *PaymentsGiveawayInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.giveawayInfo#4367daa0 to nil")
	}
	if  := .ConsumeID(PaymentsGiveawayInfoTypeID);  != nil {
		return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *PaymentsGiveawayInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.giveawayInfo#4367daa0 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: field flags: %w", )
		}
	}
	.Participating = .Flags.Has(0)
	.PreparingResults = .Flags.Has(3)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: field start_date: %w", )
		}
		.StartDate = 
	}
	if .Flags.Has(1) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: field joined_too_early_date: %w", )
		}
		.JoinedTooEarlyDate = 
	}
	if .Flags.Has(2) {
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: field admin_disallowed_chat_id: %w", )
		}
		.AdminDisallowedChatID = 
	}
	if .Flags.Has(4) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfo#4367daa0: field disallowed_country: %w", )
		}
		.DisallowedCountry = 
	}
	return nil
}

// SetParticipating sets value of Participating conditional field.
func ( *PaymentsGiveawayInfo) ( bool) {
	if  {
		.Flags.Set(0)
		.Participating = true
	} else {
		.Flags.Unset(0)
		.Participating = false
	}
}

// GetParticipating returns value of Participating conditional field.
func ( *PaymentsGiveawayInfo) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetPreparingResults sets value of PreparingResults conditional field.
func ( *PaymentsGiveawayInfo) ( bool) {
	if  {
		.Flags.Set(3)
		.PreparingResults = true
	} else {
		.Flags.Unset(3)
		.PreparingResults = false
	}
}

// GetPreparingResults returns value of PreparingResults conditional field.
func ( *PaymentsGiveawayInfo) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(3)
}

// GetStartDate returns value of StartDate field.
func ( *PaymentsGiveawayInfo) () ( int) {
	if  == nil {
		return
	}
	return .StartDate
}

// SetJoinedTooEarlyDate sets value of JoinedTooEarlyDate conditional field.
func ( *PaymentsGiveawayInfo) ( int) {
	.Flags.Set(1)
	.JoinedTooEarlyDate = 
}

// GetJoinedTooEarlyDate returns value of JoinedTooEarlyDate conditional field and
// boolean which is true if field was set.
func ( *PaymentsGiveawayInfo) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .JoinedTooEarlyDate, true
}

// SetAdminDisallowedChatID sets value of AdminDisallowedChatID conditional field.
func ( *PaymentsGiveawayInfo) ( int64) {
	.Flags.Set(2)
	.AdminDisallowedChatID = 
}

// GetAdminDisallowedChatID returns value of AdminDisallowedChatID conditional field and
// boolean which is true if field was set.
func ( *PaymentsGiveawayInfo) () ( int64,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .AdminDisallowedChatID, true
}

// SetDisallowedCountry sets value of DisallowedCountry conditional field.
func ( *PaymentsGiveawayInfo) ( string) {
	.Flags.Set(4)
	.DisallowedCountry = 
}

// GetDisallowedCountry returns value of DisallowedCountry conditional field and
// boolean which is true if field was set.
func ( *PaymentsGiveawayInfo) () ( string,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(4) {
		return , false
	}
	return .DisallowedCountry, true
}

// PaymentsGiveawayInfoResults represents TL type `payments.giveawayInfoResults#cd5570`.
// A giveaway¹ has ended.
//
// Links:
//  1. https://core.telegram.org/api/giveaways
//
// See https://core.telegram.org/constructor/payments.giveawayInfoResults for reference.
type PaymentsGiveawayInfoResults struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Whether we're one of the winners of this giveaway.
	Winner bool
	// Whether the giveaway was canceled and was fully refunded.
	Refunded bool
	// Start date of the giveaway
	StartDate int
	// If we're one of the winners of this giveaway, contains the Premium gift code¹, see
	// here »² for more info on the full giveaway flow.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#premium-giftcode-links
	//  2) https://core.telegram.org/api/giveaways
	//
	// Use SetGiftCodeSlug and GetGiftCodeSlug helpers.
	GiftCodeSlug string
	// End date of the giveaway. May be bigger than the end date specified in parameters of
	// the giveaway.
	FinishDate int
	// Number of winners in the giveaway
	WinnersCount int
	// Number of winners, which activated their gift codes¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/links#premium-giftcode-links
	ActivatedCount int
}

// PaymentsGiveawayInfoResultsTypeID is TL type id of PaymentsGiveawayInfoResults.
const PaymentsGiveawayInfoResultsTypeID = 0xcd5570

// construct implements constructor of PaymentsGiveawayInfoClass.
func ( PaymentsGiveawayInfoResults) () PaymentsGiveawayInfoClass { return & }

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

	_ PaymentsGiveawayInfoClass = &PaymentsGiveawayInfoResults{}
)

func ( *PaymentsGiveawayInfoResults) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Winner == false) {
		return false
	}
	if !(.Refunded == false) {
		return false
	}
	if !(.StartDate == 0) {
		return false
	}
	if !(.GiftCodeSlug == "") {
		return false
	}
	if !(.FinishDate == 0) {
		return false
	}
	if !(.WinnersCount == 0) {
		return false
	}
	if !(.ActivatedCount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills PaymentsGiveawayInfoResults from given interface.
func ( *PaymentsGiveawayInfoResults) ( interface {
	() ( bool)
	() ( bool)
	() ( int)
	() ( string,  bool)
	() ( int)
	() ( int)
	() ( int)
}) {
	.Winner = .()
	.Refunded = .()
	.StartDate = .()
	if ,  := .();  {
		.GiftCodeSlug = 
	}

	.FinishDate = .()
	.WinnersCount = .()
	.ActivatedCount = .()
}

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

// TypeName returns name of type in TL schema.
func (*PaymentsGiveawayInfoResults) () string {
	return "payments.giveawayInfoResults"
}

// TypeInfo returns info about TL type.
func ( *PaymentsGiveawayInfoResults) () tdp.Type {
	 := tdp.Type{
		Name: "payments.giveawayInfoResults",
		ID:   PaymentsGiveawayInfoResultsTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Winner",
			SchemaName: "winner",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "Refunded",
			SchemaName: "refunded",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "StartDate",
			SchemaName: "start_date",
		},
		{
			Name:       "GiftCodeSlug",
			SchemaName: "gift_code_slug",
			Null:       !.Flags.Has(0),
		},
		{
			Name:       "FinishDate",
			SchemaName: "finish_date",
		},
		{
			Name:       "WinnersCount",
			SchemaName: "winners_count",
		},
		{
			Name:       "ActivatedCount",
			SchemaName: "activated_count",
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *PaymentsGiveawayInfoResults) () {
	if !(.Winner == false) {
		.Flags.Set(0)
	}
	if !(.Refunded == false) {
		.Flags.Set(1)
	}
	if !(.GiftCodeSlug == "") {
		.Flags.Set(0)
	}
}

// Encode implements bin.Encoder.
func ( *PaymentsGiveawayInfoResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.giveawayInfoResults#cd5570 as nil")
	}
	.PutID(PaymentsGiveawayInfoResultsTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PaymentsGiveawayInfoResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode payments.giveawayInfoResults#cd5570 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode payments.giveawayInfoResults#cd5570: field flags: %w", )
	}
	.PutInt(.StartDate)
	if .Flags.Has(0) {
		.PutString(.GiftCodeSlug)
	}
	.PutInt(.FinishDate)
	.PutInt(.WinnersCount)
	.PutInt(.ActivatedCount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PaymentsGiveawayInfoResults) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode payments.giveawayInfoResults#cd5570 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field flags: %w", )
		}
	}
	.Winner = .Flags.Has(0)
	.Refunded = .Flags.Has(1)
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field start_date: %w", )
		}
		.StartDate = 
	}
	if .Flags.Has(0) {
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field gift_code_slug: %w", )
		}
		.GiftCodeSlug = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field finish_date: %w", )
		}
		.FinishDate = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field winners_count: %w", )
		}
		.WinnersCount = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode payments.giveawayInfoResults#cd5570: field activated_count: %w", )
		}
		.ActivatedCount = 
	}
	return nil
}

// SetWinner sets value of Winner conditional field.
func ( *PaymentsGiveawayInfoResults) ( bool) {
	if  {
		.Flags.Set(0)
		.Winner = true
	} else {
		.Flags.Unset(0)
		.Winner = false
	}
}

// GetWinner returns value of Winner conditional field.
func ( *PaymentsGiveawayInfoResults) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(0)
}

// SetRefunded sets value of Refunded conditional field.
func ( *PaymentsGiveawayInfoResults) ( bool) {
	if  {
		.Flags.Set(1)
		.Refunded = true
	} else {
		.Flags.Unset(1)
		.Refunded = false
	}
}

// GetRefunded returns value of Refunded conditional field.
func ( *PaymentsGiveawayInfoResults) () ( bool) {
	if  == nil {
		return
	}
	return .Flags.Has(1)
}

// GetStartDate returns value of StartDate field.
func ( *PaymentsGiveawayInfoResults) () ( int) {
	if  == nil {
		return
	}
	return .StartDate
}

// SetGiftCodeSlug sets value of GiftCodeSlug conditional field.
func ( *PaymentsGiveawayInfoResults) ( string) {
	.Flags.Set(0)
	.GiftCodeSlug = 
}

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

// GetFinishDate returns value of FinishDate field.
func ( *PaymentsGiveawayInfoResults) () ( int) {
	if  == nil {
		return
	}
	return .FinishDate
}

// GetWinnersCount returns value of WinnersCount field.
func ( *PaymentsGiveawayInfoResults) () ( int) {
	if  == nil {
		return
	}
	return .WinnersCount
}

// GetActivatedCount returns value of ActivatedCount field.
func ( *PaymentsGiveawayInfoResults) () ( int) {
	if  == nil {
		return
	}
	return .ActivatedCount
}

// PaymentsGiveawayInfoClassName is schema name of PaymentsGiveawayInfoClass.
const PaymentsGiveawayInfoClassName = "payments.GiveawayInfo"

// PaymentsGiveawayInfoClass represents payments.GiveawayInfo generic type.
//
// See https://core.telegram.org/type/payments.GiveawayInfo for reference.
//
// Example:
//
//	g, err := tg.DecodePaymentsGiveawayInfo(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.PaymentsGiveawayInfo: // payments.giveawayInfo#4367daa0
//	case *tg.PaymentsGiveawayInfoResults: // payments.giveawayInfoResults#cd5570
//	default: panic(v)
//	}
type PaymentsGiveawayInfoClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() PaymentsGiveawayInfoClass

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

	// When was the giveaway started
	GetStartDate() (value int)
}

// DecodePaymentsGiveawayInfo implements binary de-serialization for PaymentsGiveawayInfoClass.
func ( *bin.Buffer) (PaymentsGiveawayInfoClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case PaymentsGiveawayInfoTypeID:
		// Decoding payments.giveawayInfo#4367daa0.
		 := PaymentsGiveawayInfo{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PaymentsGiveawayInfoClass: %w", )
		}
		return &, nil
	case PaymentsGiveawayInfoResultsTypeID:
		// Decoding payments.giveawayInfoResults#cd5570.
		 := PaymentsGiveawayInfoResults{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode PaymentsGiveawayInfoClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode PaymentsGiveawayInfoClass: %w", bin.NewUnexpectedID())
	}
}

// PaymentsGiveawayInfo boxes the PaymentsGiveawayInfoClass providing a helper.
type PaymentsGiveawayInfoBox struct {
	GiveawayInfo PaymentsGiveawayInfoClass
}

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

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