// Valid returns an error if a Macro changeset is not valid
549399
func (u *MacroUpdate) Valid() error {
	if u.Name == "" && u.Selected == nil && u.Arguments == nil {
		return fmt.Errorf("no fields supplied in update")
	}

	return nil
}
1127189
func (c StandardClaims) Valid() error {
	vErr := new(ValidationError)
	now := TimeFunc().Unix()

	// The claims below are optional, by default, so if they are set to the
	// default value in Go, let's not fail the verification for them.
	if c.VerifyExpiresAt(now, false) == false {
		delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0))
		vErr.Inner = fmt.Errorf("token is expired by %v", delta)
		vErr.Errors |= ValidationErrorExpired
	}

	if c.VerifyIssuedAt(now, false) == false {
		vErr.Inner = fmt.Errorf("Token used before issued")
		vErr.Errors |= ValidationErrorIssuedAt
	}

	if c.VerifyNotBefore(now, false) == false {
		vErr.Inner = fmt.Errorf("token is not valid yet")
		vErr.Errors |= ValidationErrorNotValidYet
	}

	if vErr.valid() {
		return nil
	}

	return vErr
}
683014
func (ou UID) Valid() (bool, error) {
	if len(ou) == 0 || len(ou) > 36 {
		return false, errors.New("UID invalid length")
	}
	return true, nil
}
1174930
func (r *Resource) Valid() bool {
	if r.Name == "" {
		fmt.Println("no resource spec label")
		return false
	}

	for _, c := range r.Credentials {
		if !c.Valid() {
			return false
		}
	}

	return true
}
1266769
func (f *ScmpFilter) IsValid() bool {
	f.lock.Lock()
	defer f.lock.Unlock()

	return f.valid
}
480412
func Valid(arg string) bool {
	_, err := Parse(arg)
	return err == nil
}
784936
func (air *AcctInfoResponse) Valid(version ofxVersion) (bool, error) {
	if ok, err := air.TrnUID.Valid(); !ok {
		return false, err
	}
	//TODO implement
	return true, nil
}
708206
func (ns *NonceService) Valid(nonce string) bool {
	c, err := ns.decrypt(nonce)
	if err != nil {
		ns.stats.Inc("Invalid.Decrypt", 1)
		return false
	}

	ns.mu.Lock()
	defer ns.mu.Unlock()
	if c > ns.latest {
		ns.stats.Inc("Invalid.TooHigh", 1)
		return false
	}

	if c <= ns.earliest {
		ns.stats.Inc("Invalid.TooLow", 1)
		return false
	}

	if ns.used[c] {
		ns.stats.Inc("Invalid.AlreadyUsed", 1)
		return false
	}

	ns.used[c] = true
	heap.Push(ns.usedHeap, c)
	if len(ns.used) > ns.maxUsed {
		s := time.Now()
		ns.earliest = heap.Pop(ns.usedHeap).(int64)
		ns.stats.TimingDuration("Heap.Latency", time.Since(s))
		delete(ns.used, ns.earliest)
	}

	ns.stats.Inc("Valid", 1)
	return true
}
619836
func (acl *ACL) Valid() bool {
	rv := C.acl_valid(acl.a)
	if rv < 0 {
		return false
	}
	return true
}
73178
func (s *sender) valid() bool {
	s2, ok := s.handler().links[s.pLink].(*sender)
	return ok && s2 == s
}
56790
func (ck *MaintenanceWindow) Valid() error {
	if ck.Description == "" {
		return fmt.Errorf("Invalid value for `Description`.  Must contain non-empty string")
	}

	if ck.From == 0 {
		return fmt.Errorf("Invalid value for `From`.  Must contain time")
	}

	if ck.To == 0 {
		return fmt.Errorf("Invalid value for `To`.  Must contain time")
	}

	return nil
}
851994
func (config *Config) valid() error {
	// check minlevel validation
	if "" != config.MinLevel && !LevelFromString(config.MinLevel).valid() {
		return ErrConfigBadAttributes
	}

	// check filters len
	if len(config.Filters) < 1 {
		return ErrConfigFiltersNotFound
	}

	// check filter one by one
	for _, filter := range config.Filters {
		if "" == filter.Levels {
			return ErrConfigLevelsNotFound
		}

		if (file{}) != filter.File {
			// seem not needed now
			//if "" == filter.File.Path {
			//return ErrConfigFilePathNotFound
			//}
		} else if (rotateFile{}) != filter.RotateFile {
			if "" == filter.RotateFile.Path {
				return ErrConfigFilePathNotFound
			}

			if "" == filter.RotateFile.Type {
				return ErrConfigFileRotateTypeNotFound
			}
		} else if (socket{}) != filter.Socket {
			if "" == filter.Socket.Address {
				return ErrConfigSocketAddressNotFound
			}

			if "" == filter.Socket.Network {
				return ErrConfigSocketNetworkNotFound
			}
		}
	}

	return nil
}
1333946
func (c CurrSymbol) Valid() (bool, error) {
	if c.String() == "XXX" {
		return false, fmt.Errorf("Invalid CurrSymbol: %s", c.Unit)
	}
	return true, nil
}
1183252
func (a Action) Valid() (err error) {
	switch a {
	case ReadAction: // 1
	case WriteAction: // 2
	default:
		err = ErrInvalidAction
	}

	return err
}
560297
func (m *ChannelMap) Valid() bool {
	cmap := m.toC()
	return C.pa_channel_map_valid(cmap) != 0
}
740697
func (tacl *tableACL) Valid() bool {
	tacl.RLock()
	defer tacl.RUnlock()
	return tacl.entries != nil
}
87991
func (m *MachineLogin) Valid() bool {
	return m.TokenID != nil && m.Secret != nil && m.Secret.String() != ""
}