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

// ReqPqMultiRequest represents TL type `req_pq_multi#be7e8ef1`.
type ReqPqMultiRequest struct {
	// Nonce field of ReqPqMultiRequest.
	Nonce bin.Int128
}

// ReqPqMultiRequestTypeID is TL type id of ReqPqMultiRequest.
const ReqPqMultiRequestTypeID = 0xbe7e8ef1

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

func ( *ReqPqMultiRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Nonce == bin.Int128{}) {
		return false
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *ReqPqMultiRequest) () tdp.Type {
	 := tdp.Type{
		Name: "req_pq_multi",
		ID:   ReqPqMultiRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Nonce",
			SchemaName: "nonce",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *ReqPqMultiRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode req_pq_multi#be7e8ef1 as nil")
	}
	.PutID(ReqPqMultiRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *ReqPqMultiRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode req_pq_multi#be7e8ef1 as nil")
	}
	.PutInt128(.Nonce)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *ReqPqMultiRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode req_pq_multi#be7e8ef1 to nil")
	}
	{
		,  := .Int128()
		if  != nil {
			return fmt.Errorf("unable to decode req_pq_multi#be7e8ef1: field nonce: %w", )
		}
		.Nonce = 
	}
	return nil
}

// GetNonce returns value of Nonce field.
func ( *ReqPqMultiRequest) () ( bin.Int128) {
	if  == nil {
		return
	}
	return .Nonce
}