// Update an existing app.
//
// appIdentity is the unique identifier of the App. options is the struct of
// optional parameters for this action.
6405
func (c *Client) AppUpdate(appIdentity string, options *AppUpdateOpts, message string) (*App, error) {
	rh := RequestHeaders{CommitMessage: message}
	var appRes App
	return &appRes, c.PatchWithHeaders(&appRes, "/apps/"+appIdentity, options, rh.Headers())
}
858980
func (r *AppRepo) Update(id string, data map[string]interface{}) (*App, error) {
	app, err := r.Get(id)
	if err != nil {
		return nil, err
	}

	return app, nil
}
536423
func (s *DeleteIdentityPolicyInput) SetIdentity(v string) *DeleteIdentityPolicyInput {
	s.Identity = &v
	return s
}
1309974
func (c *Client) AppFeatureInfo(appIdentity string, appFeatureIdentity string) (*AppFeature, error) {
	var appFeature AppFeature
	return &appFeature, c.Get(&appFeature, "/apps/"+appIdentity+"/features/"+appFeatureIdentity)
}
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
}
1076291
func setIdentityConfigWithOptionInterface(c *IdentityConfigOptions, o interface{}) error {
	s := &setter{}

	s.set(c.client, func() bool { _, ok := o.(client); return ok }, func() { c.client = o.(client) })
	s.set(c.caConfig, func() bool { _, ok := o.(caConfig); return ok }, func() { c.caConfig = o.(caConfig) })
	s.set(c.caServerCerts, func() bool { _, ok := o.(caServerCerts); return ok }, func() { c.caServerCerts = o.(caServerCerts) })
	s.set(c.caClientKey, func() bool { _, ok := o.(caClientKey); return ok }, func() { c.caClientKey = o.(caClientKey) })
	s.set(c.caClientCert, func() bool { _, ok := o.(caClientCert); return ok }, func() { c.caClientCert = o.(caClientCert) })
	s.set(c.caKeyStorePath, func() bool { _, ok := o.(caKeyStorePath); return ok }, func() { c.caKeyStorePath = o.(caKeyStorePath) })
	s.set(c.credentialStorePath, func() bool { _, ok := o.(credentialStorePath); return ok }, func() { c.credentialStorePath = o.(credentialStorePath) })

	if !s.isSet {
		return errors.Errorf("option %#v is not a sub interface of IdentityConfig, at least one of its functions must be implemented.", o)
	}
	return nil
}
362518
func (c *Client) FormationUpdate(appIdentity string, formationIdentity string, options *FormationUpdateOpts) (*Formation, error) {
	var formationRes Formation
	return &formationRes, c.Patch(&formationRes, "/apps/"+appIdentity+"/formation/"+formationIdentity, options)
}
624552
func (s *IdentityInfo) SetIdentityType(v string) *IdentityInfo {
	s.IdentityType = &v
	return s
}
772880
func (s *DecisionTaskStartedEventAttributes) SetIdentity(v string) *DecisionTaskStartedEventAttributes {
	s.Identity = &v
	return s
}
364046
func (r *ChannelService) Update(appId string, label string, channelrequest *ChannelRequest) *ChannelUpdateCall {
	c := &ChannelUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.appId = appId
	c.label = label
	c.channelrequest = channelrequest
	return c
}
428556
func (s *PutIdentityPolicyInput) SetIdentity(v string) *PutIdentityPolicyInput {
	s.Identity = &v
	return s
}
1257129
func (s *User) SetIdentityType(v string) *User {
	s.IdentityType = &v
	return s
}
130833
func (p *PUPolicy) AddIdentityTag(k, v string) {
	p.Lock()
	defer p.Unlock()

	p.identity.AppendKeyValue(k, v)
}
728054
func (s *SetIdentityNotificationTopicInput) SetIdentity(v string) *SetIdentityNotificationTopicInput {
	s.Identity = &v
	return s
}
962041
func (s *persistentStorage) Update(c context.Context, identity *ProjectIdentity) (*ProjectIdentity, error) {
	logging.Debugf(c, "update project scoped identity %v", identity)
	tmp, err := s.lookup(c, identity)
	switch {
	case err == nil && *tmp == *identity: // Doesn't need update
		return identity, nil
	case err != nil && err != ErrNotFound: // Lookup error to propagate
		return nil, err
	}

	if err := ds.Put(c, identity); err != nil {
		return nil, err
	}
	return identity, nil
}
88390
func (d *Daemon) UpdateIdentities(added, deleted cache.IdentityCache) {
	policy.UpdateIdentities(added, deleted)
	d.TriggerPolicyUpdates(true, "one or more identities created or deleted")
}
961829
func (c *Controller) updateApplication(ch ApplicationChange) {
	c.ensureModel(ch.ModelUUID).updateApplication(ch, c.manager)
}