//isValidSetWDMP helps verify a given Set WDMP object is valid for its context
isValidSetWDMP helps verify a given Set WDMP object is valid for its context
// isValidSetWDMP helps verify a given Set WDMP object is valid for its context
func isValidSetWDMP(wdmp *setWDMP) (isValid bool) {
	if emptyParams := wdmp.Parameters == nil || len(wdmp.Parameters) == 0; emptyParams {
		return wdmp.Command == CommandTestSet 
	}
	var cmdSetAttr, cmdSet = 0, 0
	for _, param := range wdmp.Parameters {
		if param.Name == nil || *param.Name == "" {
			return
		}
		if param.Value != nil && (param.DataType == nil || *param.DataType < 0) {
			return
		}
		if wdmp.Command == CommandSetAttrs && param.Attributes == nil {
			return
		}
		if param.Attributes != nil &&
			param.DataType == nil &&
			param.Value == nil {
			cmdSetAttr++
		} else {
			cmdSet++
		}
		if cmdSetAttr > 0 && cmdSet > 0 {
			return
		}
	}
	return true
}
func isValidSetWDMP ( wdmp * setWDMP ) ( isValid bool ) { if emptyParams := wdmp . Parameters == nil || len ( wdmp . Parameters ) == 0 ; emptyParams { return wdmp . Command == CommandTestSet } var cmdSetAttr , cmdSet = 0 , 0 for _ , param := range wdmp . Parameters { if param . Name == nil || * param . Name == " " { return } if param . Value != nil && ( param . DataType == nil || * param . DataType < 0 ) { return } if wdmp . Command == CommandSetAttrs && param . Attributes == nil { return } if param . Attributes != nil && param . DataType == nil && param . Value == nil { cmdSetAttr ++ } else { cmdSet ++ } if cmdSetAttr > 0 && cmdSet > 0 { return } } return true }
isValidSetWDMP helps verify a given Set WDMP object is valid for its context
isValidSetWDMP helps verify a given Set WDMP object is valid for its context
//TEST_AND_SET can have empty parameters //validate parameters if it exists, even for TEST_SET // verify that all parameters are correct for either doing a command SET_ATTRIBUTE or SET