// wrp merges different values from a WDMP request into a WRP message
wrp merges different values from a WDMP request into a WRP message
// wrp merges different values from a WDMP request into a WRP message
func wrap(WDMP []byte, tid string, pathVars map[string]string, partnerIDs []string) (*wrp.Message, error) {
	canonicalDeviceID, err := device.ParseID(pathVars["deviceid"])
	if err != nil {
		return nil, transaction.NewBadRequestError(err)
	}
	return &wrp.Message{
		Type:            wrp.SimpleRequestResponseMessageType,
		Payload:         WDMP,
		Destination:     fmt.Sprintf("%s/%s", string(canonicalDeviceID), pathVars["service"]),
		TransactionUUID: tid,
		PartnerIDs:      partnerIDs,
	}, nil
}
func wrap ( WDMP [ ] byte , tid string , pathVars map [ string ] string , partnerIDs [ ] string ) ( * wrp . Message , error ) { canonicalDeviceID , err := device . ParseID ( pathVars [ " " ] ) if err != nil { return nil , transaction . NewBadRequestError ( err ) } return & wrp . Message { Type : wrp . SimpleRequestResponseMessageType , Payload : WDMP , Destination : fmt . Sprintf ( " " , string ( canonicalDeviceID ) , pathVars [ " " ] ) , TransactionUUID : tid , PartnerIDs : partnerIDs , } , nil }
wrp merges different values from a WDMP request into a WRP message
wrp merges different values from a WDMP request into a WRP message