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

// AuthSentCode represents TL type `auth.sentCode#5e002502`.
// Contains info about a sent verification code.
//
// See https://core.telegram.org/constructor/auth.sentCode for reference.
type AuthSentCode struct {
	// Flags, see TL conditional fields¹
	//
	// Links:
	//  1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
	Flags bin.Fields
	// Phone code type
	Type AuthSentCodeTypeClass
	// Phone code hash, to be stored and later re-used with auth.signIn¹
	//
	// Links:
	//  1) https://core.telegram.org/method/auth.signIn
	PhoneCodeHash string
	// Phone code type that will be sent next, if the phone code is not received within
	// timeout seconds: to send it use auth.resendCode¹
	//
	// Links:
	//  1) https://core.telegram.org/method/auth.resendCode
	//
	// Use SetNextType and GetNextType helpers.
	NextType AuthCodeTypeClass
	// Timeout for reception of the phone code
	//
	// Use SetTimeout and GetTimeout helpers.
	Timeout int
}

// AuthSentCodeTypeID is TL type id of AuthSentCode.
const AuthSentCodeTypeID = 0x5e002502

// construct implements constructor of AuthSentCodeClass.
func ( AuthSentCode) () AuthSentCodeClass { return & }

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

	_ AuthSentCodeClass = &AuthSentCode{}
)

func ( *AuthSentCode) () bool {
	if  == nil {
		return true
	}
	if !(.Flags.Zero()) {
		return false
	}
	if !(.Type == nil) {
		return false
	}
	if !(.PhoneCodeHash == "") {
		return false
	}
	if !(.NextType == nil) {
		return false
	}
	if !(.Timeout == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AuthSentCode from given interface.
func ( *AuthSentCode) ( interface {
	() ( AuthSentCodeTypeClass)
	() ( string)
	() ( AuthCodeTypeClass,  bool)
	() ( int,  bool)
}) {
	.Type = .()
	.PhoneCodeHash = .()
	if ,  := .();  {
		.NextType = 
	}

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

}

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

// TypeName returns name of type in TL schema.
func (*AuthSentCode) () string {
	return "auth.sentCode"
}

// TypeInfo returns info about TL type.
func ( *AuthSentCode) () tdp.Type {
	 := tdp.Type{
		Name: "auth.sentCode",
		ID:   AuthSentCodeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Type",
			SchemaName: "type",
		},
		{
			Name:       "PhoneCodeHash",
			SchemaName: "phone_code_hash",
		},
		{
			Name:       "NextType",
			SchemaName: "next_type",
			Null:       !.Flags.Has(1),
		},
		{
			Name:       "Timeout",
			SchemaName: "timeout",
			Null:       !.Flags.Has(2),
		},
	}
	return 
}

// SetFlags sets flags for non-zero fields.
func ( *AuthSentCode) () {
	if !(.NextType == nil) {
		.Flags.Set(1)
	}
	if !(.Timeout == 0) {
		.Flags.Set(2)
	}
}

// Encode implements bin.Encoder.
func ( *AuthSentCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCode#5e002502 as nil")
	}
	.PutID(AuthSentCodeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthSentCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCode#5e002502 as nil")
	}
	.SetFlags()
	if  := .Flags.Encode();  != nil {
		return fmt.Errorf("unable to encode auth.sentCode#5e002502: field flags: %w", )
	}
	if .Type == nil {
		return fmt.Errorf("unable to encode auth.sentCode#5e002502: field type is nil")
	}
	if  := .Type.Encode();  != nil {
		return fmt.Errorf("unable to encode auth.sentCode#5e002502: field type: %w", )
	}
	.PutString(.PhoneCodeHash)
	if .Flags.Has(1) {
		if .NextType == nil {
			return fmt.Errorf("unable to encode auth.sentCode#5e002502: field next_type is nil")
		}
		if  := .NextType.Encode();  != nil {
			return fmt.Errorf("unable to encode auth.sentCode#5e002502: field next_type: %w", )
		}
	}
	if .Flags.Has(2) {
		.PutInt(.Timeout)
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AuthSentCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.sentCode#5e002502 to nil")
	}
	if  := .ConsumeID(AuthSentCodeTypeID);  != nil {
		return fmt.Errorf("unable to decode auth.sentCode#5e002502: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AuthSentCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.sentCode#5e002502 to nil")
	}
	{
		if  := .Flags.Decode();  != nil {
			return fmt.Errorf("unable to decode auth.sentCode#5e002502: field flags: %w", )
		}
	}
	{
		,  := DecodeAuthSentCodeType()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCode#5e002502: field type: %w", )
		}
		.Type = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCode#5e002502: field phone_code_hash: %w", )
		}
		.PhoneCodeHash = 
	}
	if .Flags.Has(1) {
		,  := DecodeAuthCodeType()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCode#5e002502: field next_type: %w", )
		}
		.NextType = 
	}
	if .Flags.Has(2) {
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCode#5e002502: field timeout: %w", )
		}
		.Timeout = 
	}
	return nil
}

// GetType returns value of Type field.
func ( *AuthSentCode) () ( AuthSentCodeTypeClass) {
	if  == nil {
		return
	}
	return .Type
}

// GetPhoneCodeHash returns value of PhoneCodeHash field.
func ( *AuthSentCode) () ( string) {
	if  == nil {
		return
	}
	return .PhoneCodeHash
}

// SetNextType sets value of NextType conditional field.
func ( *AuthSentCode) ( AuthCodeTypeClass) {
	.Flags.Set(1)
	.NextType = 
}

// GetNextType returns value of NextType conditional field and
// boolean which is true if field was set.
func ( *AuthSentCode) () ( AuthCodeTypeClass,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(1) {
		return , false
	}
	return .NextType, true
}

// SetTimeout sets value of Timeout conditional field.
func ( *AuthSentCode) ( int) {
	.Flags.Set(2)
	.Timeout = 
}

// GetTimeout returns value of Timeout conditional field and
// boolean which is true if field was set.
func ( *AuthSentCode) () ( int,  bool) {
	if  == nil {
		return
	}
	if !.Flags.Has(2) {
		return , false
	}
	return .Timeout, true
}

// AuthSentCodeSuccess represents TL type `auth.sentCodeSuccess#2390fe44`.
// The user successfully authorized using future auth tokens¹
//
// Links:
//  1. https://core.telegram.org/api/auth#future-auth-tokens
//
// See https://core.telegram.org/constructor/auth.sentCodeSuccess for reference.
type AuthSentCodeSuccess struct {
	// Authorization info
	Authorization AuthAuthorizationClass
}

// AuthSentCodeSuccessTypeID is TL type id of AuthSentCodeSuccess.
const AuthSentCodeSuccessTypeID = 0x2390fe44

// construct implements constructor of AuthSentCodeClass.
func ( AuthSentCodeSuccess) () AuthSentCodeClass { return & }

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

	_ AuthSentCodeClass = &AuthSentCodeSuccess{}
)

func ( *AuthSentCodeSuccess) () bool {
	if  == nil {
		return true
	}
	if !(.Authorization == nil) {
		return false
	}

	return true
}

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

// FillFrom fills AuthSentCodeSuccess from given interface.
func ( *AuthSentCodeSuccess) ( interface {
	() ( AuthAuthorizationClass)
}) {
	.Authorization = .()
}

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

// TypeName returns name of type in TL schema.
func (*AuthSentCodeSuccess) () string {
	return "auth.sentCodeSuccess"
}

// TypeInfo returns info about TL type.
func ( *AuthSentCodeSuccess) () tdp.Type {
	 := tdp.Type{
		Name: "auth.sentCodeSuccess",
		ID:   AuthSentCodeSuccessTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Authorization",
			SchemaName: "authorization",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AuthSentCodeSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCodeSuccess#2390fe44 as nil")
	}
	.PutID(AuthSentCodeSuccessTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthSentCodeSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCodeSuccess#2390fe44 as nil")
	}
	if .Authorization == nil {
		return fmt.Errorf("unable to encode auth.sentCodeSuccess#2390fe44: field authorization is nil")
	}
	if  := .Authorization.Encode();  != nil {
		return fmt.Errorf("unable to encode auth.sentCodeSuccess#2390fe44: field authorization: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *AuthSentCodeSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.sentCodeSuccess#2390fe44 to nil")
	}
	if  := .ConsumeID(AuthSentCodeSuccessTypeID);  != nil {
		return fmt.Errorf("unable to decode auth.sentCodeSuccess#2390fe44: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *AuthSentCodeSuccess) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.sentCodeSuccess#2390fe44 to nil")
	}
	{
		,  := DecodeAuthAuthorization()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodeSuccess#2390fe44: field authorization: %w", )
		}
		.Authorization = 
	}
	return nil
}

// GetAuthorization returns value of Authorization field.
func ( *AuthSentCodeSuccess) () ( AuthAuthorizationClass) {
	if  == nil {
		return
	}
	return .Authorization
}

// AuthSentCodePaymentRequired represents TL type `auth.sentCodePaymentRequired#f8827ebf`.
// Official apps may receive this constructor, indicating that due to the high cost of
// SMS verification codes for the user's country/provider, the user must purchase a
// Telegram Premium¹ subscription in order to proceed with the login/signup, see here
// »² for more info.
//
// Links:
//  1. https://core.telegram.org/api/premium
//  2. https://core.telegram.org/api/auth#paid-auth
//
// See https://core.telegram.org/constructor/auth.sentCodePaymentRequired for reference.
type AuthSentCodePaymentRequired struct {
	// For official apps, tore identifier of the Telegram Premium subscription.
	StoreProduct string
	// Phone code hash, to be stored and later re-used with auth.signIn¹
	//
	// Links:
	//  1) https://core.telegram.org/method/auth.signIn
	PhoneCodeHash string
	// An email address that can be contacted for more information about this request.
	SupportEmailAddress string
	// The mandatory subject for the email.
	SupportEmailSubject string
	// PremiumDays field of AuthSentCodePaymentRequired.
	PremiumDays int
	// Three-letter ISO 4217 currency¹ code.
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments#supported-currencies
	Currency string
	// Total price in the smallest units of the currency (integer, not float/double). For
	// example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in
	// currencies.json¹, it shows the number of digits past the decimal point for each
	// currency (2 for the majority of currencies).
	//
	// Links:
	//  1) https://core.telegram.org/bots/payments/currencies.json
	Amount int64
}

// AuthSentCodePaymentRequiredTypeID is TL type id of AuthSentCodePaymentRequired.
const AuthSentCodePaymentRequiredTypeID = 0xf8827ebf

// construct implements constructor of AuthSentCodeClass.
func ( AuthSentCodePaymentRequired) () AuthSentCodeClass { return & }

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

	_ AuthSentCodeClass = &AuthSentCodePaymentRequired{}
)

func ( *AuthSentCodePaymentRequired) () bool {
	if  == nil {
		return true
	}
	if !(.StoreProduct == "") {
		return false
	}
	if !(.PhoneCodeHash == "") {
		return false
	}
	if !(.SupportEmailAddress == "") {
		return false
	}
	if !(.SupportEmailSubject == "") {
		return false
	}
	if !(.PremiumDays == 0) {
		return false
	}
	if !(.Currency == "") {
		return false
	}
	if !(.Amount == 0) {
		return false
	}

	return true
}

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

// FillFrom fills AuthSentCodePaymentRequired from given interface.
func ( *AuthSentCodePaymentRequired) ( interface {
	() ( string)
	() ( string)
	() ( string)
	() ( string)
	() ( int)
	() ( string)
	() ( int64)
}) {
	.StoreProduct = .()
	.PhoneCodeHash = .()
	.SupportEmailAddress = .()
	.SupportEmailSubject = .()
	.PremiumDays = .()
	.Currency = .()
	.Amount = .()
}

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

// TypeName returns name of type in TL schema.
func (*AuthSentCodePaymentRequired) () string {
	return "auth.sentCodePaymentRequired"
}

// TypeInfo returns info about TL type.
func ( *AuthSentCodePaymentRequired) () tdp.Type {
	 := tdp.Type{
		Name: "auth.sentCodePaymentRequired",
		ID:   AuthSentCodePaymentRequiredTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "StoreProduct",
			SchemaName: "store_product",
		},
		{
			Name:       "PhoneCodeHash",
			SchemaName: "phone_code_hash",
		},
		{
			Name:       "SupportEmailAddress",
			SchemaName: "support_email_address",
		},
		{
			Name:       "SupportEmailSubject",
			SchemaName: "support_email_subject",
		},
		{
			Name:       "PremiumDays",
			SchemaName: "premium_days",
		},
		{
			Name:       "Currency",
			SchemaName: "currency",
		},
		{
			Name:       "Amount",
			SchemaName: "amount",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AuthSentCodePaymentRequired) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCodePaymentRequired#f8827ebf as nil")
	}
	.PutID(AuthSentCodePaymentRequiredTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AuthSentCodePaymentRequired) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode auth.sentCodePaymentRequired#f8827ebf as nil")
	}
	.PutString(.StoreProduct)
	.PutString(.PhoneCodeHash)
	.PutString(.SupportEmailAddress)
	.PutString(.SupportEmailSubject)
	.PutInt(.PremiumDays)
	.PutString(.Currency)
	.PutLong(.Amount)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AuthSentCodePaymentRequired) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode auth.sentCodePaymentRequired#f8827ebf to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field store_product: %w", )
		}
		.StoreProduct = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field phone_code_hash: %w", )
		}
		.PhoneCodeHash = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field support_email_address: %w", )
		}
		.SupportEmailAddress = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field support_email_subject: %w", )
		}
		.SupportEmailSubject = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field premium_days: %w", )
		}
		.PremiumDays = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field currency: %w", )
		}
		.Currency = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode auth.sentCodePaymentRequired#f8827ebf: field amount: %w", )
		}
		.Amount = 
	}
	return nil
}

// GetStoreProduct returns value of StoreProduct field.
func ( *AuthSentCodePaymentRequired) () ( string) {
	if  == nil {
		return
	}
	return .StoreProduct
}

// GetPhoneCodeHash returns value of PhoneCodeHash field.
func ( *AuthSentCodePaymentRequired) () ( string) {
	if  == nil {
		return
	}
	return .PhoneCodeHash
}

// GetSupportEmailAddress returns value of SupportEmailAddress field.
func ( *AuthSentCodePaymentRequired) () ( string) {
	if  == nil {
		return
	}
	return .SupportEmailAddress
}

// GetSupportEmailSubject returns value of SupportEmailSubject field.
func ( *AuthSentCodePaymentRequired) () ( string) {
	if  == nil {
		return
	}
	return .SupportEmailSubject
}

// GetPremiumDays returns value of PremiumDays field.
func ( *AuthSentCodePaymentRequired) () ( int) {
	if  == nil {
		return
	}
	return .PremiumDays
}

// GetCurrency returns value of Currency field.
func ( *AuthSentCodePaymentRequired) () ( string) {
	if  == nil {
		return
	}
	return .Currency
}

// GetAmount returns value of Amount field.
func ( *AuthSentCodePaymentRequired) () ( int64) {
	if  == nil {
		return
	}
	return .Amount
}

// AuthSentCodeClassName is schema name of AuthSentCodeClass.
const AuthSentCodeClassName = "auth.SentCode"

// AuthSentCodeClass represents auth.SentCode generic type.
//
// See https://core.telegram.org/type/auth.SentCode for reference.
//
// Constructors:
//   - [AuthSentCode]
//   - [AuthSentCodeSuccess]
//   - [AuthSentCodePaymentRequired]
//
// Example:
//
//	g, err := tg.DecodeAuthSentCode(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.AuthSentCode: // auth.sentCode#5e002502
//	case *tg.AuthSentCodeSuccess: // auth.sentCodeSuccess#2390fe44
//	case *tg.AuthSentCodePaymentRequired: // auth.sentCodePaymentRequired#f8827ebf
//	default: panic(v)
//	}
type AuthSentCodeClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() AuthSentCodeClass

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

// DecodeAuthSentCode implements binary de-serialization for AuthSentCodeClass.
func ( *bin.Buffer) (AuthSentCodeClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case AuthSentCodeTypeID:
		// Decoding auth.sentCode#5e002502.
		 := AuthSentCode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode AuthSentCodeClass: %w", )
		}
		return &, nil
	case AuthSentCodeSuccessTypeID:
		// Decoding auth.sentCodeSuccess#2390fe44.
		 := AuthSentCodeSuccess{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode AuthSentCodeClass: %w", )
		}
		return &, nil
	case AuthSentCodePaymentRequiredTypeID:
		// Decoding auth.sentCodePaymentRequired#f8827ebf.
		 := AuthSentCodePaymentRequired{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode AuthSentCodeClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode AuthSentCodeClass: %w", bin.NewUnexpectedID())
	}
}

// AuthSentCode boxes the AuthSentCodeClass providing a helper.
type AuthSentCodeBox struct {
	SentCode AuthSentCodeClass
}

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

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