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

// Int represents TL type `int#a8509bda`.
//
// See https://core.telegram.org/constructor/int for reference.
type Int struct {
}

// IntTypeID is TL type id of Int.
const IntTypeID = 0xa8509bda

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

func ( *Int) () bool {
	if  == nil {
		return true
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *Int) () tdp.Type {
	 := tdp.Type{
		Name: "int",
		ID:   IntTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *Int) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode int#a8509bda as nil")
	}
	.PutID(IntTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *Int) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode int#a8509bda as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *Int) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode int#a8509bda to nil")
	}
	return nil
}