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

// MessagesRateTranscribedAudioRequest represents TL type `messages.rateTranscribedAudio#7f1d072f`.
// Rate transcribed voice messageĀ¹
//
// Links:
//  1. https://core.telegram.org/api/transcribe
//
// See https://core.telegram.org/method/messages.rateTranscribedAudio for reference.
type MessagesRateTranscribedAudioRequest struct {
	// Peer where the voice message was sent
	Peer InputPeerClass
	// Message ID
	MsgID int
	// Transcription ID
	TranscriptionID int64
	// Whether the transcription was correct
	Good bool
}

// MessagesRateTranscribedAudioRequestTypeID is TL type id of MessagesRateTranscribedAudioRequest.
const MessagesRateTranscribedAudioRequestTypeID = 0x7f1d072f

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

func ( *MessagesRateTranscribedAudioRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.TranscriptionID == 0) {
		return false
	}
	if !(.Good == false) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesRateTranscribedAudioRequest from given interface.
func ( *MessagesRateTranscribedAudioRequest) ( interface {
	() ( InputPeerClass)
	() ( int)
	() ( int64)
	() ( bool)
}) {
	.Peer = .()
	.MsgID = .()
	.TranscriptionID = .()
	.Good = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesRateTranscribedAudioRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.rateTranscribedAudio",
		ID:   MessagesRateTranscribedAudioRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "TranscriptionID",
			SchemaName: "transcription_id",
		},
		{
			Name:       "Good",
			SchemaName: "good",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesRateTranscribedAudioRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.rateTranscribedAudio#7f1d072f as nil")
	}
	.PutID(MessagesRateTranscribedAudioRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesRateTranscribedAudioRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.rateTranscribedAudio#7f1d072f as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.rateTranscribedAudio#7f1d072f: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.rateTranscribedAudio#7f1d072f: field peer: %w", )
	}
	.PutInt(.MsgID)
	.PutLong(.TranscriptionID)
	.PutBool(.Good)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesRateTranscribedAudioRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.rateTranscribedAudio#7f1d072f to nil")
	}
	if  := .ConsumeID(MessagesRateTranscribedAudioRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.rateTranscribedAudio#7f1d072f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesRateTranscribedAudioRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.rateTranscribedAudio#7f1d072f to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.rateTranscribedAudio#7f1d072f: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.rateTranscribedAudio#7f1d072f: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messages.rateTranscribedAudio#7f1d072f: field transcription_id: %w", )
		}
		.TranscriptionID = 
	}
	{
		,  := .Bool()
		if  != nil {
			return fmt.Errorf("unable to decode messages.rateTranscribedAudio#7f1d072f: field good: %w", )
		}
		.Good = 
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *MessagesRateTranscribedAudioRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

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

// GetTranscriptionID returns value of TranscriptionID field.
func ( *MessagesRateTranscribedAudioRequest) () ( int64) {
	if  == nil {
		return
	}
	return .TranscriptionID
}

// GetGood returns value of Good field.
func ( *MessagesRateTranscribedAudioRequest) () ( bool) {
	if  == nil {
		return
	}
	return .Good
}

// MessagesRateTranscribedAudio invokes method messages.rateTranscribedAudio#7f1d072f returning error if any.
// Rate transcribed voice messageĀ¹
//
// Links:
//  1. https://core.telegram.org/api/transcribe
//
// See https://core.telegram.org/method/messages.rateTranscribedAudio for reference.
func ( *Client) ( context.Context,  *MessagesRateTranscribedAudioRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}