// SetOne validates and sets an individual key-value pair
// It will overwrite an existing value
197005
func (pl *PairList) SetOne(key, val string) error {
	// Check that key is allowed
	if len(pl.permissible) > 0 {
		permVals, ok := pl.permissible[key]
		if !ok {
			return fmt.Errorf("key %v is not allowed", key)
		}

		// Check that value is allowed
		if len(permVals) > 0 {
			_, ok = permVals[val]
			if !ok {
				return fmt.Errorf("key %v does not allow value %v", key, val)
			}
		}
	}

	pl.Pairs[key] = val
	return nil
}
778257
func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata {
	s.KeyUsage = &v
	return s
}
722367
func KeysVote(w http.ResponseWriter, r *http.Request) {
	utils.JSONResponse(w, 501, &KeysVoteResponse{
		Success: false,
		Message: "Sorry, not implemented yet",
	})
}
372466
func (v *Values) EachKeyValue(visitor func(key Key, value interface{})) {
	v.lock.RLock()
	defer v.lock.RUnlock()

	v.root.eachKeyValue(nil, visitor)
}
1344051
func (args *QueueBindingArgs) Decode(value string) error {
	pairs := strings.Split(value, ",")
	mp := make(map[string]interface{}, len(pairs))
	for _, pair := range pairs {
		kvpair := strings.Split(pair, ":")
		if len(kvpair) != 2 {
			return fmt.Errorf("invalid map item: %q", pair)
		}
		mp[kvpair[0]] = kvpair[1]
	}
	*args = QueueBindingArgs(mp)
	return nil
}
155544
func (that *JSONNode) atArray(key int, val ...interface{}) *JSONNode {
	if that.t == TypeUndefined {
		that.t = TypeArray
	} else if that.t != TypeArray {
		panic(ErrorMultipleType)
	}
	if key < 0 {
		panic(ErrorArrayNegativeValue)
	}
	if key >= len(that.a) {
		newa := make([]JSONNode, key+1)
		for i := 0; i < len(that.a); i++ {
			newa[i] = that.a[i]
		}
		that.a = newa
	}
	return that.a[key].At(val...)
}
379195
func (m *OutgoingMessage) SetOneTimeKeyboard(b bool) *OutgoingMessage {
	m.OneTimeKeyboard = b
	return m
}
1297033
func (s *UpdateNotebookInstanceLifecycleConfigInput) SetOnStart(v []*NotebookInstanceLifecycleHook) *UpdateNotebookInstanceLifecycleConfigInput {
	s.OnStart = v
	return s
}
1029668
func (s *DescribeLocationNfsOutput) SetOnPremConfig(v *OnPremConfig) *DescribeLocationNfsOutput {
	s.OnPremConfig = v
	return s
}
173674
func (s *S3Resource) SetKeyRange(v *KeyRange) *S3Resource {
	s.KeyRange = v
	return s
}
1200078
func Value(e error, key interface{}) interface{} {
	for {
		switch m := e.(type) {
		case nil:
			return nil
		case *merryErr:
			if m.key == key {
				return m.value
			}
			e = m.err
		default:
			return nil
		}
	}
}
58777
func (c *Context) Set(key string, val interface{}) {
	c.moot.Lock()
	defer c.moot.Unlock()
	c.data[key] = val
}
832249
func (m *lockingMap) Set(key string, val interface{}) {
	m.keyLocker.Lock(key)
	defer m.keyLocker.Unlock(key)

	m.lock.Lock()
	defer m.lock.Unlock()

	m.data[key] = val
}
206230
func setKey(key string) (string, error) {
	if err := ValidAPIKey(key); err != nil {
		return "", err
	}
	return key, nil
}
462276
func (c *Connection) SetOnClose(onClose func(int)) {
	c.Lock()
	defer c.Unlock()
	if err := c.isClosed(); err == nil {
		c.onClose = onClose
	}
}
730896
func (settings FileSettings) setKeyValue(key string, val interface{}) {
	if val != nil {
		settings.Values[key] = val.(string)
	}
}
299808
func (e *errorT) Keyvals() []interface{} {
	var keyvals []interface{}
	keyvals = append(keyvals, "msg", e.msg)
	keyvals = e.ctx.appendKeyvals(keyvals)
	return keyvals
}