// Valid returns true if incoming request and post-response from the original handler
// is valid to be store to the cache, if not(false) then the consumer should just exit
// otherwise(true) the consumer should store the cached response
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
}
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
}
102598
func (ck *HttpCheck) Valid() error {
	if ck.Name == "" {
		return fmt.Errorf("Invalid value for `Name`.  Must contain non-empty string")
	}

	if ck.Hostname == "" {
		return fmt.Errorf("Invalid value for `Hostname`.  Must contain non-empty string")
	}

	if ck.Resolution != 1 && ck.Resolution != 5 && ck.Resolution != 15 &&
		ck.Resolution != 30 && ck.Resolution != 60 {
		return fmt.Errorf("invalid value %v for `Resolution`, allowed values are [1,5,15,30,60]", ck.Resolution)
	}

	if ck.ShouldContain != "" && ck.ShouldNotContain != "" {
		return fmt.Errorf("`ShouldContain` and `ShouldNotContain` must not be declared at the same time")
	}

	return nil
}
746706
func (r *SignonResponse) Valid(version ofxVersion) (bool, error) {
	if len(r.Language) != 3 {
		return false, fmt.Errorf("SONRS>LANGUAGE invalid length: \"%s\"", r.Language)
	}
	return r.Status.Valid()
}
1154928
func (ditr debugIterator) Valid() (ok bool) {
	defer func() {
		fmt.Printf("%v.itr.Valid() %v\n", ditr.label, ok)
	}()
	ok = ditr.itr.Valid()
	return
}
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
}
962665
func (t *TokenContainer) Valid() bool {
	if t.Token == nil {
		return false
	}
	return t.Token.Valid()
}
201124
func (c *conditionalRule) Valid(ctx context.Context) bool {
	if !c.validPredicate() {
		return false
	}
	return true
}
778589
func (aabb *AABB) Valid() bool {
	return aabb.Lower.X <= aabb.Upper.X && aabb.Lower.Y <= aabb.Upper.Y
}
1206990
func (t PendingTransaction) Valid() (bool, error) {
	var emptyDate Date
	if !t.TrnType.Valid() {
		return false, errors.New("PendingTransaction.TrnType invalid")
	} else if t.DtTran.Equal(emptyDate) {
		return false, errors.New("PendingTransaction.DtTran not filled")
	} else if len(t.Name) == 0 {
		return false, errors.New("PendingTransaction.Name empty")
	}
	ok1, _ := t.Currency.Valid()
	ok2, _ := t.OrigCurrency.Valid()
	if ok1 && ok2 {
		return false, errors.New("Currency and OrigCurrency both supplied for Pending Transaction, only one allowed")
	}
	return true, nil
}
1142565
func (na *NetAddress) Valid() bool {
	if string(na.ID) != "" {
		data, err := hex.DecodeString(string(na.ID))
		if err != nil || len(data) != IDByteLength {
			return false
		}
	}
	return na.IP != nil && !(na.IP.IsUnspecified() || na.RFC3849() ||
		na.IP.Equal(net.IPv4bcast))
}
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
}
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
}
467569
func (s Status) Valid() error {
	switch s {
	case Active, Inactive:
		return nil
	default:
		return &Error{
			Code: EInvalid,
			Msg:  fmt.Sprintf("invalid status: must be %v or %v", Active, Inactive),
		}
	}
}
1325988
func (p *Project) Valid() bool {
	if p.Name == "" {
		fmt.Println("no project spec name")
		return false
	}

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

	return true
}
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
}
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()
}