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

// MessagesReceivedQueueRequest represents TL type `messages.receivedQueue#55a5bb66`.
// Confirms receipt of messages in a secret chat by client, cancels push notifications.
// The method returns a list of random_ids of messages for which push notifications were
// cancelled.
//
// See https://core.telegram.org/method/messages.receivedQueue for reference.
type MessagesReceivedQueueRequest struct {
	// Maximum qts value available at the client
	MaxQts int
}

// MessagesReceivedQueueRequestTypeID is TL type id of MessagesReceivedQueueRequest.
const MessagesReceivedQueueRequestTypeID = 0x55a5bb66

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

func ( *MessagesReceivedQueueRequest) () bool {
	if  == nil {
		return true
	}
	if !(.MaxQts == 0) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesReceivedQueueRequest from given interface.
func ( *MessagesReceivedQueueRequest) ( interface {
	() ( int)
}) {
	.MaxQts = .()
}

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

// TypeName returns name of type in TL schema.
func (*MessagesReceivedQueueRequest) () string {
	return "messages.receivedQueue"
}

// TypeInfo returns info about TL type.
func ( *MessagesReceivedQueueRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.receivedQueue",
		ID:   MessagesReceivedQueueRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "MaxQts",
			SchemaName: "max_qts",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesReceivedQueueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.receivedQueue#55a5bb66 as nil")
	}
	.PutID(MessagesReceivedQueueRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesReceivedQueueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.receivedQueue#55a5bb66 as nil")
	}
	.PutInt(.MaxQts)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesReceivedQueueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.receivedQueue#55a5bb66 to nil")
	}
	if  := .ConsumeID(MessagesReceivedQueueRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.receivedQueue#55a5bb66: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesReceivedQueueRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.receivedQueue#55a5bb66 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.receivedQueue#55a5bb66: field max_qts: %w", )
		}
		.MaxQts = 
	}
	return nil
}

// GetMaxQts returns value of MaxQts field.
func ( *MessagesReceivedQueueRequest) () ( int) {
	if  == nil {
		return
	}
	return .MaxQts
}

// MessagesReceivedQueue invokes method messages.receivedQueue#55a5bb66 returning error if any.
// Confirms receipt of messages in a secret chat by client, cancels push notifications.
// The method returns a list of random_ids of messages for which push notifications were
// cancelled.
//
// Possible errors:
//
//	400 MAX_QTS_INVALID: The specified max_qts is invalid.
//	500 MSG_WAIT_FAILED: A waiting call returned an error.
//
// See https://core.telegram.org/method/messages.receivedQueue for reference.
func ( *Client) ( context.Context,  int) ([]int64, error) {
	var  LongVector

	 := &MessagesReceivedQueueRequest{
		MaxQts: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return []int64(.Elems), nil
}