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

Function Example_replaceMembers

internal/patch/replace_test.go:35–59  ·  view source on GitHub ↗

The following example shows how to replace all of the members of a group with a different members list in a single replace operation.

()

Source from the content-addressed store, hash-verified

33// The following example shows how to replace all of the members of a group with a different members list in a single
34// replace operation.
35func Example_replaceMembers() {
36 operations := []string{`{
37 "op": "replace",
38 "path": "members",
39 "value": [
40 {
41 "display": "di-wu",
42 "$ref": "https://example.com/v2/Users/0001",
43 "value": "0001"
44 },
45 {
46 "display": "example",
47 "$ref": "https://example.com/v2/Users/0002",
48 "value": "0002"
49 }
50 ]
51}`,
52 }
53 for _, op := range operations {
54 validator, _ := NewValidator(op, schema.CoreGroupSchema())
55 fmt.Println(validator.Validate())
56 }
57 // Output:
58 // [map[$ref:https://example.com/v2/Users/0001 display:di-wu value:0001] map[$ref:https://example.com/v2/Users/0002 display:example value:0002]] <nil>
59}
60
61// The following example shows how to change a specific sub-attribute "streetAddress" of complex attribute "emails"
62// selected by a "valuePath" filter.

Callers

nothing calls this directly

Calls 3

ValidateMethod · 0.95
CoreGroupSchemaFunction · 0.92
NewValidatorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…