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

// InputBotInlineMessageID represents TL type `inputBotInlineMessageID#890c3d89`.
// Represents a sent inline message from the perspective of a bot (legacy constructor)
//
// See https://core.telegram.org/constructor/inputBotInlineMessageID for reference.
type InputBotInlineMessageID struct {
	// DC ID to use when working with this inline message
	DCID int
	// ID of message, contains both the (32-bit, legacy) owner ID and the message ID, used
	// only for Bot API backwards compatibility with 32-bit user ID.
	ID int64
	// Access hash of message
	AccessHash int64
}

// InputBotInlineMessageIDTypeID is TL type id of InputBotInlineMessageID.
const InputBotInlineMessageIDTypeID = 0x890c3d89

// construct implements constructor of InputBotInlineMessageIDClass.
func ( InputBotInlineMessageID) () InputBotInlineMessageIDClass { return & }

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

	_ InputBotInlineMessageIDClass = &InputBotInlineMessageID{}
)

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

	return true
}

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

// FillFrom fills InputBotInlineMessageID from given interface.
func ( *InputBotInlineMessageID) ( interface {
	() ( int)
	() ( int64)
	() ( int64)
}) {
	.DCID = .()
	.ID = .()
	.AccessHash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageID) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageID",
		ID:   InputBotInlineMessageIDTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "DCID",
			SchemaName: "dc_id",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageID#890c3d89 as nil")
	}
	.PutID(InputBotInlineMessageIDTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageID#890c3d89 as nil")
	}
	.PutInt(.DCID)
	.PutLong(.ID)
	.PutLong(.AccessHash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageID#890c3d89 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID#890c3d89: field dc_id: %w", )
		}
		.DCID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID#890c3d89: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID#890c3d89: field access_hash: %w", )
		}
		.AccessHash = 
	}
	return nil
}

// GetDCID returns value of DCID field.
func ( *InputBotInlineMessageID) () ( int) {
	if  == nil {
		return
	}
	return .DCID
}

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

// GetAccessHash returns value of AccessHash field.
func ( *InputBotInlineMessageID) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// InputBotInlineMessageID64 represents TL type `inputBotInlineMessageID64#b6d915d7`.
// Represents a sent inline message from the perspective of a bot
//
// See https://core.telegram.org/constructor/inputBotInlineMessageID64 for reference.
type InputBotInlineMessageID64 struct {
	// DC ID to use when working with this inline message
	DCID int
	// ID of the owner of this message
	OwnerID int64
	// ID of message
	ID int
	// Access hash of message
	AccessHash int64
}

// InputBotInlineMessageID64TypeID is TL type id of InputBotInlineMessageID64.
const InputBotInlineMessageID64TypeID = 0xb6d915d7

// construct implements constructor of InputBotInlineMessageIDClass.
func ( InputBotInlineMessageID64) () InputBotInlineMessageIDClass { return & }

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

	_ InputBotInlineMessageIDClass = &InputBotInlineMessageID64{}
)

func ( *InputBotInlineMessageID64) () bool {
	if  == nil {
		return true
	}
	if !(.DCID == 0) {
		return false
	}
	if !(.OwnerID == 0) {
		return false
	}
	if !(.ID == 0) {
		return false
	}
	if !(.AccessHash == 0) {
		return false
	}

	return true
}

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

// FillFrom fills InputBotInlineMessageID64 from given interface.
func ( *InputBotInlineMessageID64) ( interface {
	() ( int)
	() ( int64)
	() ( int)
	() ( int64)
}) {
	.DCID = .()
	.OwnerID = .()
	.ID = .()
	.AccessHash = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *InputBotInlineMessageID64) () tdp.Type {
	 := tdp.Type{
		Name: "inputBotInlineMessageID64",
		ID:   InputBotInlineMessageID64TypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "DCID",
			SchemaName: "dc_id",
		},
		{
			Name:       "OwnerID",
			SchemaName: "owner_id",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "AccessHash",
			SchemaName: "access_hash",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputBotInlineMessageID64) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageID64#b6d915d7 as nil")
	}
	.PutID(InputBotInlineMessageID64TypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputBotInlineMessageID64) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputBotInlineMessageID64#b6d915d7 as nil")
	}
	.PutInt(.DCID)
	.PutLong(.OwnerID)
	.PutInt(.ID)
	.PutLong(.AccessHash)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputBotInlineMessageID64) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputBotInlineMessageID64#b6d915d7 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field dc_id: %w", )
		}
		.DCID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field owner_id: %w", )
		}
		.OwnerID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field id: %w", )
		}
		.ID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode inputBotInlineMessageID64#b6d915d7: field access_hash: %w", )
		}
		.AccessHash = 
	}
	return nil
}

// GetDCID returns value of DCID field.
func ( *InputBotInlineMessageID64) () ( int) {
	if  == nil {
		return
	}
	return .DCID
}

// GetOwnerID returns value of OwnerID field.
func ( *InputBotInlineMessageID64) () ( int64) {
	if  == nil {
		return
	}
	return .OwnerID
}

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

// GetAccessHash returns value of AccessHash field.
func ( *InputBotInlineMessageID64) () ( int64) {
	if  == nil {
		return
	}
	return .AccessHash
}

// InputBotInlineMessageIDClassName is schema name of InputBotInlineMessageIDClass.
const InputBotInlineMessageIDClassName = "InputBotInlineMessageID"

// InputBotInlineMessageIDClass represents InputBotInlineMessageID generic type.
//
// See https://core.telegram.org/type/InputBotInlineMessageID for reference.
//
// Example:
//
//	g, err := tg.DecodeInputBotInlineMessageID(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.InputBotInlineMessageID: // inputBotInlineMessageID#890c3d89
//	case *tg.InputBotInlineMessageID64: // inputBotInlineMessageID64#b6d915d7
//	default: panic(v)
//	}
type InputBotInlineMessageIDClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() InputBotInlineMessageIDClass

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

	// DC ID to use when working with this inline message
	GetDCID() (value int)

	// Access hash of message
	GetAccessHash() (value int64)
}

// DecodeInputBotInlineMessageID implements binary de-serialization for InputBotInlineMessageIDClass.
func ( *bin.Buffer) (InputBotInlineMessageIDClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case InputBotInlineMessageIDTypeID:
		// Decoding inputBotInlineMessageID#890c3d89.
		 := InputBotInlineMessageID{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", )
		}
		return &, nil
	case InputBotInlineMessageID64TypeID:
		// Decoding inputBotInlineMessageID64#b6d915d7.
		 := InputBotInlineMessageID64{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode InputBotInlineMessageIDClass: %w", bin.NewUnexpectedID())
	}
}

// InputBotInlineMessageID boxes the InputBotInlineMessageIDClass providing a helper.
type InputBotInlineMessageIDBox struct {
	InputBotInlineMessageID InputBotInlineMessageIDClass
}

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

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