// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package protocol

type DefaultReceiveRequest struct {
	Topic            *string          `toml:"topic"`
	Payload          *string          `toml:"payload"`
	ContentType      *string          `toml:"content-type"`
	FormatIndicator  *byte            `toml:"format-indicator"`
	CorrelationIndex *int             `toml:"correlation-index"`
	Qos              *byte            `toml:"qos"`
	MessageExpiry    TestCaseDuration `toml:"message-expiry"`
	ResponseTopic    *string          `toml:"response-topic"`
	SourceIndex      *int             `toml:"source-index"`
}

func (receiveRequest *DefaultReceiveRequest) GetTopic() *string {
	if receiveRequest.Topic == nil {
		return nil
	}

	topic := *receiveRequest.Topic
	return &topic
}

func (receiveRequest *DefaultReceiveRequest) GetPayload() *string {
	if receiveRequest.Payload == nil {
		return nil
	}

	payload := *receiveRequest.Payload
	return &payload
}

func (receiveRequest *DefaultReceiveRequest) GetContentType() *string {
	if receiveRequest.ContentType == nil {
		return nil
	}

	contentType := *receiveRequest.ContentType
	return &contentType
}

func (receiveRequest *DefaultReceiveRequest) GetFormatIndicator() *byte {
	if receiveRequest.FormatIndicator == nil {
		return nil
	}

	formatIndicator := *receiveRequest.FormatIndicator
	return &formatIndicator
}

func (receiveRequest *DefaultReceiveRequest) GetCorrelationIndex() *int {
	if receiveRequest.CorrelationIndex == nil {
		return nil
	}

	correlationIndex := *receiveRequest.CorrelationIndex
	return &correlationIndex
}

func (receiveRequest *DefaultReceiveRequest) GetQos() *byte {
	if receiveRequest.Qos == nil {
		return nil
	}

	qos := *receiveRequest.Qos
	return &qos
}

func (receiveRequest *DefaultReceiveRequest) GetMessageExpiry() TestCaseDuration {
	return receiveRequest.MessageExpiry
}

func (receiveRequest *DefaultReceiveRequest) GetResponseTopic() *string {
	if receiveRequest.ResponseTopic == nil {
		return nil
	}

	responseTopic := *receiveRequest.ResponseTopic
	return &responseTopic
}

func (receiveRequest *DefaultReceiveRequest) GetSourceIndex() *int {
	if receiveRequest.SourceIndex == nil {
		return nil
	}

	invokerIndex := *receiveRequest.SourceIndex
	return &invokerIndex
}
