// initializeDefaultProject creates the default project if it does not already exist
512164
func initializeDefaultProject(opts ArgoCDServerOpts) error {
	defaultProj := &v1alpha1.AppProject{
		ObjectMeta: metav1.ObjectMeta{Name: common.DefaultAppProjectName, Namespace: opts.Namespace},
		Spec: v1alpha1.AppProjectSpec{
			SourceRepos:              []string{"*"},
			Destinations:             []v1alpha1.ApplicationDestination{{Server: "*", Namespace: "*"}},
			ClusterResourceWhitelist: []metav1.GroupKind{{Group: "*", Kind: "*"}},
		},
	}

	_, err := opts.AppClientset.ArgoprojV1alpha1().AppProjects(opts.Namespace).Create(defaultProj)
	if apierrors.IsAlreadyExists(err) {
		return nil
	}
	return err
}
345204
func (s *ProjectsService) GetProject(ctx context.Context, id int64) (*Project, *Response, error) {
	u := fmt.Sprintf("projects/%v", id)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept headers when APIs fully launch.
	req.Header.Set("Accept", mediaTypeProjectsPreview)

	project := &Project{}
	resp, err := s.client.Do(ctx, req, project)
	if err != nil {
		return nil, resp, err
	}

	return project, resp, nil
}
288934
func (p *Project) defaults() {
	p.Memory = DefaultMemory
	p.Timeout = DefaultTimeout
	p.IgnoreFile = []byte(".apexignore\nfunction.json\n")

	if p.Concurrency == 0 {
		p.Concurrency = 5
	}

	if p.Config.Environment == nil {
		p.Config.Environment = make(map[string]string)
	}

	if p.NameTemplate == "" {
		p.NameTemplate = "{{.Project.Name}}_{{.Function.Name}}"
	}

	if p.RetainedVersions == nil {
		p.RetainedVersions = aws.Int(DefaultRetainedVersions)
	}
}
1263472
func NewProject(client client.APIClient) *Project {
	return &Project{
		project: &docker.Project{
			Client: client,
			Labels: docker.KermitLabels,
		},
	}
}
303084
func (c *FakeProjectRequests) Create(projectRequest *project.ProjectRequest) (result *project.Project, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(projectrequestsResource, projectRequest), &project.Project{})
	if obj == nil {
		return nil, err
	}
	return obj.(*project.Project), err
}
160168
func SetDefaults_InitConfiguration(obj *InitConfiguration) {
	SetDefaults_ClusterConfiguration(&obj.ClusterConfiguration)
	SetDefaults_BootstrapTokens(obj)
	SetDefaults_APIEndpoint(&obj.LocalAPIEndpoint)
}
1353498
func (s *RepositoriesService) CreateProject(ctx context.Context, owner, repo string, opt *ProjectOptions) (*Project, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/projects", owner, repo)
	req, err := s.client.NewRequest("POST", u, opt)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept headers when APIs fully launch.
	req.Header.Set("Accept", mediaTypeProjectsPreview)

	project := &Project{}
	resp, err := s.client.Do(ctx, req, project)
	if err != nil {
		return nil, resp, err
	}

	return project, resp, nil
}
1185673
func CaptureDefault() {
	log.SetFlags(flags)
	log.SetPrefix(prefix)
	r, w := io.Pipe()
	log.SetOutput(w)
	go redirect(r)
}
605402
func AddProject(project Project) error {
	o := orm.NewOrm()

	_, err := o.Insert(&project)

	return err
}
1261499
func CreateDefault(browser string) string {
	bn := strings.ToLower(browser)
	data := Database[bn]
	os := data.DefaultOS
	osAttribs := DefaultOSAttributes[os]

	return createFromDetails(
		browser,
		data.TopVersion,
		osAttribs.OSName,
		osAttribs.OSVersion,
		osAttribs.Comments)
}
423699
func (s *CreateProjectOutput) SetProject(v *Project) *CreateProjectOutput {
	s.Project = v
	return s
}
355250
func (s *RestoreDBInstanceFromS3Input) SetUseDefaultProcessorFeatures(v bool) *RestoreDBInstanceFromS3Input {
	s.UseDefaultProcessorFeatures = &v
	return s
}
364578
func (i *Import) GetTFVCProject() string {
	if i == nil || i.TFVCProject == nil {
		return ""
	}
	return *i.TFVCProject
}
103403
func NewProject(context *Context, runtime RuntimeProject, parseOptions *config.ParseOptions) *Project {
	p := &Project{
		context:        context,
		runtime:        runtime,
		ParseOptions:   parseOptions,
		ServiceConfigs: config.NewServiceConfigs(),
		VolumeConfigs:  make(map[string]*config.VolumeConfig),
		NetworkConfigs: make(map[string]*config.NetworkConfig),
	}

	if context.LoggerFactory == nil {
		context.LoggerFactory = &logger.NullLogger{}
	}

	if context.ResourceLookup == nil {
		context.ResourceLookup = &lookup.FileResourceLookup{}
	}

	if context.EnvironmentLookup == nil {
		var envPath, absPath, cwd string
		var err error
		if len(context.ComposeFiles) > 0 {
			absPath, err = filepath.Abs(context.ComposeFiles[0])
			dir, _ := path.Split(absPath)
			envPath = filepath.Join(dir, ".env")
		} else {
			cwd, err = os.Getwd()
			envPath = filepath.Join(cwd, ".env")
		}

		if err != nil {
			log.Errorf("Could not get the rooted path name to the current directory: %v", err)
			return nil
		}
		context.EnvironmentLookup = &lookup.ComposableEnvLookup{
			Lookups: []config.EnvironmentLookup{
				&lookup.EnvfileLookup{
					Path: envPath,
				},
				&lookup.OsEnvLookup{},
			},
		}
	}

	context.Project = p

	p.listeners = []chan<- events.Event{NewDefaultListener(p)}

	return p
}
23835
func newAppProjects(c *ArgoprojV1alpha1Client, namespace string) *appProjects {
	return &appProjects{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
741773
func (s *ProjectsService) CreateProject(projectName string, input *ProjectInput) (*ProjectInfo, *Response, error) {
	u := fmt.Sprintf("projects/%s/", url.QueryEscape(projectName))

	v := new(ProjectInfo)
	resp, err := s.client.Call("PUT", u, input, v)
	return v, resp, err
}
1025252
func (acl *ACL) SetFileDefault(path string) error {
	return acl.setFile(path, C.ACL_TYPE_DEFAULT)
}