// CreateVariable checks to see if the authorizer on context has write access to the global variable resource.
338737
func (s *VariableService) CreateVariable(ctx context.Context, m *influxdb.Variable) error {
	p, err := influxdb.NewPermission(influxdb.WriteAction, influxdb.VariablesResourceType, m.OrganizationID)
	if err != nil {
		return err
	}

	if err := IsAllowed(ctx, *p); err != nil {
		return err
	}

	return s.s.CreateVariable(ctx, m)
}
24225
func newEdns0VariableRule(mode, action, code, variable string) (*edns0VariableRule, error) {
	c, err := strconv.ParseUint(code, 0, 16)
	if err != nil {
		return nil, err
	}
	//Validate
	if !isValidVariable(variable) {
		return nil, fmt.Errorf("unsupported variable name %q", variable)
	}
	return &edns0VariableRule{mode: mode, action: action, code: uint16(c), variable: variable}, nil
}
138007
func (v *MrbValue) SetInstanceVariable(variable string, value *MrbValue) {
	cs := C.CString(variable)
	defer C.free(unsafe.Pointer(cs))
	C._go_mrb_iv_set(v.state, v.value, C.mrb_intern_cstr(v.state, cs), value.value)
}
89341
func (a *AuthorizationsService) Create(params interface{}) (auth *Authorization, result *Result) {
	result = a.client.post(a.URL, params, &auth)
	return
}
459383
func (rc *ResourceController) CreateHandler(c *gin.Context) {
	resource := models.NewStructForResourceName(rc.Name)
	err := FHIRBind(c, resource)
	if err != nil {
		oo := models.NewOperationOutcome("fatal", "exception", err.Error())
		c.JSON(http.StatusBadRequest, oo)
		return
	}

	id, err := rc.DAL.Post(resource)
	if err != nil {
		c.AbortWithError(http.StatusInternalServerError, err)
		return
	}

	c.Set(rc.Name, resource)
	c.Set("Resource", rc.Name)
	c.Set("Action", "create")

	c.Header("Location", responseURL(c.Request, rc.Name, id).String())
	c.JSON(http.StatusCreated, resource)
}
179595
func (env *joyentEnviron) Create(context.ProviderCallContext, environs.CreateParams) error {
	if err := verifyCredentials(env); err != nil {
		return errors.Trace(err)
	}
	return nil
}
1143115
func (c *Client) CreateVariable(ctx context.Context, variable *platform.Variable) error {
	op := getOp(platform.OpCreateVariable)
	return c.db.Update(func(tx *bolt.Tx) error {
		variable.ID = c.IDGenerator.ID()

		if err := c.putVariableOrgsIndex(ctx, tx, variable); err != nil {
			return err
		}

		if pe := c.putVariable(ctx, tx, variable); pe != nil {
			return &platform.Error{
				Op:  op,
				Err: pe,
			}

		}
		return nil
	})
}
194393
func (ln *line) isVariable() bool {
	if !ln.isTopIndent() {
		return false
	}

	_, _, err := variableNV(ln)

	return err == nil
}
561854
func varNameForVar(raw config.InterpolatedVariable) string {
	switch v := raw.(type) {
	case *config.ModuleVariable:
		return fmt.Sprintf("module.%s.output.%s", v.Name, v.Field)
	case *config.ResourceVariable:
		return v.ResourceId()
	case *config.UserVariable:
		return fmt.Sprintf("var.%s", v.Name)
	default:
		return ""
	}
}
381903
func (s *Service) UpdateVariable(ctx context.Context, id influxdb.ID, update *influxdb.VariableUpdate) (*influxdb.Variable, error) {
	var variable *influxdb.Variable
	err := s.kv.Update(ctx, func(tx Tx) error {
		m, pe := s.findVariableByID(ctx, tx, id)
		if pe != nil {
			return &influxdb.Error{
				Err: pe,
			}
		}

		if err := update.Apply(m); err != nil {
			return &influxdb.Error{
				Err: err,
			}
		}

		variable = m
		if pe = s.putVariable(ctx, tx, variable); pe != nil {
			return &influxdb.Error{
				Err: pe,
			}
		}
		return nil
	})

	return variable, err
}
1286022
func (b *stdBackend) SetVariable(id string, v int64) {
	if b.ssvFilter != nil && !b.ssvFilter(id) {
		return
	}
	b.ssvChangeC <- &stdSSVChange{id, true, v}
}
458851
func (s *VariableService) FindVariableByID(ctx context.Context, id influxdb.ID) (*influxdb.Variable, error) {
	m, err := s.s.FindVariableByID(ctx, id)
	if err != nil {
		return nil, err
	}

	if err := authorizeReadVariable(ctx, m.OrganizationID, id); err != nil {
		return nil, err
	}

	return m, nil
}
1133396
func (d *Debugger) SetVariableInScope(scope api.EvalScope, symbol, value string) error {
	d.processMutex.Lock()
	defer d.processMutex.Unlock()

	s, err := proc.ConvertEvalScope(d.target, scope.GoroutineID, scope.Frame, scope.DeferredCall)
	if err != nil {
		return err
	}
	return s.SetVariable(symbol, value)
}
249465
func newVariableNode(prefix, name string) node {
	return &variableNode{nodeType: nodeVariable, Name: name, Prefix: prefix}
}
66025
func (v *MrbValue) GetInstanceVariable(variable string) *MrbValue {
	cs := C.CString(variable)
	defer C.free(unsafe.Pointer(cs))
	return newValue(v.state, C._go_mrb_iv_get(v.state, v.value, C.mrb_intern_cstr(v.state, cs)))
}
230223
func (c *FakeSubjectAccessReviews) Create(subjectAccessReview *authorization.SubjectAccessReview) (result *authorization.SubjectAccessReviewResponse, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &authorization.SubjectAccessReviewResponse{})
	if obj == nil {
		return nil, err
	}
	return obj.(*authorization.SubjectAccessReviewResponse), err
}
170639
func (lx *lexer) isVariable() bool {
	if lx.input[lx.start] == '$' {
		lx.start += 1
		return true
	}
	return false
}