// PutDeploymentStatus stores an allocation's DeploymentStatus or returns an
// error.
190974
func (s *BoltStateDB) PutDeploymentStatus(allocID string, ds *structs.AllocDeploymentStatus) error {
	return s.db.Update(func(tx *boltdd.Tx) error {
		return putDeploymentStatusImpl(tx, allocID, ds)
	})
}
370837
func (s *DescribeDeploymentsInput) SetDeploymentIds(v []*string) *DescribeDeploymentsInput {
	s.DeploymentIds = v
	return s
}
714035
func (ar *allocRunner) persistDeploymentStatus(ds *structs.AllocDeploymentStatus) {
	if err := ar.stateDB.PutDeploymentStatus(ar.id, ds); err != nil {
		// While any persistence errors are very bad, the worst case
		// scenario for failing to persist deployment status is that if
		// the agent is restarted it will monitor the deployment status
		// again. This could cause a deployment's status to change when
		// that shouldn't happen. However, allowing that seems better
		// than failing the entire allocation.
		ar.logger.Error("error storing deployment status", "error", err)
	}
}
627982
func (s *RDSInstanceDetails) SetDeploymentOption(v string) *RDSInstanceDetails {
	s.DeploymentOption = &v
	return s
}
559647
func (s *DescribeSuggestersInput) SetDeployed(v bool) *DescribeSuggestersInput {
	s.Deployed = &v
	return s
}
1212639
func (s *UpdateDeploymentOutput) SetDeploymentStatusMessage(v string) *UpdateDeploymentOutput {
	s.DeploymentStatusMessage = &v
	return s
}
1199640
func (s *Command) SetDeploymentId(v string) *Command {
	s.DeploymentId = &v
	return s
}
475755
func (s *DescribeExpressionsInput) SetDeployed(v bool) *DescribeExpressionsInput {
	s.Deployed = &v
	return s
}
365792
func (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opt *ListOptions) ([]*DeploymentStatus, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/deployments/%v/statuses", owner, repo, deployment)
	u, err := addOptions(u, opt)
	if err != nil {
		return nil, nil, err
	}

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

	var statuses []*DeploymentStatus
	resp, err := s.client.Do(ctx, req, &statuses)
	if err != nil {
		return nil, resp, err
	}

	return statuses, resp, nil
}
507945
func (s *BrokerSummary) SetDeploymentMode(v string) *BrokerSummary {
	s.DeploymentMode = &v
	return s
}
1011206
func (s *DeploymentInfo) SetAdditionalDeploymentStatusInfo(v string) *DeploymentInfo {
	s.AdditionalDeploymentStatusInfo = &v
	return s
}
286029
func (s *ListDeploymentsOutput) SetDeployments(v []*Deployment) *ListDeploymentsOutput {
	s.Deployments = v
	return s
}
1107661
func (s *GetDeploymentOutput) SetDeploymentStatus(v string) *GetDeploymentOutput {
	s.DeploymentStatus = &v
	return s
}
716603
func (d *PendingDeployment) UpdateStatus(status string) {
	d.mutex.Lock()
	defer d.mutex.Unlock()
	d.status.Set(status)
}
972694
func (s *StateStore) upsertDeploymentUpdates(index uint64, updates []*structs.DeploymentStatusUpdate, txn *memdb.Txn) error {
	for _, u := range updates {
		if err := s.updateDeploymentStatusImpl(index, u, txn); err != nil {
			return err
		}
	}

	return nil
}
1178491
func PutTaskStatus(tx *bolt.Tx, id string, status *api.TaskStatus) error {
	return withCreateTaskBucketIfNotExists(tx, id, func(bkt *bolt.Bucket) error {
		p, err := proto.Marshal(status)
		if err != nil {
			return err
		}
		return bkt.Put(bucketKeyStatus, p)
	})
}
519481
func (s *Fleet) SetLastDeploymentStatus(v string) *Fleet {
	s.LastDeploymentStatus = &v
	return s
}