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

// True represents TL type `true#3fedd339`.
// See predefined identifiers¹.
//
// Links:
//  1. https://core.telegram.org/mtproto/TL-formal#predefined-identifiers
//
// See https://core.telegram.org/constructor/true for reference.
type True struct {
}

// TrueTypeID is TL type id of True.
const TrueTypeID = 0x3fedd339

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

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *True) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode true#3fedd339 as nil")
	}
	.PutID(TrueTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *True) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode true#3fedd339 as nil")
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *True) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode true#3fedd339 to nil")
	}
	return nil
}