// Set a new Application or update an existing one
961408
func (s *RedisApplicationStore) Set(new *Application, properties ...string) (err error) {
	now := time.Now()
	new.UpdatedAt = now
	if new.old == nil {
		new.CreatedAt = now
	}
	err = s.store.Set(new.AppID, *new, properties...)
	if err != nil {
		return
	}
	return nil
}
335462
func (api *APIBase) SetApplicationsConfig(args params.ApplicationConfigSetArgs) (params.ErrorResults, error) {
	var result params.ErrorResults
	if err := api.checkCanWrite(); err != nil {
		return result, errors.Trace(err)
	}
	if err := api.check.ChangeAllowed(); err != nil {
		return result, errors.Trace(err)
	}
	result.Results = make([]params.ErrorResult, len(args.Args))
	for i, arg := range args.Args {
		err := api.setApplicationConfig(arg)
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
799186
func (s *DeploymentApplicationConfig) SetApplication(v string) *DeploymentApplicationConfig {
	s.Application = &v
	return s
}
174960
func (s *UpdateSimulationApplicationInput) SetApplication(v string) *UpdateSimulationApplicationInput {
	s.Application = &v
	return s
}
375292
func (s *UpdateApplicationInput) SetApplicationUpdate(v *ApplicationUpdate) *UpdateApplicationInput {
	s.ApplicationUpdate = v
	return s
}
1080658
func (s *ClusterIamRole) SetApplyStatus(v string) *ClusterIamRole {
	s.ApplyStatus = &v
	return s
}
1002849
func (s *ApplicationUpdate) SetApplicationCodeUpdate(v string) *ApplicationUpdate {
	s.ApplicationCodeUpdate = &v
	return s
}
665166
func Set(c *client.Client, app string, config api.Config) (api.Config, error) {
	body, err := json.Marshal(config)

	if err != nil {
		return api.Config{}, err
	}

	u := fmt.Sprintf("/v1/apps/%s/config/", app)

	resBody, err := c.BasicRequest("POST", u, body)

	if err != nil {
		return api.Config{}, err
	}

	newConfig := api.Config{}
	if err = json.Unmarshal([]byte(resBody), &newConfig); err != nil {
		return api.Config{}, err
	}

	return newConfig, nil
}
835552
func (s *Parameter) SetApplyType(v string) *Parameter {
	s.ApplyType = &v
	return s
}
1252830
func (s *SimulationApplicationConfig) SetApplication(v string) *SimulationApplicationConfig {
	s.Application = &v
	return s
}
98685
func (s *GetDiscoverySummaryOutput) SetApplications(v int64) *GetDiscoverySummaryOutput {
	s.Applications = &v
	return s
}
446578
func (c *Client) SetApplicationConfig(branchName, application string, config map[string]string) error {
	if c.BestAPIVersion() < 6 {
		return errors.NotSupportedf("SetApplicationsConfig not supported by this version of Juju")
	}
	args := params.ApplicationConfigSetArgs{
		Args: []params.ApplicationConfigSet{{
			ApplicationName: application,
			Generation:      branchName,
			Config:          config,
		}},
	}
	var results params.ErrorResults
	err := c.facade.FacadeCall("SetApplicationsConfig", args, &results)
	if err != nil {
		return errors.Trace(err)
	}
	return results.OneError()
}
238288
func (s *DescribeRobotApplicationInput) SetApplicationVersion(v string) *DescribeRobotApplicationInput {
	s.ApplicationVersion = &v
	return s
}
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
}
353831
func (s *OptionSetting) SetApplyType(v string) *OptionSetting {
	s.ApplyType = &v
	return s
}
1207792
func (s *StatusAPI) SetApplicationStatus(args params.SetStatus) (params.ErrorResults, error) {
	return s.applicationSetter.SetStatus(args)
}
1115237
func (ac *AppClient) SetVersion(version string) error {
	if version == "" {
		return errors.New("omaha: empty application version")
	}

	ac.version = version
	return nil
}