// PutInternal is used to insert or update an entry
483150
func (m *CouchDBBackend) PutInternal(ctx context.Context, entry *physical.Entry) error {
	defer metrics.MeasureSince([]string{"couchdb", "put"}, time.Now())

	revision, _ := m.client.rev(url.PathEscape(entry.Key))

	return m.client.put(couchDBEntry{
		Entry: entry,
		Rev:   revision,
		ID:    url.PathEscape(entry.Key),
	})
}
937480
func (s *ImportJobRequest) SetExternalId(v string) *ImportJobRequest {
	s.ExternalId = &v
	return s
}
382294
func (r *Client) UpdateActualOrgUser(user UserRole, uid uint) (StatusMessage, error) {
	var (
		raw  []byte
		resp StatusMessage
		err  error
	)
	if raw, err = json.Marshal(user); err != nil {
		return StatusMessage{}, err
	}
	if raw, _, err = r.post(fmt.Sprintf("api/org/users/%s", uid), nil, raw); err != nil {
		return StatusMessage{}, err
	}
	if err = json.Unmarshal(raw, &resp); err != nil {
		return StatusMessage{}, err
	}
	return resp, nil
}
128198
func createOvsInternalPort(prefix string, bridge string, tag uint) (port string, err error) {
	if port, err = GenerateRandomName(prefix, 7); err != nil {
		return
	}

	if ovsClient == nil {
		err = errors.New("OVS not connected")
		return
	}

	AddInternalPort(ovsClient, bridge, port, tag)
	return
}
809533
func PutInt64(v int64) []byte {
	b := make([]byte, 8)
	binary.LittleEndian.PutUint64(b, uint64(v))
	return b
}
1285667
func (t readWriteTransaction) updateLocalNeed(keyBuf, folder, name []byte, fl VersionList, global protocol.FileInfo) []byte {
	keyBuf = t.keyer.GenerateNeedFileKey(keyBuf, folder, name)
	hasNeeded, _ := t.Has(keyBuf, nil)
	if localFV, haveLocalFV := fl.Get(protocol.LocalDeviceID[:]); need(global, haveLocalFV, localFV.Version) {
		if !hasNeeded {
			l.Debugf("local need insert; folder=%q, name=%q", folder, name)
			t.Put(keyBuf, nil)
		}
	} else if hasNeeded {
		l.Debugf("local need delete; folder=%q, name=%q", folder, name)
		t.Delete(keyBuf)
	}
	return keyBuf
}
1274114
func (f StringField) PutInBatch(batch *leveldb.Batch, val string) {
	batch.Put(f.key, []byte(val))
}
914401
func (i24 *Int24) PutInt32(i32 int32) {
	if littleEndian {
		i24[0] = byte(i32 >> 8)
		i24[1] = byte(i32 >> 16)
		i24[2] = byte(i32 >> 24)
	} else {
		i24[2] = byte(i32 >> 8)
		i24[1] = byte(i32 >> 16)
		i24[0] = byte(i32 >> 24)
	}
}
535465
func (r *Client) UpdateActualOrg(org Org) (StatusMessage, error) {
	var (
		raw  []byte
		resp StatusMessage
		err  error
	)
	if raw, err = json.Marshal(org); err != nil {
		return StatusMessage{}, err
	}
	if raw, _, err = r.put("api/org", nil, raw); err != nil {
		return StatusMessage{}, err
	}
	if err = json.Unmarshal(raw, &resp); err != nil {
		return StatusMessage{}, err
	}
	return resp, nil
}
670678
func (s *BoltStateDB) PutTaskRunnerLocalState(allocID, taskName string, val *trstate.LocalState) error {
	return s.db.Update(func(tx *boltdd.Tx) error {
		return putTaskRunnerLocalStateImpl(tx, allocID, taskName, val)
	})
}
783475
func (s *EventStream) SetExternalId(v string) *EventStream {
	s.ExternalId = &v
	return s
}
82860
func (_m *FacadeInterface) UpdateServiceTemplate(ctx datastore.Context, template servicetemplate.ServiceTemplate, reloadLogstashConfig bool) error {
	ret := _m.Called(ctx, template, reloadLogstashConfig)

	var r0 error
	if rf, ok := ret.Get(0).(func(datastore.Context, servicetemplate.ServiceTemplate, bool) error); ok {
		r0 = rf(ctx, template, reloadLogstashConfig)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
284383
func (client *FakeTabletManagerClient) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error {
	return nil
}
469015
func (s *ActionExecutionResult) SetExternalExecutionUrl(v string) *ActionExecutionResult {
	s.ExternalExecutionUrl = &v
	return s
}
1148639
func (s *WorkflowExecutionCancelRequestedEventAttributes) SetExternalInitiatedEventId(v int64) *WorkflowExecutionCancelRequestedEventAttributes {
	s.ExternalInitiatedEventId = &v
	return s
}
944130
func (s *TaskSet) SetExternalId(v string) *TaskSet {
	s.ExternalId = &v
	return s
}
1198292
func (s *Endpoint) SetExternalTableDefinition(v string) *Endpoint {
	s.ExternalTableDefinition = &v
	return s
}