// RestageApplication restages the application with the given GUID.
551044
func (client *Client) RestageApplication(app Application) (Application, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.PostAppRestageRequest,
		URIParams:   Params{"app_guid": app.GUID},
	})
	if err != nil {
		return Application{}, nil, err
	}

	var restagedApp Application
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &restagedApp,
	}

	err = client.connection.Make(request, &response)
	return restagedApp, response.Warnings, err
}
809393
func (s *PutGatewayResponseInput) SetRestApiId(v string) *PutGatewayResponseInput {
	s.RestApiId = &v
	return s
}
643074
func (s *RunConfigurationUpdate) SetApplicationRestoreConfiguration(v *ApplicationRestoreConfiguration) *RunConfigurationUpdate {
	s.ApplicationRestoreConfiguration = v
	return s
}
110885
func (s *GetAuthorizersInput) SetRestApiId(v string) *GetAuthorizersInput {
	s.RestApiId = &v
	return s
}
742780
func (s *CreateAuthorizerInput) SetRestApiId(v string) *CreateAuthorizerInput {
	s.RestApiId = &v
	return s
}
1254394
func (a *Facade) UpdateApplicationsService(args params.UpdateApplicationServiceArgs) (params.ErrorResults, error) {
	result := params.ErrorResults{
		Results: make([]params.ErrorResult, len(args.Args)),
	}
	if len(args.Args) == 0 {
		return result, nil
	}
	for i, appUpdate := range args.Args {
		appTag, err := names.ParseApplicationTag(appUpdate.ApplicationTag)
		if err != nil {
			result.Results[i].Error = common.ServerError(err)
			continue
		}
		app, err := a.state.Application(appTag.Id())
		if err != nil {
			result.Results[i].Error = common.ServerError(err)
			continue
		}
		if err := app.UpdateCloudService(appUpdate.ProviderId, params.NetworkAddresses(appUpdate.Addresses...)); err != nil {
			result.Results[i].Error = common.ServerError(err)
		}
	}
	return result, nil
}
713912
func (client *Client) DeleteApplication(appGUID string) (JobURL, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.DeleteApplicationRequest,
		URIParams:   internal.Params{"app_guid": appGUID},
	})
	if err != nil {
		return "", nil, err
	}

	response := cloudcontroller.Response{}
	err = client.connection.Make(request, &response)

	return JobURL(response.ResourceLocationURL), response.Warnings, err
}
734342
func (client *Client) CreateApplication(app Application) (Application, Warnings, error) {
	body, err := json.Marshal(app)
	if err != nil {
		return Application{}, nil, err
	}

	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.PostAppRequest,
		Body:        bytes.NewReader(body),
	})
	if err != nil {
		return Application{}, nil, err
	}

	var updatedApp Application
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &updatedApp,
	}

	err = client.connection.Make(request, &response)
	return updatedApp, response.Warnings, err
}
66558
func (c *Controller) removeApplication(ch RemoveApplication) error {
	return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeApplication(ch) }))
}
935988
func (s *GetExportInput) SetRestApiId(v string) *GetExportInput {
	s.RestApiId = &v
	return s
}
1294535
func (s *TestInvokeMethodInput) SetRestApiId(v string) *TestInvokeMethodInput {
	s.RestApiId = &v
	return s
}
804202
func (s *GetStageInput) SetRestApiId(v string) *GetStageInput {
	s.RestApiId = &v
	return s
}
1004271
func (s *GetIntegrationInput) SetRestApiId(v string) *GetIntegrationInput {
	s.RestApiId = &v
	return s
}
1219418
func (s *UpdateGatewayResponseInput) SetRestApiId(v string) *UpdateGatewayResponseInput {
	s.RestApiId = &v
	return s
}
393515
func (s *DeleteMethodResponseInput) SetRestApiId(v string) *DeleteMethodResponseInput {
	s.RestApiId = &v
	return s
}
1293914
func (client *Client) UpdateApplication(app Application) (Application, Warnings, error) {
	body, err := json.Marshal(app)
	if err != nil {
		return Application{}, nil, err
	}

	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.PutAppRequest,
		URIParams:   Params{"app_guid": app.GUID},
		Body:        bytes.NewReader(body),
	})
	if err != nil {
		return Application{}, nil, err
	}

	var updatedApp Application
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &updatedApp,
	}

	err = client.connection.Make(request, &response)
	return updatedApp, response.Warnings, err
}
100664
func (s *GetModelsInput) SetRestApiId(v string) *GetModelsInput {
	s.RestApiId = &v
	return s
}