// GetBuildsWithProjectName gets project name in url and return the project object.
962029
func (c *ApiController) GetBuildsWithProjectName() {
	log.Info("Get builds with project name")

	projectName := c.GetString(":projectName")

	builds := models.GetBuildsWithProjectName(projectName)

	c.Data["json"] = builds
	c.ServeJson()
}
262446
func (o *Organization) GetProject(ctx context.Context, projectUUID string) (Project, Response, error) {
	path := fmt.Sprintf("/organizations/%s/projects/%s", o.UUID, projectUUID)

	body, resp, err := o.client.request(ctx, "GET", path, nil)
	if err != nil {
		return Project{}, resp, errors.Wrap(err, "unable to get project")
	}

	var project projectResponse
	if err = json.Unmarshal(body, &project); err != nil {
		return Project{}, resp, errors.Wrap(err, "unable to unmarshal response into Project")
	}

	return project.Project, resp, nil
}
313363
func GetProjectRoot() (string, error) {
	pwd, err := os.Getwd()
	if err != nil {
		return "", fmt.Errorf("Failed to find project root directory. %s\n", err.Error())
	}
	return findManifestInPath(pwd)
}
976939
func (s *UpdatePlacementInput) SetProjectName(v string) *UpdatePlacementInput {
	s.ProjectName = &v
	return s
}
991684
func (s *UpdateProjectInput) SetProjectName(v string) *UpdateProjectInput {
	s.ProjectName = &v
	return s
}
22354
func (p *ProjectColumn) GetName() string {
	if p == nil || p.Name == nil {
		return ""
	}
	return *p.Name
}
977028
func (s *ProjectService) GetProjectID(name string, opts ...OptionFunc) (string, int, error) {
	p := &ListProjectsParams{}
	p.p = make(map[string]interface{})

	p.p["name"] = name

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

	l, err := s.ListProjects(p)
	if err != nil {
		return "", -1, err
	}

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

	if l.Count == 1 {
		return l.Projects[0].Id, l.Count, nil
	}

	if l.Count > 1 {
		for _, v := range l.Projects {
			if v.Name == name {
				return v.Id, l.Count, nil
			}
		}
	}
	return "", l.Count, fmt.Errorf("Could not find an exact match for %s: %+v", name, l)
}
1179456
func (s *DisassociateDeviceFromPlacementInput) SetProjectName(v string) *DisassociateDeviceFromPlacementInput {
	s.ProjectName = &v
	return s
}
729136
func (actor Actor) GetBuildpackByNameAndStack(buildpackName string, buildpackStack string) (Buildpack, Warnings, error) {
	var (
		ccv3Buildpacks []ccv3.Buildpack
		warnings       ccv3.Warnings
		err            error
	)

	if buildpackStack == "" {
		ccv3Buildpacks, warnings, err = actor.CloudControllerClient.GetBuildpacks(ccv3.Query{
			Key:    ccv3.NameFilter,
			Values: []string{buildpackName},
		})
	} else {
		ccv3Buildpacks, warnings, err = actor.CloudControllerClient.GetBuildpacks(
			ccv3.Query{
				Key:    ccv3.NameFilter,
				Values: []string{buildpackName},
			},
			ccv3.Query{
				Key:    ccv3.StackFilter,
				Values: []string{buildpackStack},
			},
		)
	}

	if err != nil {
		return Buildpack{}, Warnings(warnings), err
	}

	if len(ccv3Buildpacks) == 0 {
		return Buildpack{}, Warnings(warnings), actionerror.BuildpackNotFoundError{BuildpackName: buildpackName, StackName: buildpackStack}
	}

	if len(ccv3Buildpacks) > 1 {
		for _, buildpack := range ccv3Buildpacks {
			if buildpack.Stack == "" {
				return Buildpack(buildpack), Warnings(warnings), nil
			}
		}
		return Buildpack{}, Warnings(warnings), actionerror.MultipleBuildpacksFoundError{BuildpackName: buildpackName}
	}

	return Buildpack(ccv3Buildpacks[0]), Warnings(warnings), err
}
1045975
func (s *AssociateDeviceWithPlacementInput) SetProjectName(v string) *AssociateDeviceWithPlacementInput {
	s.ProjectName = &v
	return s
}
672413
func (api *TenantsAPI) GetProjects(tenantId string, options *ProjectGetOptions) (result *ProjectList, err error) {
	uri := api.client.Endpoint + tenantUrl + "/" + tenantId + "/projects"
	if options != nil {
		uri += getQueryString(options)
	}
	res, err := api.client.restClient.GetList(api.client.Endpoint, uri, api.client.options.TokenOptions)
	if err != nil {
		return
	}

	result = &(ProjectList{})
	err = json.Unmarshal(res, result)
	return
}
732863
func (spec ApplicationSpec) GetProject() string {
	if spec.Project == "" {
		return common.DefaultAppProjectName
	}
	return spec.Project
}
914720
func (s *StartBuildInput) SetProjectName(v string) *StartBuildInput {
	s.ProjectName = &v
	return s
}
28195
func (s *PlacementSummary) SetProjectName(v string) *PlacementSummary {
	s.ProjectName = &v
	return s
}
621802
func GetBuildSystemConfigMapName(build *buildv1.Build) string {
	return apihelpers.GetConfigMapName(build.Name, sysConfigConfigMapSuffix)
}
1340901
func getBuildersForProject(c context.Context, project, console string) ([]string, error) {
	var cons []*common.Console

	// Get consoles for project and extract builders into set.
	projKey := datastore.MakeKey(c, "Project", project)
	if console == "" {
		q := datastore.NewQuery("Console").Ancestor(projKey)
		if err := datastore.GetAll(c, q, &cons); err != nil {
			return nil, errors.Annotate(
				err, "error getting consoles for project %s", project).Err()
		}
	} else {
		con := common.Console{Parent: projKey, ID: console}
		switch err := datastore.Get(c, &con); err {
		case nil:
		case datastore.ErrNoSuchEntity:
			return nil, errors.Annotate(
				err, "error getting console %s in project %s", console, project).
				Tag(grpcutil.NotFoundTag).Err()
		default:
			return nil, errors.Annotate(
				err, "error getting console %s in project %s", console, project).Err()
		}
		cons = append(cons, &con)
	}

	bSet := stringset.New(0)
	for _, con := range cons {
		for _, builder := range con.Builders {
			bSet.Add(builder)
		}
	}

	// Get sorted builders.
	builders := bSet.ToSlice()
	sort.Strings(builders)
	return builders, nil
}
583358
func (s *UpdateWebhookInput) SetProjectName(v string) *UpdateWebhookInput {
	s.ProjectName = &v
	return s
}