// UpdateItem updates the queryItem with the parameters from updateItem
480098
func UpdateItem(queryItem Item, updateItem Item) error {
	cfDict, err := ConvertMapToCFDictionary(queryItem.attr)
	if err != nil {
		return err
	}
	defer Release(C.CFTypeRef(cfDict))
	cfDictUpdate, err := ConvertMapToCFDictionary(updateItem.attr)
	if err != nil {
		return err
	}
	defer Release(C.CFTypeRef(cfDictUpdate))
	errCode := C.SecItemUpdate(cfDict, cfDictUpdate)
	err = checkError(errCode)
	return err
}
595071
func (node *ClientNode) updateParams(params ServerParams, now mclock.AbsTime) {
	diff := params.BufLimit - node.params.BufLimit
	if int64(diff) > 0 {
		node.bufValue += diff
	} else if node.bufValue > params.BufLimit {
		node.bufValue = params.BufLimit
	}
	node.cm.updateParams(node, params, now)
}
449940
func (m *Memory) Update(ctx context.Context, i backend.Item) (*backend.Lease, error) {
	if len(i.Key) == 0 {
		return nil, trace.BadParameter("missing parameter key")
	}
	m.Lock()
	defer m.Unlock()
	m.removeExpired()
	if m.tree.Get(&btreeItem{Item: i}) == nil {
		return nil, trace.NotFound("key %q is not found", string(i.Key))
	}
	if !m.Mirror {
		i.ID = m.generateID()
	}
	event := backend.Event{
		Type: backend.OpPut,
		Item: i,
	}
	m.processEvent(event)
	if !m.EventsOff {
		m.buf.Push(event)
	}
	return m.newLease(i), nil
}
1239167
func (self *InvoiceItemClient) Update(id string, params *InvoiceItemParams) (*InvoiceItem, error) {
	item := InvoiceItem{}
	values := url.Values{}

	if len(params.Desc) != 0 {
		values.Add("description", params.Desc)
	}
	if params.Amount != 0 {
		values.Add("invoice", strconv.FormatInt(params.Amount, 10))
	}

	err := query("POST", "/v1/invoiceitems/"+url.QueryEscape(id), values, &item)
	return &item, err
}
1085161
func (s *GetDocumentationVersionsOutput) SetItems(v []*DocumentationVersion) *GetDocumentationVersionsOutput {
	s.Items = v
	return s
}
245001
func AddItem(item Item) error {
	cfDict, err := ConvertMapToCFDictionary(item.attr)
	if err != nil {
		return err
	}
	defer Release(C.CFTypeRef(cfDict))

	errCode := C.SecItemAdd(cfDict, nil)
	err = checkError(errCode)
	return err
}
327439
func (menu *Menu) AddItem(commandID uint, label string) {
	command := Command{
		Method: "add_item",
		Args: CommandArguments{
			CommandID: commandID,
			Label:     label,
		},
	}
	menuItem := MenuItem{
		CommandID: commandID,
		Label:     label,
		Parent:    menu,
		Type:      "item",
	}
	menu.Items = append(menu.Items, &menuItem)

	menu.CallWhenReady(&command)
}
94013
func (s *QueryStringCacheKeys) SetItems(v []*string) *QueryStringCacheKeys {
	s.Items = v
	return s
}
348565
func (p *itemPool) newItem() (*Item, error) {
	if len(p.itemMap) >= p.capacity {
		return nil, ErrItemUnavailable
	}
	i, err := p.itemFactory()
	if err != nil {
		return nil, err
	}

	pItem := &Item{id: p.nextID(), Item: i}
	p.itemMap[pItem.id] = pItem
	return pItem, nil
}
831878
func (s *ActivitiesResponse) SetItem(v []*ActivityResponse) *ActivitiesResponse {
	s.Item = v
	return s
}
512348
func (s *ImportJobsResponse) SetItem(v []*ImportJobResponse) *ImportJobsResponse {
	s.Item = v
	return s
}
195959
func (client *CMSClient) UpdateAlarm(args *UpdateAlarmArgs) error {
	response := &UpdateAlarmResponse{}
	err := client.Invoke("UpdateAlarm", args, response)

	return err
}
680441
func (s *GetGatewayResponsesOutput) SetItems(v []*UpdateGatewayResponseOutput) *GetGatewayResponsesOutput {
	s.Items = v
	return s
}
834204
func (s *StoragePacker) PutItem(_ context.Context, item *Item) error {
	if item == nil {
		return fmt.Errorf("nil item")
	}

	if item.ID == "" {
		return fmt.Errorf("missing ID in item")
	}

	var err error
	bucketKey := s.BucketKey(item.ID)
	bucketPath := s.BucketPath(bucketKey)

	bucket := &Bucket{
		Key: bucketPath,
	}

	// In this case, we persist the storage entry regardless of the read
	// storageEntry below is nil or not. Hence, directly acquire write lock
	// even to read the entry.
	lock := locksutil.LockForKey(s.storageLocks, bucketPath)
	lock.Lock()
	defer lock.Unlock()

	// Check if there is an existing bucket for a given key
	storageEntry, err := s.view.Get(context.Background(), bucketPath)
	if err != nil {
		return errwrap.Wrapf("failed to read packed storage bucket entry: {{err}}", err)
	}

	if storageEntry == nil {
		// If the bucket entry does not exist, this will be the only item the
		// bucket that is going to be persisted.
		bucket.Items = []*Item{
			item,
		}
	} else {
		uncompressedData, notCompressed, err := compressutil.Decompress(storageEntry.Value)
		if err != nil {
			return errwrap.Wrapf("failed to decompress packed storage entry: {{err}}", err)
		}
		if notCompressed {
			uncompressedData = storageEntry.Value
		}

		err = proto.Unmarshal(uncompressedData, bucket)
		if err != nil {
			return errwrap.Wrapf("failed to decode packed storage entry: {{err}}", err)
		}

		err = bucket.upsert(item)
		if err != nil {
			return errwrap.Wrapf("failed to update entry in packed storage entry: {{err}}", err)
		}
	}

	// Persist the result
	return s.PutBucket(bucket)
}
1047603
func (s *DynamoDBv2Action) SetPutItem(v *PutItemInput) *DynamoDBv2Action {
	s.PutItem = v
	return s
}
909346
func (api *APIBase) updateCharm(
	params setCharmParams,
	url string,
) error {
	curl, err := charm.ParseURL(url)
	if err != nil {
		return errors.Trace(err)
	}
	charm, err := api.backend.Charm(curl)
	if err != nil {
		return errors.Trace(err)
	}
	return api.applicationSetCharm(params, charm)
}
702382
func (s *StatusCodes) SetItems(v []*int64) *StatusCodes {
	s.Items = v
	return s
}