// newDeployments returns a Deployments
181027
func newDeployments(c *AppsV1beta1Client, namespace string) *deployments {
	return &deployments{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
1139791
func (j *Jobs) Deployments(jobID string, q *QueryOptions) ([]*Deployment, *QueryMeta, error) {
	var resp []*Deployment
	qm, err := j.client.query("/v1/job/"+jobID+"/deployments", &resp, q)
	if err != nil {
		return nil, nil, err
	}
	sort.Sort(DeploymentIndexSort(resp))
	return resp, qm, nil
}
173556
func (dm *PendingDeploymentMgr) NewPendingDeployment(deploymentID, templateID, poolID string) (*PendingDeployment, error) {
	dm.mutex.Lock()
	defer dm.mutex.Unlock()
	if _, ok := dm.deployments[deploymentID]; ok {
		return nil, ErrPendingDeploymentConflict
	}
	deployment := NewPendingDeployment(deploymentID, templateID, poolID)
	dm.deployments[deploymentID] = &deployment
	return &deployment, nil
}
680123
func (s *ListBulkDeploymentDetailedReportsOutput) SetDeployments(v []*BulkDeploymentResult) *ListBulkDeploymentDetailedReportsOutput {
	s.Deployments = v
	return s
}
600956
func (d *dataSet) ListDeploymentConfigs() ([]*appsv1.DeploymentConfig, error) {
	results := []*appsv1.DeploymentConfig{}
	for _, item := range d.deploymentConfigStore.List() {
		results = append(results, item.(*appsv1.DeploymentConfig))
	}
	return results, nil
}
644228
func (p *pruner) addDeploymentsToGraph(dmnts *kappsv1.DeploymentList) []error {
	var errs []error

	for i := range dmnts.Items {
		d := &dmnts.Items[i]
		ref := getRef(d)
		klog.V(4).Infof("Examining %s", getKindName(ref))
		dNode := kubegraph.EnsureDeploymentNode(p.g, d)
		errs = append(errs, p.addPodSpecToGraph(ref, &d.Spec.Template.Spec, dNode)...)
	}

	return errs
}
492461
func (s *StateStore) UpsertDeployment(index uint64, deployment *structs.Deployment) error {
	txn := s.db.Txn(true)
	defer txn.Abort()
	if err := s.upsertDeploymentImpl(index, deployment, txn); err != nil {
		return err
	}
	txn.Commit()
	return nil
}
349619
func NewPendingDeploymentMgr() *PendingDeploymentMgr {
	return &PendingDeploymentMgr{
		deployments: make(map[string]*PendingDeployment),
		mutex:       sync.RWMutex{},
	}
}
1040739
func (s *ListBulkDeploymentsOutput) SetBulkDeployments(v []*BulkDeployment) *ListBulkDeploymentsOutput {
	s.BulkDeployments = v
	return s
}
1215848
func (s *DescribeDeploymentJobOutput) SetDeploymentApplicationConfigs(v []*DeploymentApplicationConfig) *DescribeDeploymentJobOutput {
	s.DeploymentApplicationConfigs = v
	return s
}
1113680
func (s *DescribeAnalysisSchemesInput) SetDeployed(v bool) *DescribeAnalysisSchemesInput {
	s.Deployed = &v
	return s
}
727123
func NewDeployHandlerFromConfig(host, prefix string, cfg *Config) (*DeployHandler, error) {
	if cfg == nil {
		panic("NewDeployHandlerFromConfig: nil config")
	}
	if cfg.ClientID == "" {
		return nil, errors.New("oauth2 clientID required in config")
	}
	if cfg.ClientSecret == "" {
		return nil, errors.New("oauth2 clientSecret required in config")
	}
	os.Setenv("CAMLI_GCE_CLIENTID", cfg.ClientID)
	os.Setenv("CAMLI_GCE_CLIENTSECRET", cfg.ClientSecret)
	os.Setenv("CAMLI_GCE_PROJECT", cfg.Project)
	os.Setenv("CAMLI_GCE_SERVICE_ACCOUNT", cfg.ServiceAccount)
	os.Setenv("CAMLI_GCE_DATA", cfg.DataDir)
	return NewDeployHandler(host, prefix)
}
556419
func (s *Recipes) SetDeploy(v []*string) *Recipes {
	s.Deploy = v
	return s
}
19655
func (s *ListDeploymentJobsOutput) SetDeploymentJobs(v []*DeploymentJob) *ListDeploymentJobsOutput {
	s.DeploymentJobs = v
	return s
}
1349092
func (s *UpdateDeploymentGroupInput) SetDeploymentStyle(v *DeploymentStyle) *UpdateDeploymentGroupInput {
	s.DeploymentStyle = v
	return s
}
212944
func NewDeploymentsController(service *goa.Service, config *configuration.Registry) *DeploymentsController {
	return &DeploymentsController{
		Controller: service.NewController("DeploymentsController"),
		Config:     config,
		ClientGetter: &defaultClientGetter{
			config: config,
		},
	}
}
951918
func (h *Server) PostDeploys(w http.ResponseWriter, req *http.Request) error {
	ctx := req.Context()

	opts, err := newDeployOpts(w, req)
	if err != nil {
		return err
	}

	_, err = h.Deploy(ctx, *opts)

	// We only return the MessageRequiredError since all other errors are
	// written to the stream.
	switch err := err.(type) {
	case *empire.MessageRequiredError:
		return err
	}

	return nil
}