// List all jobs. If jobId is greater than 0, limit the list to given jobId.
170077
func (t *LinodeJobService) List(linodeId int, jobId int, pendingOnly bool) (*LinodesJobListResponse, error) {
	u := &url.Values{}
	u.Add("LinodeID", strconv.Itoa(linodeId))
	if pendingOnly {
		u.Add("pendingOnly", "1")
	}
	if jobId > 0 {
		u.Add("JobID", strconv.Itoa(jobId))
	}
	v := LinodesJobListResponse{}
	if err := t.client.do("linode.job.list", u, &v.Response); err != nil {
		return nil, err
	}

	v.Jobs = make([]Job, 5)
	if err := json.Unmarshal(v.RawData, &v.Jobs); err != nil {
		return nil, err
	}
	return &v, nil
}
176971
func (db *RedisDB) List(k string) ([]string, error) {
	db.master.Lock()
	defer db.master.Unlock()

	if !db.exists(k) {
		return nil, ErrKeyNotFound
	}
	if db.t(k) != "list" {
		return nil, ErrWrongType
	}
	return db.listKeys[k], nil
}
479543
func (r *GormWorkItemRepository) List(ctx context.Context, spaceID uuid.UUID, criteria criteria.Expression, parentExists *bool, start *int, limit *int, sort SortWorkItemsBy) ([]WorkItem, int, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitem", "list"}, time.Now())
	result, count, err := r.listItemsFromDB(ctx, spaceID, criteria, parentExists, start, limit, sort)
	if err != nil {
		return nil, 0, errs.WithStack(err)
	}
	res := make([]WorkItem, len(result))
	for index, value := range result {
		wiType, err := r.witr.Load(ctx, value.Type)
		if err != nil {
			return nil, 0, errors.NewInternalError(ctx, err)
		}
		modelWI, err := ConvertWorkItemStorageToModel(wiType, &value)
		if err != nil {
			return nil, 0, errors.NewInternalError(ctx, err)
		}
		res[index] = *modelWI
	}
	return res, count, nil
}
152231
func (t *Transferer) List(project string, statuses ...Status) ([]*storagetransfer.TransferJob, error) {
	var jobs []*storagetransfer.TransferJob
	var token string

	body, err := json.Marshal(struct {
		ProjectID   string   `json:"project_id"`
		JobStatuses []Status `json:"job_statuses,omitempty"`
	}{
		ProjectID:   project,
		JobStatuses: statuses,
	})

	if err != nil {
		return nil, err
	}

	for {
		call := t.svc.List().Filter(string(body))
		if token != "" {
			call = call.PageToken(token)
		}

		resp, err := call.Do()
		if err != nil {
			return nil, err
		}

		for _, job := range resp.TransferJobs {
			jobs = append(jobs, job)
		}

		token = resp.NextPageToken
		if token == "" {
			break
		}
	}
	return jobs, nil
}
792061
func (j *Jenkins) GetAllJobs() ([]*Job, error) {
	exec := Executor{Raw: new(ExecutorResponse), Jenkins: j}
	_, err := j.Requester.GetJSON("/", exec.Raw, nil)

	if err != nil {
		return nil, err
	}

	jobs := make([]*Job, len(exec.Raw.Jobs))
	for i, job := range exec.Raw.Jobs {
		ji, err := j.GetJob(job.Name)
		if err != nil {
			return nil, err
		}
		jobs[i] = ji
	}
	return jobs, nil
}
405169
func (by By) Sort(jobs []*Job) {
	js := &jobSorter{
		jobs: jobs,
		by:   by, // The Sort method's receiver is the function (closure) that defines the sort order.
	}
	sort.Sort(js)
}
1335507
func (r *TasksService) List() *TasksListCall {
	c := &TasksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	return c
}
1281772
func sortJobs(c context.Context, jobs []*engine.Job) sortedJobs {
	out := make(sortedJobs, len(jobs))
	for i, job := range jobs {
		out[i] = makeJob(c, job, nil)
	}
	sort.Sort(out)
	return out
}
845318
func (js *JobsService) ListFromBuild(buildId uint) ([]Job, *http.Response, error) {
	u, err := urlWithOptions(fmt.Sprintf("/builds/%d", buildId), nil)
	if err != nil {
		return nil, nil, err
	}

	req, err := js.client.NewRequest("GET", u, nil, nil)
	if err != nil {
		return nil, nil, err
	}

	var buildResp getBuildResponse
	resp, err := js.client.Do(req, &buildResp)
	if err != nil {
		return nil, resp, err
	}

	return buildResp.Jobs, resp, err
}
15205
func (self *Operation) List() ([]*OperationInfo, error) {
	var res []interface{}
	// params := Params{Params: []interface{}{self.Key}}
	params := []interface{}{self.Key}
	if err := self.Call("operation.list", params, &res); err != nil {
		return nil, err
	}

	operations := make([]*OperationInfo, len(res), len(res))
	for i, r := range res {
		operations[i] = ToOperationInfo(r.(map[string]interface{}))
	}
	return operations, nil
}
549348
func (s *AsyncjobService) ListAsyncJobs(p *ListAsyncJobsParams) (*ListAsyncJobsResponse, error) {
	resp, err := s.cs.newRequest("listAsyncJobs", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r ListAsyncJobsResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
688173
func (ListAsyncJobs) Each(resp interface{}, callback IterateItemFunc) {
	items, ok := resp.(*ListAsyncJobsResponse)
	if !ok {
		callback(nil, fmt.Errorf("wrong type, ListAsyncJobsResponse was expected, got %T", resp))
		return
	}

	for i := range items.AsyncJob {
		if !callback(&items.AsyncJob[i], nil) {
			break
		}
	}
}
228692
func (status Status) JobIds() ([]string, error) {
	conn := redisPool.Get()
	defer conn.Close()
	return redis.Strings(conn.Do("ZREVRANGE", status.Key(), 0, -1))
}
439307
func (m *Meta) GetAllDDLJobsInQueue(jobListKeys ...JobListKeyType) ([]*model.Job, error) {
	listKey := m.jobListKey
	if len(jobListKeys) != 0 {
		listKey = jobListKeys[0]
	}

	values, err := m.txn.LGetAll(listKey)
	if err != nil || values == nil {
		return nil, errors.Trace(err)
	}

	jobs := make([]*model.Job, 0, len(values))
	for _, val := range values {
		job := &model.Job{}
		err = job.Decode(val)
		if err != nil {
			return nil, errors.Trace(err)
		}
		jobs = append(jobs, job)
	}

	return jobs, nil
}
588562
func (s *RedisApplicationStore) List(opts *storage.ListOptions) ([]*Application, error) {
	applicationsI, err := s.store.List("", opts)
	if err != nil {
		return nil, err
	}
	applications := make([]*Application, len(applicationsI))
	for i, applicationI := range applicationsI {
		if application, ok := applicationI.(Application); ok {
			applications[i] = &application
		}
	}
	return applications, nil
}
493376
func (v *version) Jobs() JobInformer {
	return &jobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
1288485
func (c *Controller) List(filterStrings ...string) ([]Worker, error) {
	filter, err := filters.ParseAll(filterStrings...)
	if err != nil {
		return nil, err
	}
	var workers []Worker
	c.workers.Range(func(k, v interface{}) bool {
		w := v.(Worker)
		if filter.Match(adaptWorker(w)) {
			workers = append(workers, w)
		}
		return true
	})
	return workers, nil
}