// CheckValidity indicates an expected call of CheckValidity
// nolint
486304
func (mr *MockRPCClientMockRecorder) CheckValidity(req, secret interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckValidity", reflect.TypeOf((*MockRPCClient)(nil).CheckValidity), req, secret)
}
233269
func (authy *Authy) CheckPhoneVerification(countryCode int, phoneNumber string, verificationCode string, params url.Values) (*PhoneVerificationCheck, error) {
	params.Set("country_code", strconv.Itoa(countryCode))
	params.Set("phone_number", phoneNumber)
	params.Set("verification_code", verificationCode)

	path := fmt.Sprintf("/protected/json/phones/verification/check")
	response, err := authy.DoRequest("GET", path, params)
	if err != nil {
		return nil, err
	}

	defer closeResponseBody(response)
	return NewPhoneVerificationCheck(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
}
836186
func checkValid(data []byte, scan *Scanner) error {
	scan.Reset()
	for _, c := range data {
		scan.bytes++
		if scan.Step(scan, int(c)) == ScanError {
			return scan.Err
		}
	}
	if scan.EOF() == ScanError {
		return scan.Err
	}
	return nil
}
1198275
func (s State) CheckValid() error {
	switch s {
	case StateNew, StateStart, StateClose:
		return nil
	default:
		return errors.NewBadParameterError("iteration state", s).Expected(StateNew + "|" + StateStart + "|" + StateClose)
	}
}
658981
func (s *service) CheckCredentials(reqDTO rest.RequestDTOCheckCredentials) (rest.ResponseDTOUserInfo, *servicehelper.Error) {
	if reqDTO.AuthType == "password" {
		return checkCredentialsForPasswordAuth(s, reqDTO.Username, reqDTO.Password)
	} else if reqDTO.AuthType == "facebook" {
		return checkCredentialsForFacebookAuth(s, reqDTO.Username, reqDTO.Password)
	} else if reqDTO.AuthType == "google" {
		return checkCredentialsForGoogleAuth(s, reqDTO.Username, reqDTO.Password)
	}
	return rest.ResponseDTOUserInfo{}, &servicehelper.Error{
		Detail: errors.New("incorrect username or password"),
	}
}
210601
func IsValid(expr string) bool {
	_, err := parse(expr, &match{})
	return err == nil
}
1220833
func (r User_Customer_External_Binding_Phone) CheckPhoneValidationResult(token *string) (resp bool, err error) {
	params := []interface{}{
		token,
	}
	err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Phone", "checkPhoneValidationResult", params, &r.Options, &resp)
	return
}
926475
func (e *Element) IsInvalid() bool {
	e.lock.RLock()
	defer e.lock.RUnlock()
	return e.invalidated
}
727081
func (t Topology) CheckValid() error {
	switch t {
	case TopologyNetwork, TopologyDirectedNetwork, TopologyDependency, TopologyTree:
		return nil
	default:
		return errors.NewBadParameterError("topolgy", t).Expected(TopologyNetwork + "|" + TopologyDirectedNetwork + "|" + TopologyDependency + "|" + TopologyTree)
	}
}
125081
func checkType(name string, kind reflect.Kind, v interface{}) error {
	actualKind := reflect.TypeOf(v).Kind()
	if actualKind != kind {
		return fmt.Errorf("parameter %q value is expected to be %v, got %v",
			name, kind.String(), actualKind.String())
	}
	return nil
}
171319
func (p *Profile) CheckValid() error {
	// Check that sample values are consistent
	sampleLen := len(p.SampleType)
	if sampleLen == 0 && len(p.Sample) != 0 {
		return fmt.Errorf("missing sample type information")
	}
	for _, s := range p.Sample {
		if len(s.Value) != sampleLen {
			return fmt.Errorf("mismatch: sample has: %d values vs. %d types", len(s.Value), len(p.SampleType))
		}
	}

	// Check that all mappings/locations/functions are in the tables
	// Check that there are no duplicate ids
	mappings := make(map[uint64]*Mapping, len(p.Mapping))
	for _, m := range p.Mapping {
		if m.ID == 0 {
			return fmt.Errorf("found mapping with reserved ID=0")
		}
		if mappings[m.ID] != nil {
			return fmt.Errorf("multiple mappings with same id: %d", m.ID)
		}
		mappings[m.ID] = m
	}
	functions := make(map[uint64]*Function, len(p.Function))
	for _, f := range p.Function {
		if f.ID == 0 {
			return fmt.Errorf("found function with reserved ID=0")
		}
		if functions[f.ID] != nil {
			return fmt.Errorf("multiple functions with same id: %d", f.ID)
		}
		functions[f.ID] = f
	}
	locations := make(map[uint64]*Location, len(p.Location))
	for _, l := range p.Location {
		if l.ID == 0 {
			return fmt.Errorf("found location with reserved id=0")
		}
		if locations[l.ID] != nil {
			return fmt.Errorf("multiple locations with same id: %d", l.ID)
		}
		locations[l.ID] = l
		if m := l.Mapping; m != nil {
			if m.ID == 0 || mappings[m.ID] != m {
				return fmt.Errorf("inconsistent mapping %p: %d", m, m.ID)
			}
		}
		for _, ln := range l.Line {
			if f := ln.Function; f != nil {
				if f.ID == 0 || functions[f.ID] != f {
					return fmt.Errorf("inconsistent function %p: %d", f, f.ID)
				}
			}
		}
	}
	return nil
}
1362769
func Check(err error, checker func(error) bool) bool {
	if annotated, ok := err.(*annotatedError); ok {
		return checker(annotated.LastError())
	}
	return checker(err)
}
823103
func (m *GormIdentityRepository) IsValid(ctx context.Context, id uuid.UUID) bool {
	return m.CheckExists(ctx, id) == nil
}
508670
func (c *txIDOptions) Check() error {
	if len(c.TxID) != 64 {
		return ErrInvalidTxID
	}
	if _, err := hex.DecodeString(c.TxID); err != nil {
		return ErrInvalidTxID
	}
	return nil
}
1319199
func CheckIfError(err error) {
	if err == nil {
		return
	}

	fmt.Printf("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf("error: %s", err))
	os.Exit(1)
}
981069
func (cfg *ScopeCfg) IsValid() bool {
	if cfg == nil ||
		strings.TrimSpace(cfg.Client.Provider) == "" ||
		strings.TrimSpace(cfg.Client.Address) == "" {
		return false
	}

	return true
}