// ApplyApplicationManifest reads in the manifest from the path and provides it
// to the cloud controller.
430314
func (actor Actor) ApplyApplicationManifest(parser ManifestParser, spaceGUID string) (Warnings, error) {
	var allWarnings Warnings

	for _, appName := range parser.AppNames() {
		rawManifest, err := parser.RawAppManifest(appName)
		if err != nil {
			return allWarnings, err
		}

		app, getAppWarnings, err := actor.GetApplicationByNameAndSpace(appName, spaceGUID)

		allWarnings = append(allWarnings, getAppWarnings...)
		if err != nil {
			return allWarnings, err
		}

		jobURL, applyManifestWarnings, err := actor.CloudControllerClient.UpdateApplicationApplyManifest(app.GUID, rawManifest)
		allWarnings = append(allWarnings, applyManifestWarnings...)
		if err != nil {
			return allWarnings, err
		}

		pollWarnings, err := actor.CloudControllerClient.PollJob(jobURL)
		allWarnings = append(allWarnings, pollWarnings...)
		if err != nil {
			if newErr, ok := err.(ccerror.V3JobFailedError); ok {
				return allWarnings, actionerror.ApplicationManifestError{Message: newErr.Detail}
			}
			return allWarnings, err
		}
	}

	return allWarnings, nil
}
266719
func (s *DescribeRobotApplicationInput) SetApplication(v string) *DescribeRobotApplicationInput {
	s.Application = &v
	return s
}
371935
func UpdateManifest(m Manifests, root string, paths []string, id flux.ResourceID, f func(manifest []byte) ([]byte, error)) error {
	resources, err := m.LoadManifests(root, paths)
	if err != nil {
		return err
	}

	resource, ok := resources[id.String()]
	if !ok {
		return ErrResourceNotFound(id.String())
	}

	path := filepath.Join(root, resource.Source())
	def, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}

	newDef, err := f(def)
	if err != nil {
		return err
	}

	fi, err := os.Stat(path)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(path, newDef, fi.Mode())
}
1144050
func (s *CmafGroupSettings) SetManifestCompression(v string) *CmafGroupSettings {
	s.ManifestCompression = &v
	return s
}
1269404
func (actor Actor) UpdateApplication(app Application) (Application, Warnings, error) {
	ccApp := ccv3.Application{
		GUID:                app.GUID,
		StackName:           app.StackName,
		LifecycleType:       app.LifecycleType,
		LifecycleBuildpacks: app.LifecycleBuildpacks,
	}

	updatedApp, warnings, err := actor.CloudControllerClient.UpdateApplication(ccApp)
	if err != nil {
		return Application{}, Warnings(warnings), err
	}

	return actor.convertCCToActorApplication(updatedApp), Warnings(warnings), nil
}
890059
func (api *Client) GetApplication(id string) (*Application, error) {
	result, _, err := api.makeRequest(http.MethodGet, fmt.Sprintf("%s/%s", api.concatUserPath(applicationsPath), id), &Application{})
	if err != nil {
		return nil, err
	}
	return result.(*Application), nil
}
185319
func (s *APNSSandboxChannelResponse) SetApplicationId(v string) *APNSSandboxChannelResponse {
	s.ApplicationId = &v
	return s
}
678175
func (s *ChannelResponse) SetApplicationId(v string) *ChannelResponse {
	s.ApplicationId = &v
	return s
}
298205
func (s *CreateJobInput) SetManifest(v *JobManifest) *CreateJobInput {
	s.Manifest = v
	return s
}
899874
func (s *GetApnsVoipSandboxChannelInput) SetApplicationId(v string) *GetApnsVoipSandboxChannelInput {
	s.ApplicationId = &v
	return s
}
837089
func (s *DescribeSimulationApplicationInput) SetApplication(v string) *DescribeSimulationApplicationInput {
	s.Application = &v
	return s
}
324346
func (s *Version) SetApplicationId(v string) *Version {
	s.ApplicationId = &v
	return s
}
661159
func applyAppArmorInfo(info *SysInfo, _ map[string]string) []string {
	var warnings []string
	if _, err := os.Stat("/sys/kernel/security/apparmor"); !os.IsNotExist(err) {
		if _, err := ioutil.ReadFile("/sys/kernel/security/apparmor/profiles"); err == nil {
			info.AppArmor = true
		}
	}
	return warnings
}
113007
func (s *GetGcmChannelInput) SetApplicationId(v string) *GetGcmChannelInput {
	s.ApplicationId = &v
	return s
}
81541
func (r *marathonClient) UpdateApplication(application *Application, force bool) (*DeploymentID, error) {
	result := new(DeploymentID)
	path := buildPathWithForceParam(application.ID, force)
	if err := r.apiPut(path, application, result); err != nil {
		return nil, err
	}
	return result, nil
}
259172
func (s *GetCloudFormationTemplateInput) SetApplicationId(v string) *GetCloudFormationTemplateInput {
	s.ApplicationId = &v
	return s
}
530080
func ImageManifestPath(root string, appName types.ACName) string {
	return filepath.Join(AppPath(root, appName), aci.ManifestFile)
}