func GetOpenReadStreamRequestHTTPHeaders(req *store.OpenReadStreamRequest) http.Header {
	headers := GetOpenReadStreamRequestHeaders(req)
	httpHeaders := http.Header{}
	for k, v := range headers {
		httpHeaders.Add(k, v)
	}
	return httpHeaders
}
GetOpenReadStreamRequestHTTPHeaders converts an OpenReadStreamRequest struct to http headers for OpenReadStream
package common
import (
	"fmt"
	"net/http"
	"strconv"
	"github.com/uber/cherami-thrift/.generated/go/cherami"
	"github.com/uber/cherami-thrift/.generated/go/shared"
	"github.com/uber/cherami-thrift/.generated/go/store"
)
const (
	keyDestinationUUID   = "DestinationUUID"
	keyDestinationType   = "DestinationType"
	keyExtentUUID        = "ExtentUUID"
	keyConsumerGroupUUID = "ConsumerGroupUUID"
	keyAddress           = "Address"
	keyInclusive         = "Inclusive"
)
func newBadRequestError(msg string) error {
	err := cherami.NewBadRequestError()
	err.Message = msg
	return err
}
func GetOpenAppendStreamRequestHeaders(req *store.OpenAppendStreamRequest) (headers map[string]string) {
	headers = make(map[string]string)
	headers[keyDestinationUUID] = req.GetDestinationUUID()
	headers[keyDestinationType] = req.GetDestinationType().String()
	headers[keyExtentUUID] = req.GetExtentUUID()
	return
}
func GetOpenAppendStreamRequestStruct(headers map[string]string) (req *store.OpenAppendStreamRequest, err error) {
	req = &store.OpenAppendStreamRequest{}
	req = store.NewOpenAppendStreamRequest()
	var ok bool
	destinationUUIDString, ok := headers[keyDestinationUUID]
	if !ok {
		return nil, newBadRequestError("DestinationUUID not specified")
	}
	req.DestinationUUID = StringPtr(destinationUUIDString)
	destinationTypeString, ok := headers[keyDestinationType]
	if !ok {
		return nil, newBadRequestError("DestinationType not specified")
	}
	destinationType, err := cherami.DestinationTypeFromString(destinationTypeString)
	if err != nil {
		return nil, newBadRequestError(fmt.Sprintf("error parsing DestinationType (%s)", destinationTypeString))
	}
	req.DestinationType = cherami.DestinationTypePtr(destinationType)
	extentUUIDString, ok := headers[keyExtentUUID]
	if !ok {
		return nil, newBadRequestError("ExtentUUID not specified")
	}
	req.ExtentUUID = StringPtr(extentUUIDString)
	return req, nil
}
func GetOpenAppendStreamRequestHTTP(httpHeader http.Header) (req *store.OpenAppendStreamRequest, err error) {
	req = store.NewOpenAppendStreamRequest()
	destinationUUIDString := httpHeader.Get(keyDestinationUUID)
	if len(destinationUUIDString) == 0 {
		return nil, newBadRequestError("DestinationUUID not specified")
	}
	req.DestinationUUID = StringPtr(destinationUUIDString)
	destinationTypeString := httpHeader.Get(keyDestinationType)
	if len(destinationTypeString) == 0 {
		return nil, newBadRequestError("DestinationType not specified")
	}
	destinationType, err := cherami.DestinationTypeFromString(destinationTypeString)
	if err != nil {
		return nil, newBadRequestError(fmt.Sprintf("error parsing DestinationType (%s)", destinationTypeString))
	}
	req.DestinationType = cherami.DestinationTypePtr(destinationType)
	extentUUIDString := httpHeader.Get(keyExtentUUID)
	if len(extentUUIDString) == 0 {
		return nil, newBadRequestError("ExtentUUID not specified")
	}
	req.ExtentUUID = StringPtr(extentUUIDString)
	return req, nil
}
func GetOpenReadStreamRequestHeaders(req *store.OpenReadStreamRequest) (headers map[string]string) {
	headers = make(map[string]string)
	headers[keyDestinationUUID] = req.GetDestinationUUID()
	headers[keyDestinationType] = req.GetDestinationType().String()
	headers[keyExtentUUID] = req.GetExtentUUID()
	headers[keyConsumerGroupUUID] = req.GetConsumerGroupUUID()
	headers[keyAddress] = fmt.Sprintf("%v", req.GetAddress())
	headers[keyInclusive] = fmt.Sprintf("%v", req.GetInclusive())
	return
}
func GetOpenReplicationReadStreamRequestHTTPHeaders(req *OpenReplicationReadStreamRequest) http.Header {
	headers := GetOpenReadStreamRequestHeaders(&req.OpenReadStreamRequest)
	httpHeaders := http.Header{}
	for k, v := range headers {
		httpHeaders.Add(k, v)
	}
	return httpHeaders
}
func GetOpenReplicationRemoteReadStreamRequestHTTPHeaders(req *OpenReplicationRemoteReadStreamRequest) http.Header {
	headers := GetOpenReadStreamRequestHeaders(&req.OpenReadStreamRequest)
	httpHeaders := http.Header{}
	for k, v := range headers {
		httpHeaders.Add(k, v)
	}
	return httpHeaders
}