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

// MessagesReadMessageContentsRequest represents TL type `messages.readMessageContents#36a73f77`.
// Notifies the sender about the recipient having listened a voice message or watched a
// video.
//
// See https://core.telegram.org/method/messages.readMessageContents for reference.
type MessagesReadMessageContentsRequest struct {
	// Message ID list
	ID []int
}

// MessagesReadMessageContentsRequestTypeID is TL type id of MessagesReadMessageContentsRequest.
const MessagesReadMessageContentsRequestTypeID = 0x36a73f77

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

func ( *MessagesReadMessageContentsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.ID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesReadMessageContentsRequest from given interface.
func ( *MessagesReadMessageContentsRequest) ( interface {
	() ( []int)
}) {
	.ID = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesReadMessageContentsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.readMessageContents",
		ID:   MessagesReadMessageContentsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesReadMessageContentsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.readMessageContents#36a73f77 as nil")
	}
	.PutID(MessagesReadMessageContentsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesReadMessageContentsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.readMessageContents#36a73f77 as nil")
	}
	.PutVectorHeader(len(.ID))
	for ,  := range .ID {
		.PutInt()
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesReadMessageContentsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.readMessageContents#36a73f77 to nil")
	}
	if  := .ConsumeID(MessagesReadMessageContentsRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.readMessageContents#36a73f77: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesReadMessageContentsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.readMessageContents#36a73f77 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.readMessageContents#36a73f77: field id: %w", )
		}

		if  > 0 {
			.ID = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode messages.readMessageContents#36a73f77: field id: %w", )
			}
			.ID = append(.ID, )
		}
	}
	return nil
}

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

// MessagesReadMessageContents invokes method messages.readMessageContents#36a73f77 returning error if any.
// Notifies the sender about the recipient having listened a voice message or watched a
// video.
//
// See https://core.telegram.org/method/messages.readMessageContents for reference.
func ( *Client) ( context.Context,  []int) (*MessagesAffectedMessages, error) {
	var  MessagesAffectedMessages

	 := &MessagesReadMessageContentsRequest{
		ID: ,
	}
	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return &, nil
}