// QueryIntervalByID provides a mock function with given fields: intervalId
497912
func (_m *SchedulerQueueClient) QueryIntervalByID(intervalId string) (models.Interval, error) {
	ret := _m.Called(intervalId)

	var r0 models.Interval
	if rf, ok := ret.Get(0).(func(string) models.Interval); ok {
		r0 = rf(intervalId)
	} else {
		r0 = ret.Get(0).(models.Interval)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(intervalId)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
184865
func (s *InternalLBService) GetInternalLoadBalancerElementByID(id string, opts ...OptionFunc) (*InternalLoadBalancerElement, int, error) {
	p := &ListInternalLoadBalancerElementsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListInternalLoadBalancerElements(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.InternalLoadBalancerElements[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for InternalLoadBalancerElement UUID: %s!", id)
}
846009
func (c *Client) IntervalActionById(id string) (action contract.IntervalAction, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	object, err := redis.Bytes(conn.Do("GET", id))
	if err == redis.ErrNil {
		return contract.IntervalAction{}, db.ErrNotFound
	} else if err != nil {
		return contract.IntervalAction{}, err
	}

	err = json.Unmarshal(object, &action)
	if err != nil {
		return contract.IntervalAction{}, err
	}

	return action, err
}
1338492
func (s *EventService) GetEventByID(id string, opts ...OptionFunc) (*Event, int, error) {
	p := &ListEventsParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListEvents(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.Events[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for Event UUID: %s!", id)
}
902951
func (_m *SchedulerQueueClient) QueryIntervalActionByName(intervalActionName string) (models.IntervalAction, error) {
	ret := _m.Called(intervalActionName)

	var r0 models.IntervalAction
	if rf, ok := ret.Get(0).(func(string) models.IntervalAction); ok {
		r0 = rf(intervalActionName)
	} else {
		r0 = ret.Get(0).(models.IntervalAction)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(intervalActionName)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1320492
func (session *Session) QueryInterface(sqlorArgs ...interface{}) ([]map[string]interface{}, error) {
	if session.isAutoClose {
		defer session.Close()
	}

	sqlStr, args, err := session.genQuerySQL(sqlorArgs...)
	if err != nil {
		return nil, err
	}

	rows, err := session.queryRows(sqlStr, args...)
	if err != nil {
		return nil, err
	}
	defer rows.Close()

	return rows2Interfaces(rows)
}
939700
func (a *DateHistogramAggregation) Interval(interval string) *DateHistogramAggregation {
	a.interval = interval
	return a
}
1061709
func (s *Thumbnails) SetInterval(v string) *Thumbnails {
	s.Interval = &v
	return s
}
685288
func (ot *orderedTree) Query(interval Interval) Entries {
	entries := NewEntries()

	ot.apply(ot.top, interval, 1, func(n *node) bool {
		entries = append(entries, n.entry)
		return true
	})

	return entries
}
932000
func (c *Client) UpdateInterval(from contract.Interval) (err error) {
	check, err := c.IntervalByName(from.Name)
	if err != nil && err != redis.ErrNil {
		return err
	}
	if err == nil && from.ID != check.ID {
		// IDs are different -> name not unique
		return db.ErrNotUnique
	}

	from.Timestamps.Modified = db.MakeTimestamp()
	err = mergo.Merge(&from, check)
	if err != nil {
		return err
	}

	interval := models.NewInterval(from)
	data, err := json.Marshal(interval)
	if err != nil {
		return err
	}

	conn := c.Pool.Get()
	defer conn.Close()

	_ = conn.Send("MULTI")
	deleteObject(interval, interval.ID, conn)
	addObject(data, interval, interval.ID, conn)
	_, err = conn.Do("EXEC")

	return err
}
1359715
func (p *PodHealthCheck) SetInterval(intervalSeconds int) *PodHealthCheck {
	p.IntervalSeconds = &intervalSeconds
	return p
}
184620
func (mc MongoClient) UpdateIntervalAction(action contract.IntervalAction) error {
	var mapped models.IntervalAction
	id, err := mapped.FromContract(action)
	if err != nil {
		return err
	}

	mapped.TimestampForUpdate()

	return mc.updateId(db.IntervalAction, id, mapped)
}
883167
func (s *server) HeartbeatInterval() time.Duration {
	s.mutex.RLock()
	defer s.mutex.RUnlock()
	return s.heartbeatInterval
}
724302
func (mc MongoClient) DeleteIntervalById(id string) error {
	return mc.deleteById(db.Interval, id)
}
865780
func mapIntervals(intervals []models.Interval, err error) ([]contract.Interval, error) {
	if err != nil {
		return []contract.Interval{}, err
	}
	mapped := make([]contract.Interval, 0)
	for _, interval := range intervals {
		mapped = append(mapped, interval.ToContract())
	}
	return mapped, nil
}
539704
func (mc MongoClient) IntervalActionByName(name string) (contract.IntervalAction, error) {
	s := mc.getSessionCopy()
	defer s.Close()

	query := bson.M{"name": name}

	mia := models.IntervalAction{}
	if err := s.DB(mc.database.Name).C(db.IntervalAction).Find(query).One(&mia); err != nil {
		return contract.IntervalAction{}, errorMap(err)
	}
	return mia.ToContract(), nil
}
490479
func (mc MongoClient) IntervalActions() ([]contract.IntervalAction, error) {
	return mapIntervalActions(mc.getIntervalActions(bson.M{}))
}