diff --git a/github/enterprise_scim.go b/github/enterprise_scim.go index ea45b2e5c86..9f9e296944c 100644 --- a/github/enterprise_scim.go +++ b/github/enterprise_scim.go @@ -165,7 +165,7 @@ type SCIMEnterpriseAttribute struct { type SCIMEnterpriseAttributeOperation struct { Op string `json:"op"` // Can be one of: `add`, `replace`, `remove`. Path *string `json:"path,omitempty"` // Path to the attribute being modified (Filters are not supported). - Value *string `json:"value,omitempty"` // New value for the attribute being modified. + Value any `json:"value,omitempty"` // New value for the attribute being modified. } // ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise. diff --git a/github/enterprise_scim_test.go b/github/enterprise_scim_test.go index 1ffe24e75fd..c4f219744dd 100644 --- a/github/enterprise_scim_test.go +++ b/github/enterprise_scim_test.go @@ -260,27 +260,55 @@ func TestSCIMEnterpriseAttribute_Marshal(t *testing.T) { u := &SCIMEnterpriseAttribute{ Schemas: []string{"s"}, Operations: []*SCIMEnterpriseAttributeOperation{ + {Op: "o1"}, { - Op: "o1", - Path: Ptr("p1"), - Value: Ptr("v1"), + Op: "o2", + Path: Ptr("p2"), + Value: "v2", }, { - Op: "o2", + Op: "replace", + Path: Ptr("emails[type eq 'work'].value"), + Value: "v@3.com", + }, + { + Op: "add", + Path: Ptr("members"), + Value: []*SCIMEnterpriseDisplayReference{ + {Value: "v-1"}, + {Value: "v-2"}, + }, }, }, } want := `{ "schemas": ["s"], - "Operations": [{ - "op": "o1", - "path": "p1", - "value": "v1" - }, - { - "op": "o2" - }] + "Operations": [ + {"op": "o1"}, + { + "op": "o2", + "path": "p2", + "value": "v2" + }, + { + "op": "replace", + "path": "emails[type eq 'work'].value", + "value": "v@3.com" + }, + { + "op": "add", + "path": "members", + "value": [ + { + "value": "v-1" + }, + { + "value": "v-2" + } + ] + } + ] }` testJSONMarshal(t, u, want) diff --git a/github/github-accessors.go b/github/github-accessors.go index 5190e65693b..4f2f4af4082 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -26878,14 +26878,6 @@ func (s *SCIMEnterpriseAttributeOperation) GetPath() string { return *s.Path } -// GetValue returns the Value field if it's non-nil, zero value otherwise. -func (s *SCIMEnterpriseAttributeOperation) GetValue() string { - if s == nil || s.Value == nil { - return "" - } - return *s.Value -} - // GetDisplay returns the Display field if it's non-nil, zero value otherwise. func (s *SCIMEnterpriseDisplayReference) GetDisplay() string { if s == nil || s.Display == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 944be5e9ce6..f4511ed5eab 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -34676,17 +34676,6 @@ func TestSCIMEnterpriseAttributeOperation_GetPath(tt *testing.T) { s.GetPath() } -func TestSCIMEnterpriseAttributeOperation_GetValue(tt *testing.T) { - tt.Parallel() - var zeroValue string - s := &SCIMEnterpriseAttributeOperation{Value: &zeroValue} - s.GetValue() - s = &SCIMEnterpriseAttributeOperation{} - s.GetValue() - s = nil - s.GetValue() -} - func TestSCIMEnterpriseDisplayReference_GetDisplay(tt *testing.T) { tt.Parallel() var zeroValue string