// Update Linode
977687
func (t *LinodeService) Update(linodeId int, args map[string]interface{}) (*LinodeResponse, error) {
	u := &url.Values{}

	u.Add("LinodeID", strconv.Itoa(linodeId))
	// add optional parameters
	for k, v := range args {
		u.Add(k, fmt.Sprintf("%v", v))
	}

	v := LinodeResponse{}
	if err := t.client.do("linode.update", u, &v.Response); err != nil {
		return nil, err
	}

	if err := json.Unmarshal(v.RawData, &v.LinodeId); err != nil {
		return nil, err
	}
	return &v, nil
}
326919
func (n *Network) Update(cmd NetworkUpdateCommand, section NetworkUpdateSection, parentIndex int, xml string, flags NetworkUpdateFlags) error {
	cxml := C.CString(xml)
	defer C.free(unsafe.Pointer(cxml))
	var err C.virError
	result := C.virNetworkUpdateWrapper(n.ptr, C.uint(cmd), C.uint(section), C.int(parentIndex), cxml, C.uint(flags), &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
2400
func (bu *Binutils) update(fn func(r *binrep)) {
	r := &binrep{}
	bu.mu.Lock()
	defer bu.mu.Unlock()
	if bu.rep == nil {
		initTools(r, "")
	} else {
		*r = *bu.rep
	}
	fn(r)
	bu.rep = r
}
914425
func (f *Function) Update(zip []byte) error {
	f.Log.Info("updating function")

	updated, err := f.Service.UpdateFunctionCode(&lambda.UpdateFunctionCodeInput{
		FunctionName: &f.FunctionName,
		Publish:      aws.Bool(true),
		ZipFile:      zip,
	})

	if err != nil {
		return err
	}

	if err := f.CreateOrUpdateAlias(f.Alias, *updated.Version); err != nil {
		return err
	}

	f.Log.WithFields(log.Fields{
		"version": *updated.Version,
		"name":    f.FunctionName,
	}).Info("function updated")

	return f.cleanup()
}
130221
func (i *VCSInstaller) Update() error {
	repo, err := vcs.NewRepo(i.Source, i.Path())
	if err != nil {
		return err
	}

	if repo.IsDirty() {
		return rig.ErrRepoDirty
	}
	if err := repo.Update(); err != nil {
		return err
	}
	if !isRig(repo.LocalPath()) {
		return rig.ErrDoesNotExist
	}
	return nil
}
107341
func (ln *LookupNonUnique) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, newValues []sqltypes.Value) error {
	return ln.lkp.Update(vcursor, oldValues, sqltypes.MakeTrusted(sqltypes.VarBinary, ksid), newValues)
}
239502
func Update(file string, v interface{}) error {
	b, err := ioutil.ReadFile(file)
	if err != nil {
		return err
	}

	out, err := Patch(b, v)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(file, out, 0644)
}
488314
func (c *FakeClusterRoleBindings) Update(clusterRoleBinding *v1alpha1.ClusterRoleBinding) (result *v1alpha1.ClusterRoleBinding, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &v1alpha1.ClusterRoleBinding{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.ClusterRoleBinding), err
}
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
}
1271979
func (r *Runc) Update(context context.Context, id string, resources *specs.LinuxResources) error {
	buf := getBuf()
	defer putBuf(buf)

	if err := json.NewEncoder(buf).Encode(resources); err != nil {
		return err
	}
	args := []string{"update", "--resources", "-", id}
	cmd := r.command(context, args...)
	cmd.Stdin = buf
	return r.runOrError(cmd)
}
924025
func (zs *Server) Update(ctx context.Context, filePath string, contents []byte, version topo.Version) (topo.Version, error) {
	zkPath := path.Join(zs.root, filePath)

	// Interpret the version
	var zkVersion int32
	if version != nil {
		zkVersion = int32(version.(ZKVersion))
	} else {
		zkVersion = -1
	}

	stat, err := zs.conn.Set(ctx, zkPath, contents, zkVersion)
	if zkVersion == -1 && err == zk.ErrNoNode {
		// In zookeeper, an unconditional set of a nonexisting
		// node will return ErrNoNode. In that case, we want
		// to Create.
		return zs.Create(ctx, filePath, contents)
	}
	if err != nil {
		return nil, convertError(err, zkPath)
	}
	return ZKVersion(stat.Version), nil
}
622978
func (c *nodes) Update(node *api.Node) (*api.Node, error) {
	result := &api.Node{}
	if len(node.ResourceVersion) == 0 {
		err := fmt.Errorf("invalid update object, missing resource version: %v", node)
		return nil, err
	}
	err := c.r.Put().Resource(c.resourceName()).Name(node.Name).Body(node).Do().Into(result)
	return result, err
}
428042
func (n *node) Update(data interface{}) error {
	return n.update(data, func(ref *reflect.Value, current *reflect.Value, cfg *structConfig) error {
		numfield := ref.NumField()
		for i := 0; i < numfield; i++ {
			f := ref.Field(i)
			if ref.Type().Field(i).PkgPath != "" {
				continue
			}
			zero := reflect.Zero(f.Type()).Interface()
			actual := f.Interface()
			if !reflect.DeepEqual(actual, zero) {
				cf := current.Field(i)
				cf.Set(f)
				idxInfo, ok := cfg.Fields[ref.Type().Field(i).Name]
				if ok {
					idxInfo.Value = &cf
				}
			}
		}
		return nil
	})
}
597744
func (pr *PullRequest) Update() error {
	_, err := x.Id(pr.ID).AllCols().Update(pr)
	return err
}
810786
func (s *userService) Update(id int64, user datamodels.User) (datamodels.User, error) {
	user.ID = id
	return s.repo.InsertOrUpdate(user)
}
172447
func (r *Reservoir) Update(v int64) {
	r.m.Lock()
	defer r.m.Unlock()
	s := atomic.AddInt64(&r.size, 1)
	if int(s) <= len(r.values) {
		// Not full
		r.values[s-1] = v
	} else {
		// Full
		l := rand.Int63n(s)
		if int(l) < len(r.values) {
			r.values[l] = v
		}
	}
}
644442
func (lh *LookupHash) Update(vcursor VCursor, oldValues []sqltypes.Value, ksid []byte, newValues []sqltypes.Value) error {
	v, err := vunhash(ksid)
	if err != nil {
		return fmt.Errorf("lookup.Update.vunhash: %v", err)
	}
	return lh.lkp.Update(vcursor, oldValues, sqltypes.NewUint64(v), newValues)
}