// ChangeStatus changes issue status to open or closed.
18465
func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (err error) {
	sess := x.NewSession()
	defer sess.Close()
	if err = sess.Begin(); err != nil {
		return err
	}

	if err = issue.changeStatus(sess, doer, repo, isClosed); err != nil {
		return err
	}

	if err = sess.Commit(); err != nil {
		return fmt.Errorf("Commit: %v", err)
	}

	if issue.IsPull {
		// Merge pull request calls issue.changeStatus so we need to handle separately.
		issue.PullRequest.Issue = issue
		apiPullRequest := &api.PullRequestPayload{
			Index:       issue.Index,
			PullRequest: issue.PullRequest.APIFormat(),
			Repository:  repo.APIFormat(nil),
			Sender:      doer.APIFormat(),
		}
		if isClosed {
			apiPullRequest.Action = api.HOOK_ISSUE_CLOSED
		} else {
			apiPullRequest.Action = api.HOOK_ISSUE_REOPENED
		}
		err = PrepareWebhooks(repo, HOOK_EVENT_PULL_REQUEST, apiPullRequest)
	} else {
		apiIssues := &api.IssuesPayload{
			Index:      issue.Index,
			Issue:      issue.APIFormat(),
			Repository: repo.APIFormat(nil),
			Sender:     doer.APIFormat(),
		}
		if isClosed {
			apiIssues.Action = api.HOOK_ISSUE_CLOSED
		} else {
			apiIssues.Action = api.HOOK_ISSUE_REOPENED
		}
		err = PrepareWebhooks(repo, HOOK_EVENT_ISSUES, apiIssues)
	}
	if err != nil {
		log.Error(2, "PrepareWebhooks [is_pull: %v, is_closed: %v]: %v", issue.IsPull, isClosed, err)
	}

	return nil
}
585119
func (s *ResourceShareAssociation) SetStatus(v string) *ResourceShareAssociation {
	s.Status = &v
	return s
}
455600
func (s *DocumentVersionMetadata) SetStatus(v string) *DocumentVersionMetadata {
	s.Status = &v
	return s
}
471638
func (s *SubmitContainerStateChangeInput) SetStatus(v string) *SubmitContainerStateChangeInput {
	s.Status = &v
	return s
}
369256
func (s *IndexFieldStatus) SetStatus(v *OptionStatus) *IndexFieldStatus {
	s.Status = v
	return s
}
846492
func (s *ChangeSetSummary) SetStatus(v string) *ChangeSetSummary {
	s.Status = &v
	return s
}
1229433
func (s *QueryInfo) SetStatus(v string) *QueryInfo {
	s.Status = &v
	return s
}
863576
func (s *ComplianceItem) SetStatus(v string) *ComplianceItem {
	s.Status = &v
	return s
}
1312376
func (s *UpdateCertificateAuthorityInput) SetStatus(v string) *UpdateCertificateAuthorityInput {
	s.Status = &v
	return s
}
634556
func (check *Check) UpdateStatus(status int, err error) {
	if err != nil {
		log.Debugf("Error executing check, status UNKNOWN: (id %s)", check.ID)
		check.Status = UNKNOWN
		check.LastError = err
	} else {
		check.Status = status
	}

	if status == HEALTHY {
		check.Count = 0
		return
	}

	check.Count = check.Count + 1

	if check.Count >= check.MaxCount {
		check.Status = FAILED
	}
}
72878
func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration {
	s.Status = &v
	return s
}
395100
func (s *EnvironmentDescription) SetStatus(v string) *EnvironmentDescription {
	s.Status = &v
	return s
}
520405
func (s *ObjectLockLegalHold) SetStatus(v string) *ObjectLockLegalHold {
	s.Status = &v
	return s
}
644733
func (s *DeviceInstance) SetStatus(v string) *DeviceInstance {
	s.Status = &v
	return s
}
948982
func (s *AppSummary) SetStatus(v string) *AppSummary {
	s.Status = &v
	return s
}
661909
func (s *CustomRule) SetStatus(v string) *CustomRule {
	s.Status = &v
	return s
}
10184
func (s *RecordDetail) SetStatus(v string) *RecordDetail {
	s.Status = &v
	return s
}