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

// AccountTakeout represents TL type `account.takeout#4dba4501`.
// Takeout info
//
// See https://core.telegram.org/constructor/account.takeout for reference.
type AccountTakeout struct {
	// Takeout ID
	ID int64
}

// AccountTakeoutTypeID is TL type id of AccountTakeout.
const AccountTakeoutTypeID = 0x4dba4501

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

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

	return true
}

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

// FillFrom fills AccountTakeout from given interface.
func ( *AccountTakeout) ( interface {
	() ( int64)
}) {
	.ID = .()
}

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

// TypeName returns name of type in TL schema.
func (*AccountTakeout) () string {
	return "account.takeout"
}

// TypeInfo returns info about TL type.
func ( *AccountTakeout) () tdp.Type {
	 := tdp.Type{
		Name: "account.takeout",
		ID:   AccountTakeoutTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *AccountTakeout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.takeout#4dba4501 as nil")
	}
	.PutID(AccountTakeoutTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *AccountTakeout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode account.takeout#4dba4501 as nil")
	}
	.PutLong(.ID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *AccountTakeout) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode account.takeout#4dba4501 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode account.takeout#4dba4501: field id: %w", )
		}
		.ID = 
	}
	return nil
}

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