MCPcopy Create free account
hub / github.com/elimity-com/scim / getSimpleParams

Function getSimpleParams

internal/filter/path.go:22–45  ·  view source on GitHub ↗

getSimpleParams returns simple params based on the type of the attribute. The simple params only have their name assigned to "value", everything else is left out (i.e. default values). Can not be used for complex attributes.

(attr schema.CoreAttribute)

Source from the content-addressed store, hash-verified

20// getSimpleParams returns simple params based on the type of the attribute. The simple params only have their name
21// assigned to "value", everything else is left out (i.e. default values). Can not be used for complex attributes.
22func getSimpleParams(attr schema.CoreAttribute) schema.SimpleParams {
23 switch attr.AttributeType() {
24 case "decimal":
25 return schema.SimpleNumberParams(schema.NumberParams{
26 Name: "value",
27 Type: schema.AttributeTypeDecimal(),
28 })
29 case "integer":
30 return schema.SimpleNumberParams(schema.NumberParams{
31 Name: "value",
32 Type: schema.AttributeTypeInteger(),
33 })
34 case "binary":
35 return schema.SimpleBinaryParams(schema.BinaryParams{Name: "value"})
36 case "boolean":
37 return schema.SimpleBooleanParams(schema.BooleanParams{Name: "value"})
38 case "dateTime":
39 return schema.SimpleDateTimeParams(schema.DateTimeParams{Name: "value"})
40 case "reference":
41 return schema.SimpleReferenceParams(schema.ReferenceParams{Name: "value"})
42 default:
43 return schema.SimpleStringParams(schema.StringParams{Name: "value"})
44 }
45}
46
47// PathValidator represents a path validator.
48type PathValidator struct {

Callers 1

Calls 9

SimpleNumberParamsFunction · 0.92
AttributeTypeDecimalFunction · 0.92
AttributeTypeIntegerFunction · 0.92
SimpleBinaryParamsFunction · 0.92
SimpleBooleanParamsFunction · 0.92
SimpleDateTimeParamsFunction · 0.92
SimpleReferenceParamsFunction · 0.92
SimpleStringParamsFunction · 0.92
AttributeTypeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…