// Code generated by gotdgen, DO NOT EDIT.

package mt

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

// Pong represents TL type `pong#347773c5`.
type Pong struct {
	// MsgID field of Pong.
	MsgID int64
	// PingID field of Pong.
	PingID int64
}

// PongTypeID is TL type id of Pong.
const PongTypeID = 0x347773c5

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

func ( *Pong) () bool {
	if  == nil {
		return true
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.PingID == 0) {
		return false
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *Pong) () tdp.Type {
	 := tdp.Type{
		Name: "pong",
		ID:   PongTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "PingID",
			SchemaName: "ping_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *Pong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pong#347773c5 as nil")
	}
	.PutID(PongTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *Pong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode pong#347773c5 as nil")
	}
	.PutLong(.MsgID)
	.PutLong(.PingID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *Pong) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode pong#347773c5 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pong#347773c5: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode pong#347773c5: field ping_id: %w", )
		}
		.PingID = 
	}
	return nil
}

// GetMsgID returns value of MsgID field.
func ( *Pong) () ( int64) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetPingID returns value of PingID field.
func ( *Pong) () ( int64) {
	if  == nil {
		return
	}
	return .PingID
}