// Valid returns (true, nil) if this struct is valid OFX
509864
func (l TransactionList) Valid(version ofxVersion) (bool, error) {
	var emptyDate Date
	if l.DtStart.Equal(emptyDate) {
		return false, errors.New("TransactionList.DtStart not filled")
	} else if l.DtEnd.Equal(emptyDate) {
		return false, errors.New("TransactionList.DtEnd not filled")
	}
	for _, t := range l.Transactions {
		if ok, err := t.Valid(version); !ok {
			return false, err
		}
	}

	return true, nil
}
609349
func (k internalKey) valid() bool {
	i := len(k) - 8
	return i >= 0 && internalKeyKind(k[i]) <= internalKeyKindMax
}
1266232
func (l PendingTransactionList) Valid() (bool, error) {
	var emptyDate Date
	if l.DtAsOf.Equal(emptyDate) {
		return false, errors.New("PendingTransactionList.DtAsOf not filled")
	}
	for _, t := range l.Transactions {
		if ok, err := t.Valid(); !ok {
			return false, err
		}
	}

	return true, nil
}
334213
func (m *mappingsRequest) Valid() error {
	if m.Provider == "" {
		return fmt.Errorf("mapping must specify provider")
	}
	if m.Scheme == "" {
		return fmt.Errorf("mapping must specify scheme")
	}
	if m.ProviderOrganization == "" {
		return fmt.Errorf("mapping must specify group")
	}

	return nil
}
366665
func Valid(cpf string) bool {
	isValid, err := AssertValid(cpf)
	if err != nil {
		return false
	}
	return isValid
}
382588
func valid(authorization []string) bool {
	if len(authorization) < 1 {
		return false
	}
	token := strings.TrimPrefix(authorization[0], "Bearer ")
	// Perform the token validation here. For the sake of this example, the code
	// here forgoes any of the usual OAuth2 token validation and instead checks
	// for a token matching an arbitrary string.
	return token == "some-secret-token"
}
337570
func (r Resource) Valid() (err error) {
	switch r {
	case AuthorizationsResource: // 0
	case BucketsResource: // 1
	case DashboardsResource: // 2
	case OrgsResource: // 3
	case TasksResource: // 4
	case TelegrafsResource: // 5
	case SourcesResource: // 6
	case UsersResource: //7
	default:
		err = ErrInvalidResource
	}

	return err
}
1356457
func (v *Validation) Valid(obj interface{}, args ...string) (ok bool, err error) {
	err = v.validExec(obj, "", args...)
	if err != nil {
		fmt.Println(err)
		return
	}
	if !v.HasErrors() {
		if form, ok := obj.(ValidFormer); ok {
			form.Valid(v)
		}
	}
	ok = v.HasErrors() == false
	return
}
73178
func (s *sender) valid() bool {
	s2, ok := s.handler().links[s.pLink].(*sender)
	return ok && s2 == s
}
976580
func (dbp *Process) Valid() (bool, error) {
	if dbp.detached {
		return false, &proc.ProcessDetachedError{}
	}
	if dbp.exited {
		return false, &proc.ErrProcessExited{Pid: dbp.Pid()}
	}
	return true, nil
}
652766
func (s *ConfigSnapshot) Valid() bool {
	return s.Roots != nil && s.Leaf != nil
}
1251720
func (p *Provider) Valid(hash, plain []byte) bool {
	if !prefixValid(hash) {
		return false
	}

	_, params, saltBytes, expectedKey, err := mcf.Decode(hash, providerName)
	if err != nil {
		return false
	}
	hashParams := paramsFromMCF([]byte(params))

	key, _ := scrypt.Key(plain, saltBytes, hashParams.n, hashParams.r, hashParams.p, hashParams.keyLen)

	return subtle.ConstantTimeCompare(key, expectedKey) == 1
}
1141997
func (a *ACL) Valid() error {
	acl_valid, err := getSymbolPointer(a.lib.handle, "acl_valid")
	if err != nil {
		return err
	}

	ret, err := C.my_acl_valid(acl_valid, a.a)
	if ret < 0 {
		return errwrap.Wrap(errors.New("invalid acl"), err)
	}
	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
}
1301545
func (bb BoundingBox) Valid() error {
	switch len(bb) {
	case 0:
		return nil
	case 4:
		if bb[1] > bb[3] {
			return errors.New("Bounding Box values must be in south-westerly to north-easterly order.")
		}
		return nil
	case 6:
		if bb[1] > bb[4] || bb[2] > bb[5] {
			return errors.New("Bounding Box values must be in south-westerly to north-easterly order.")
		}
		return nil
	}
	return errors.New("Bounding Box must have 0, 4, or 6 values.")
}
480412
func Valid(arg string) bool {
	_, err := Parse(arg)
	return err == nil
}
1226509
func (p Payee) Valid() (bool, error) {
	if len(p.Name) == 0 {
		return false, errors.New("Payee.Name empty")
	} else if len(p.Addr1) == 0 {
		return false, errors.New("Payee.Addr1 empty")
	} else if len(p.City) == 0 {
		return false, errors.New("Payee.City empty")
	} else if len(p.State) == 0 {
		return false, errors.New("Payee.State empty")
	} else if len(p.PostalCode) == 0 {
		return false, errors.New("Payee.PostalCode empty")
	} else if len(p.Country) != 0 && len(p.Country) != 3 {
		return false, errors.New("Payee.Country invalid length")
	} else if len(p.Phone) == 0 {
		return false, errors.New("Payee.Phone empty")
	}
	return true, nil
}