// Valid returns (true, nil) if this struct was valid OFX when unmarshalled
556320
func (sr *InvStatementResponse) Valid(version ofxVersion) (bool, error) {
	if ok, err := sr.TrnUID.Valid(); !ok {
		return false, err
	}
	//TODO implement
	return true, nil
}
561491
func (n PidMode) Valid() bool {
	parts := strings.Split(string(n), ":")
	switch mode := parts[0]; mode {
	case "", "host":
	case "container":
		if len(parts) != 2 || parts[1] == "" {
			return false
		}
	default:
		return false
	}
	return true
}
1239220
func (ut UserType) Valid() (err error) {
	switch ut {
	case Owner: // 1
	case Member: // 2
	default:
		err = ErrInvalidUserType
	}

	return err
}
73178
func (s *sender) valid() bool {
	s2, ok := s.handler().links[s.pLink].(*sender)
	return ok && s2 == s
}
679123
func (m MapClaims) Valid() error {
	vErr := new(ValidationError)
	now := TimeFunc().Unix()

	if m.VerifyExpiresAt(now, false) == false {
		vErr.Inner = errors.New("Token is expired")
		vErr.Errors |= ValidationErrorExpired
	}

	if m.VerifyIssuedAt(now, false) == false {
		vErr.Inner = errors.New("Token used before issued")
		vErr.Errors |= ValidationErrorIssuedAt
	}

	if m.VerifyNotBefore(now, false) == false {
		vErr.Inner = errors.New("Token is not valid yet")
		vErr.Errors |= ValidationErrorNotValidYet
	}

	if vErr.valid() {
		return nil
	}

	return vErr
}
954249
func (st *TxnState) Valid() bool {
	return st.Transaction != nil && st.Transaction.Valid()
}
127321
func (c *chainedRule) Valid(ctx context.Context) bool {
	if !c.Rule.Valid(ctx) {
		return false
	}
	return c.next.Valid(ctx)
}
774954
func (v *validatorRule) Valid(ctx context.Context) bool {
	// check if it's a valid response, if it's not then just return.
	for _, valid := range v.postValidators {
		if !valid(ctx) {
			return false
		}
	}
	return true
}
189771
func (c Currency) Valid() (bool, error) {
	if c.CurRate.IsInt() && c.CurRate.Num().Int64() == 0 {
		return false, errors.New("CurRate may not be zero")
	} else if ok, err := c.CurSym.Valid(); !ok {
		return false, err
	}
	return true, nil
}
406398
func (itr *memDBIterator) Valid() bool {
	return 0 <= itr.cur && itr.cur < len(itr.keys)
}
114509
func (l LevelInfo) Valid() bool {
	return level.IsValidPriority(l.Default) && level.IsValidPriority(l.Threshold)
}
1183252
func (a Action) Valid() (err error) {
	switch a {
	case ReadAction: // 1
	case WriteAction: // 2
	default:
		err = ErrInvalidAction
	}

	return err
}
1084912
func (p *Signing) Valid() bool {
	if p == nil {
		return false
	}

	log.Debugf("validating configuration")
	if !p.Default.validProfile(true) {
		log.Debugf("default profile is invalid")
		return false
	}

	for _, sp := range p.Profiles {
		if !sp.validProfile(false) {
			log.Debugf("invalid profile")
			return false
		}
	}

	p.warnSkippedSettings()

	return true
}
746799
func (r *patchViewRequest) Valid() *platform.Error {
	if !r.ViewID.Valid() {
		return &platform.Error{
			Code: platform.EInvalid,
			Msg:  "missing view ID",
		}
	}

	return r.Upd.Valid()
}
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
}
781305
func (c *Claims) Valid() error {
	if err := c.StandardClaims.Valid(); err != nil {
		return err
	} else if c.StandardClaims.Subject == "" {
		return fmt.Errorf("claim has no subject")
	}

	return nil
}
209855
func (m *Variable) Valid() error {
	// todo(leodido) > check it org ID validity?

	if m.Name == "" {
		return fmt.Errorf("missing variable name")
	}

	validTypes := map[string]bool{
		"constant": true,
		"map":      true,
		"query":    true,
	}

	if _, prs := validTypes[m.Arguments.Type]; !prs {
		return fmt.Errorf("invalid arguments type")
	}

	return nil
}