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

// PingDelayDisconnectRequest represents TL type `ping_delay_disconnect#f3427b8c`.
type PingDelayDisconnectRequest struct {
	// PingID field of PingDelayDisconnectRequest.
	PingID int64
	// DisconnectDelay field of PingDelayDisconnectRequest.
	DisconnectDelay int
}

// PingDelayDisconnectRequestTypeID is TL type id of PingDelayDisconnectRequest.
const PingDelayDisconnectRequestTypeID = 0xf3427b8c

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

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

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *PingDelayDisconnectRequest) () tdp.Type {
	 := tdp.Type{
		Name: "ping_delay_disconnect",
		ID:   PingDelayDisconnectRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "PingID",
			SchemaName: "ping_id",
		},
		{
			Name:       "DisconnectDelay",
			SchemaName: "disconnect_delay",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *PingDelayDisconnectRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode ping_delay_disconnect#f3427b8c as nil")
	}
	.PutID(PingDelayDisconnectRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *PingDelayDisconnectRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode ping_delay_disconnect#f3427b8c as nil")
	}
	.PutLong(.PingID)
	.PutInt(.DisconnectDelay)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *PingDelayDisconnectRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode ping_delay_disconnect#f3427b8c to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode ping_delay_disconnect#f3427b8c: field ping_id: %w", )
		}
		.PingID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode ping_delay_disconnect#f3427b8c: field disconnect_delay: %w", )
		}
		.DisconnectDelay = 
	}
	return nil
}

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

// GetDisconnectDelay returns value of DisconnectDelay field.
func ( *PingDelayDisconnectRequest) () ( int) {
	if  == nil {
		return
	}
	return .DisconnectDelay
}