// SetApplicationStatus will set the given status to the application to which this
// unit's belong, only if this unit is the leader.
433671
func (ctx *HookContext) SetApplicationStatus(applicationStatus jujuc.StatusInfo) error {
	logger.Tracef("[APPLICATION-STATUS] %s: %s", applicationStatus.Status, applicationStatus.Info)
	isLeader, err := ctx.IsLeader()
	if err != nil {
		return errors.Annotatef(err, "cannot determine leadership")
	}
	if !isLeader {
		return ErrIsNotLeader
	}

	application, err := ctx.unit.Application()
	if err != nil {
		return errors.Trace(err)
	}
	return application.SetStatus(
		ctx.unit.Name(),
		status.Status(applicationStatus.Status),
		applicationStatus.Info,
		applicationStatus.Data,
	)
}
1151395
func (s *SMSChannelResponse) SetApplicationId(v string) *SMSChannelResponse {
	s.ApplicationId = &v
	return s
}
1080658
func (s *ClusterIamRole) SetApplyStatus(v string) *ClusterIamRole {
	s.ApplyStatus = &v
	return s
}
70554
func (s *DeleteRobotApplicationInput) SetApplication(v string) *DeleteRobotApplicationInput {
	s.Application = &v
	return s
}
1052574
func (s *GetMaintenanceWindowExecutionTaskInvocationOutput) SetStatus(v string) *GetMaintenanceWindowExecutionTaskInvocationOutput {
	s.Status = &v
	return s
}
1313904
func (s *CreateGroupMembershipOutput) SetStatus(v int64) *CreateGroupMembershipOutput {
	s.Status = &v
	return s
}
310490
func (s *TrustedAdvisorCheckRefreshStatus) SetStatus(v string) *TrustedAdvisorCheckRefreshStatus {
	s.Status = &v
	return s
}
1269516
func (s *GetImportJobsInput) SetApplicationId(v string) *GetImportJobsInput {
	s.ApplicationId = &v
	return s
}
845661
func (s *ApplicationInfo) SetApplicationId(v string) *ApplicationInfo {
	s.ApplicationId = &v
	return s
}
1278647
func (s *UpdateSegmentInput) SetApplicationId(v string) *UpdateSegmentInput {
	s.ApplicationId = &v
	return s
}
544860
func (s *ApplicationVersionDescription) SetStatus(v string) *ApplicationVersionDescription {
	s.Status = &v
	return s
}
990623
func (s *APNSVoipChannelResponse) SetApplicationId(v string) *APNSVoipChannelResponse {
	s.ApplicationId = &v
	return s
}
734292
func (s *UpdateApnsVoipSandboxChannelInput) SetApplicationId(v string) *UpdateApnsVoipSandboxChannelInput {
	s.ApplicationId = &v
	return s
}
837089
func (s *DescribeSimulationApplicationInput) SetApplication(v string) *DescribeSimulationApplicationInput {
	s.Application = &v
	return s
}
177900
func (s *ApplicationDescriptionMessage) SetApplication(v *ApplicationDescription) *ApplicationDescriptionMessage {
	s.Application = v
	return s
}
1369302
func (s *RemoteApplication) SetStatus(info status.StatusInfo) error {
	if !info.Status.KnownWorkloadStatus() {
		return errors.Errorf("cannot set invalid status %q", info.Status)
	}
	return setStatus(s.st.db(), setStatusParams{
		badge:     "remote application",
		globalKey: s.globalKey(),
		status:    info.Status,
		message:   info.Message,
		rawData:   info.Data,
		updated:   timeOrNow(info.Since, s.st.clock()),
	})
}
1103860
func (c *Client) SetOperatorStatus(appName string, status status.Status, message string, data map[string]interface{}) error {
	var result params.ErrorResults
	args := params.SetStatus{Entities: []params.EntityStatusArgs{
		{Tag: names.NewApplicationTag(appName).String(), Status: status.String(), Info: message, Data: data},
	}}
	err := c.facade.FacadeCall("SetOperatorStatus", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}