// UpdateCondition updates a specific condition.
179362
func (c *Client) UpdateCondition(i *UpdateConditionInput) (*Condition, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Version == 0 {
		return nil, ErrMissingVersion
	}

	if i.Name == "" {
		return nil, ErrMissingName
	}

	path := fmt.Sprintf("/service/%s/version/%d/condition/%s", i.Service, i.Version, url.PathEscape(i.Name))
	resp, err := c.PutForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var co *Condition
	if err := decodeJSON(&co, resp.Body); err != nil {
		return nil, err
	}
	return co, nil
}
280239
func (s *Condition) SetConditionType(v string) *Condition {
	s.ConditionType = &v
	return s
}
754167
func (s *IndicesRolloverService) AddCondition(name string, value interface{}) *IndicesRolloverService {
	s.conditions[name] = value
	return s
}
1222468
func (a *SetBreakpointArgs) SetCondition(condition string) *SetBreakpointArgs {
	a.Condition = &condition
	return a
}
891571
func (u *Unit) UpdateOperation(props UnitUpdateProperties) *UpdateUnitOperation {
	return &UpdateUnitOperation{
		unit:  &Unit{st: u.st, doc: u.doc, modelType: u.modelType},
		props: props,
	}
}
926750
func newUpdateStatement(table WritableTable) UpdateStatement {
	return &updateStatementImpl{
		table:        table,
		updateValues: make(map[NonAliasColumn]Expression),
		limit:        -1,
	}
}
326111
func (c WriteCondition) add(key []string, updater func(wc *writeCondition)) WriteCondition {
	if c.conditions == nil {
		c.conditions = make(map[string]writeCondition)
	}
	fullKey := createFullKey(key)
	wc := c.conditions[fullKey]
	updater(&wc)
	c.conditions[fullKey] = wc
	return c
}
834502
func filterOutCondition(conditions []apps.ReplicaSetCondition, condType apps.ReplicaSetConditionType) []apps.ReplicaSetCondition {
	var newConditions []apps.ReplicaSetCondition
	for _, c := range conditions {
		if c.Type == condType {
			continue
		}
		newConditions = append(newConditions, c)
	}
	return newConditions
}
29021
func (s *QueryInput) SetKeyConditions(v map[string]*Condition) *QueryInput {
	s.KeyConditions = v
	return s
}
1076974
func (s *ConditionCheck) SetConditionExpression(v string) *ConditionCheck {
	s.ConditionExpression = &v
	return s
}
1166355
func (p *ProtoCommand) PreCondition(state State) bool {
	if p.PreConditionFunc != nil {
		return p.PreConditionFunc(state)
	}
	return true
}
1228378
func SetDeploymentCondition(status *appsv1.DeploymentConfigStatus, condition appsv1.DeploymentCondition) {
	currentCond := GetDeploymentCondition(*status, condition.Type)
	if currentCond != nil && currentCond.Status == condition.Status && currentCond.Reason == condition.Reason {
		return
	}
	// Preserve lastTransitionTime if we are not switching between statuses of a condition.
	if currentCond != nil && currentCond.Status == condition.Status {
		condition.LastTransitionTime = currentCond.LastTransitionTime
	}

	newConditions := filterOutCondition(status.Conditions, condition.Type)
	status.Conditions = append(newConditions, condition)
}
884311
func (list *List) UpdateValue(value interface{}) error {
	// Valid types
	switch value.(type) {
	case []Value:
		list.values = value.([]Value)
	default:
		msg := fmt.Sprintf("Unsupported type, %s must be of type []Value", value)
		return errors.New(msg)
	}
	return nil
}
675700
func GetCondition(status v1.ReplicationControllerStatus, condType v1.ReplicationControllerConditionType) *v1.ReplicationControllerCondition {
	for i := range status.Conditions {
		c := status.Conditions[i]
		if c.Type == condType {
			return &c
		}
	}
	return nil
}
1212254
func SetCondition(status *v1.ReplicationControllerStatus, condition v1.ReplicationControllerCondition) {
	currentCond := GetCondition(*status, condition.Type)
	if currentCond != nil && currentCond.Status == condition.Status && currentCond.Reason == condition.Reason {
		return
	}
	newConditions := filterOutCondition(status.Conditions, condition.Type)
	status.Conditions = append(newConditions, condition)
}
1312330
func ValidateConditions(conds *Conditions) error {
	if conds.ExpectedAmount != nil {
		if *conds.ExpectedAmount > 0 && conds.MultiUse {
			return errors.Wrap(ErrInvalidDepositAddressOptions, "expected amount and multi use are mutually exclusive")
		}
	}
	return nil
}
99248
func (p *Parser) parseCondition() (Expr, error) {
	// Check if the WHERE token exists.
	if tok, _, _ := p.ScanIgnoreWhitespace(); tok != WHERE {
		p.Unscan()
		return nil, nil
	}

	// Scan the identifier for the source.
	expr, err := p.ParseExpr()
	if err != nil {
		return nil, err
	}

	return expr, nil
}