func (sde Private) Validate() error {
	if sde.Name == "" {
		return fmt.Errorf("empty Name")
	}
	if strings.Contains(string(sde.Name), "@") {
		return fmt.Errorf(`invalid char in %q`, sde.Name)
	}
	if err := sde.Name.Validate(); err != nil {
		return fmt.Errorf("invalid Name %q: %v", sde.Name, err)
	}

	if sde.PEN <= 0 {
		return fmt.Errorf("empty PEN")
	}
	if err := sde.PEN.Validate(); err != nil {
		return fmt.Errorf("invalid PEN %q: %v", sde.PEN, err)
	}

	for i, param := range sde.Data {
		if err := param.Validate(); err != nil {
			return fmt.Errorf("param %d not valid: %v", i, err)
		}
	}

	// TODO(ericsnow) ensure PEN matches origin.EnterpriseID (if any)
	return nil
}
// Validate ensures that the element is correct.
Validate ensures that the element is correct.
// Validate ensures that the element is correct .
func (sde Private) Validate() error {
	if sde.Name == "" {
		return fmt.Errorf("empty Name")
	}
	if strings.Contains(string(sde.Name), "@") {
		return fmt.Errorf(`invalid char in %q`, sde.Name)
	}
	if err := sde.Name.Validate(); err != nil {
		return fmt.Errorf("invalid Name %q: %v", sde.Name, err)
	}
	if sde.PEN <= 0 {
		return fmt.Errorf("empty PEN")
	}
	if err := sde.PEN.Validate(); err != nil {
		return fmt.Errorf("invalid PEN %q: %v", sde.PEN, err)
	}
	for i, param := range sde.Data {
		if err := param.Validate(); err != nil {
			return fmt.Errorf("param %d not valid: %v", i, err)
		}
	}
	return nil
}
func ( sde Private ) Validate ( ) error { if sde . Name == " " { return fmt . Errorf ( " " ) } if strings . Contains ( string ( sde . Name ) , " " ) { return fmt . Errorf ( `invalid char in %q` , sde . Name ) } if err := sde . Name . Validate ( ) ; err != nil { return fmt . Errorf ( " " , sde . Name , err ) } if sde . PEN <= 0 { return fmt . Errorf ( " " ) } if err := sde . PEN . Validate ( ) ; err != nil { return fmt . Errorf ( " " , sde . PEN , err ) } for i , param := range sde . Data { if err := param . Validate ( ) ; err != nil { return fmt . Errorf ( " " , i , err ) } } return nil }
Validate ensures that the element is correct.
Validate ensures that the element is correct .
// TODO(ericsnow) ensure PEN matches origin.EnterpriseID (if any)