// ListPlannerItemTypes returns work item types that derives from PlannerItem type
977854
func (r *GormWorkItemTypeRepository) ListPlannerItemTypes(ctx context.Context, spaceTemplateID uuid.UUID) ([]WorkItemType, error) {
	defer goa.MeasureSince([]string{"goa", "db", "workitemtype", "listPlannerItemTypes"}, time.Now())

	// check space template exists
	if err := spacetemplate.NewRepository(r.db).CheckExists(ctx, spaceTemplateID); err != nil {
		return nil, errors.NewNotFoundError("space template", spaceTemplateID.String())
	}

	var wits []WorkItemType
	db := r.db.Select("id").Where("space_template_id = ? AND path::text LIKE '"+path.ConvertToLtree(SystemPlannerItem)+".%'", spaceTemplateID.String()).Order("created_at")
	if err := db.Find(&wits).Error; err != nil {
		log.Error(ctx, map[string]interface{}{
			"space_template_id": spaceTemplateID,
			"err":               err,
		}, "unable to list the work item types that derive off of planner item type")
		return nil, errs.WithStack(err)
	}
	for i, wit := range wits {
		childTypes, err := r.loadChildTypeList(ctx, wit.ID)
		if err != nil {
			return nil, errs.Wrapf(err, `failed to load child types for WIT "%s" (%s)`, wit.Name, wit.ID)
		}
		wits[i].ChildTypeIDs = childTypes
	}
	return wits, nil

}
855991
func ListIncrementOp(binName string, index int, value interface{}) *Operation {
	val := NewValue(value)
	switch val.(type) {
	case LongValue, IntegerValue, FloatValue:
	default:
		panic("Increment operation only accepts Integer or Float values")
	}
	return &Operation{opType: _CDT_MODIFY, binName: binName, binValue: ListValue{_CDT_LIST_INCREMENT, IntegerValue(index), NewValue(value)}, encoder: listGenericOpEncoder}
}
1285494
func (c *Client) ListWorkflowTypes(request ListWorkflowTypesRequest) (*ListWorkflowTypesResponse, error) {
	resp := &ListWorkflowTypesResponse{}
	err := c.swfReqWithResponse("ListWorkflowTypes", request, resp)
	return resp, err
}
1221816
func (w *Worker) ScheduleList() (schedules []ScheduleInfo, err error) {
	out := map[string][]ScheduleInfo{}
	err = w.schedules().Req("GET", nil, &out)
	if err != nil {
		return
	}
	return out["schedules"], nil
}
1256217
func (c *WorkItemLabelsController) List(ctx *app.ListWorkItemLabelsContext) error {
	err := application.Transactional(c.db, func(appl application.Application) error {
		wi, err := appl.WorkItems().LoadByID(ctx, ctx.WiID)
		if err != nil {
			return goa.ErrNotFound(err.Error())
		}
		labelIDs := wi.Fields[workitem.SystemLabels].([]interface{})
		ls := make([]label.Label, 0, len(labelIDs))
		for _, lbl := range labelIDs {
			lblStr := lbl.(string)
			id, err := uuid.FromString(lblStr)
			if err != nil {
				log.Error(nil, map[string]interface{}{
					"label_id": lblStr,
					"err":      err,
				}, "error in converting string to UUID")
				return goa.ErrNotFound(err.Error())
			}
			l, err := appl.Labels().Load(ctx, id)
			if err != nil {
				log.Error(nil, map[string]interface{}{
					"label_id": id,
					"err":      err,
				}, "error in loading label")
				return err
			}
			ls = append(ls, *l)
		}

		return ctx.ConditionalEntities(ls, c.config.GetCacheControlLabels, func() error {
			res := &app.LabelList{}
			res.Data = ConvertLabels(appl, ctx.Request, ls)
			res.Meta = &app.WorkItemListResponseMeta{
				TotalCount: len(res.Data),
			}
			return ctx.OK(res)
		})
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return nil
}
460506
func (c *WorkItemLinkTypesController) List(ctx *app.ListWorkItemLinkTypesContext) error {
	var modelLinkTypes []link.WorkItemLinkType
	err := application.Transactional(c.db, func(appl application.Application) error {
		var err error
		modelLinkTypes, err = appl.WorkItemLinkTypes().List(ctx.Context, ctx.SpaceTemplateID)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	return ctx.ConditionalEntities(modelLinkTypes, c.config.GetCacheControlWorkItemLinkTypes, func() error {
		// convert to rest representation
		appLinkTypes := app.WorkItemLinkTypeList{}
		appLinkTypes.Data = make([]*app.WorkItemLinkTypeData, len(modelLinkTypes))
		for index, modelLinkType := range modelLinkTypes {
			appLinkType := ConvertWorkItemLinkTypeFromModel(ctx.Request, modelLinkType)
			appLinkTypes.Data[index] = appLinkType.Data
		}
		// TODO: When adding pagination, this must not be len(rows) but
		// the overall total number of elements from all pages.
		appLinkTypes.Meta = &app.WorkItemLinkTypeListMeta{
			TotalCount: len(modelLinkTypes),
		}
		// Enrich
		HrefFunc := func(obj interface{}) string {
			return fmt.Sprintf(app.WorkItemLinkTypeHref("%s"), obj)
		}
		err := application.Transactional(c.db, func(appl application.Application) error {
			linkCtx := newWorkItemLinkContext(ctx.Context, ctx.Service, appl, c.db, ctx.Request, ctx.ResponseWriter, HrefFunc, nil)
			return enrichLinkTypeList(linkCtx, &appLinkTypes)
		})
		if err != nil {
			return errs.Wrap(err, "Failed to enrich link types")
		}
		return ctx.OK(&appLinkTypes)
	})
}
90337
func (p11w *Pkcs11Wrapper) ListObjects(template []*pkcs11.Attribute, max int) {

	// do an object search
	objects, _, err := p11w.FindObjects(template, max)

	if err != nil {
		fmt.Println("Could not find any objects:", err)
	} else {

		// prepare table headers
		table := tablewriter.NewWriter(os.Stdout)
		table.SetHeader([]string{"COUNT", "CKA_CLASS", "CKA_LABEL", "CKA_ID"})
		table.SetCaption(true, fmt.Sprintf("Total objects found (max %d): %d", max, len(objects)))

		// populate table data
		for i, k := range objects {
			al, err := p11w.Context.GetAttributeValue(
				p11w.Session,
				k,
				[]*pkcs11.Attribute{
					pkcs11.NewAttribute(pkcs11.CKA_LABEL, nil),
					pkcs11.NewAttribute(pkcs11.CKA_ID, nil),
					pkcs11.NewAttribute(pkcs11.CKA_CLASS, nil),
				},
			)

			if err != nil {
				panic(err)
			}
			table.Append(
				[]string{
					fmt.Sprintf("%03d", i+1),
					DecodeCKACLASS(al[2].Value[0]),
					fmt.Sprintf("%s", al[0].Value),
					fmt.Sprintf("%x", al[1].Value),
				},
			)
		}

		// render table
		table.Render()

	}
}
382333
func (mg *MailgunImpl) ListTemplates(opts *ListTemplateOptions) *TemplatesIterator {
	r := newHTTPRequest(generateApiUrl(mg, templatesEndpoint))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	if opts != nil {
		if opts.Limit != 0 {
			r.addParameter("limit", strconv.Itoa(opts.Limit))
		}
		if opts.Active {
			r.addParameter("active", "yes")
		}
	}
	url, err := r.generateUrlWithParameters()
	return &TemplatesIterator{
		mg:               mg,
		templateListResp: templateListResp{Paging: Paging{Next: url, First: url}},
		err:              err,
	}
}
819042
func (s *Service) SniEndpointList(ctx context.Context, appIdentity string, lr *ListRange) (SniEndpointListResult, error) {
	var sniEndpoint SniEndpointListResult
	return sniEndpoint, s.Get(ctx, &sniEndpoint, fmt.Sprintf("/apps/%v/sni-endpoints", appIdentity), nil, lr)
}
504468
func IsListType(obj runtime.Object) bool {
	_, err := GetItemsPtr(obj)
	return err == nil
}
1318496
func (b *BoltCreator) NewList(id string) (pinterface.IList, error) {
	return NewList(b.db, id)
}
24964
func (s *UsageService) NewListUsageTypesParams() *ListUsageTypesParams {
	p := &ListUsageTypesParams{}
	p.p = make(map[string]interface{})
	return p
}
349188
func (a *Account) ListComponents() ([]Component, error) {
	components := make([]Component, 0)
	err := a.get(a.auth, "/api/v2/components", &components)
	return components, err
}
1287727
func (c *Client) PlanList(addonServiceIdentity string, lr *ListRange) ([]Plan, error) {
	req, err := c.NewRequest("GET", "/addon-services/"+addonServiceIdentity+"/plans", nil, nil)
	if err != nil {
		return nil, err
	}

	if lr != nil {
		lr.SetHeader(req)
	}

	var plansRes []Plan
	return plansRes, c.DoReq(req, &plansRes)
}
625705
func (client *Client) ListTemplates(ctx context.Context, options *ListOptions) (list TemplateList, err error) {
	err = client.listRequest(ctx, "templates", options, &list)
	return list, err
}
676919
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&JobTemplate{},
		&CronJob{},
		&CronJobList{},
	)
	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}
799162
func (s *AutoScaleService) NewListConditionsParams() *ListConditionsParams {
	p := &ListConditionsParams{}
	p.p = make(map[string]interface{})
	return p
}