From 9740ea08dc35ca0c45a9b5fb0373bf389a1e304e Mon Sep 17 00:00:00 2001 From: Alejandro Date: Tue, 16 Dec 2025 23:45:42 +0100 Subject: [PATCH 1/3] Unit tests for getting SCIM Groups & Users --- github/enterprise_scim.go | 18 ++++ github/enterprise_scim_test.go | 181 +++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) diff --git a/github/enterprise_scim.go b/github/enterprise_scim.go index bf8e6429365..0ea34ba3cbd 100644 --- a/github/enterprise_scim.go +++ b/github/enterprise_scim.go @@ -381,6 +381,24 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st return userProvisioned, resp, nil } +// GetProvisionedSCIMGroup gets information about a SCIM group. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +// +//meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} +func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID, excludedAttributes string) (*SCIMEnterpriseGroupAttributes, *Response, error) { + return nil, nil, nil +} + +// GetProvisionedSCIMUser gets information about a SCIM user. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user +// +//meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} +func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) { + return nil, nil, nil +} + // DeleteSCIMGroup deletes a SCIM group from an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise diff --git a/github/enterprise_scim_test.go b/github/enterprise_scim_test.go index a0f984f818f..b93ad22f05f 100644 --- a/github/enterprise_scim_test.go +++ b/github/enterprise_scim_test.go @@ -1014,6 +1014,187 @@ func TestEnterpriseService_ProvisionSCIMUser(t *testing.T) { }) } +func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + // Test 1 without values + mux.HandleFunc("/scim/v2/enterprises/ee/Groups/914a", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSCIM) + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, `{ + "schemas": ["`+SCIMSchemasURINamespacesGroups+`"], + "id": "914a", + "externalId": "de88", + "displayName": "gn1", + "meta": { + "resourceType": "Group", + "created": `+referenceTimeStr+`, + "lastModified": `+referenceTimeStr+`, + "location": "https://api.github.com/scim/v2/enterprises/ee/Groups/914a" + }, + "members": [{ + "value": "e7f9", + "$ref": "https://api.github.com/scim/v2/enterprises/ee/Users/e7f9", + "display": "d1" + }] + }`) + }) + + ctx := t.Context() + got, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "") + if err != nil { + t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) + } + + want := &SCIMEnterpriseGroupAttributes{ + ID: Ptr("914a"), + Meta: &SCIMEnterpriseMeta{ + ResourceType: "Group", + Created: &Timestamp{referenceTime}, + LastModified: &Timestamp{referenceTime}, + Location: Ptr("https://api.github.com/scim/v2/enterprises/ee/Groups/914a"), + }, + DisplayName: Ptr("gn1"), + Schemas: []string{SCIMSchemasURINamespacesGroups}, + ExternalID: Ptr("de88"), + Members: []*SCIMEnterpriseDisplayReference{{ + Value: "e7f9", + Ref: Ptr("https://api.github.com/scim/v2/enterprises/ee/Users/e7f9"), + Display: Ptr("d1"), + }}, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) + } + + // Test 2 with values + mux.HandleFunc("/scim/v2/enterprises/ee/Groups/914a", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSCIM) + testFormValues(t, r, values{"excludedAttributes": "externalId,members,schemas,meta"}) + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, `{ + "id": "914a", + "displayName": "gn1" + }`) + }) + + got, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "meta") + if err != nil { + t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) + } + + want = &SCIMEnterpriseGroupAttributes{ + ID: Ptr("914a"), + DisplayName: Ptr("gn1"), + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "GetProvisionedSCIMGroup" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "meta") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + +func TestEnterpriseService_GetProvisionedSCIMUser(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/scim/v2/enterprises/ee/Users/5fc0", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSCIM) + w.WriteHeader(http.StatusOK) + fmt.Fprint(w, `{ + "schemas": ["`+SCIMSchemasURINamespacesUser+`"], + "id": "5fc0", + "externalId": "00u1", + "userName": "octocat@github.com", + "displayName": "Mona Octocat", + "name": { + "givenName": "Mona", + "familyName": "Octocat", + "formatted": "Mona Octocat" + }, + "emails": [ + { + "value": "octocat@github.com", + "primary": true + } + ], + "active": true, + "meta": { + "resourceType": "User", + "created": `+referenceTimeStr+`, + "lastModified": `+referenceTimeStr+`, + "location": "https://api.github.com/scim/v2/enterprises/ee/Users/5fc0" + } + }`) + }) + + ctx := t.Context() + got, _, err := client.Enterprise.GetProvisionedSCIMUser(ctx, "ee", "5fc0") + if err != nil { + t.Fatalf("Enterprise.GetProvisionedSCIMUser returned unexpected error: %v", err) + } + + want := &SCIMEnterpriseUserAttributes{ + Schemas: []string{SCIMSchemasURINamespacesUser}, + ID: Ptr("5fc0"), + ExternalID: "00u1", + UserName: "octocat@github.com", + DisplayName: "Mona Octocat", + Name: &SCIMEnterpriseUserName{ + GivenName: "Mona", + FamilyName: "Octocat", + Formatted: Ptr("Mona Octocat"), + }, + Emails: []*SCIMEnterpriseUserEmail{{ + Value: "octocat@github.com", + Primary: true, + }}, + Active: true, + Meta: &SCIMEnterpriseMeta{ + ResourceType: "User", + Created: &Timestamp{referenceTime}, + LastModified: &Timestamp{referenceTime}, + Location: Ptr("https://api.github.com/scim/v2/enterprises/ee/Users/5fc0"), + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("Enterprise.GetProvisionedSCIMUser diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "GetProvisionedSCIMUser" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.GetProvisionedSCIMUser(ctx, "\n", "\n") + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + got, resp, err := client.Enterprise.GetProvisionedSCIMUser(ctx, "ee", "5fc0") + if got != nil { + t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) + } + return resp, err + }) +} + func TestEnterpriseService_DeleteSCIMGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) From a0fd6042c65224d1b97dbae287032cf8181871ea Mon Sep 17 00:00:00 2001 From: Alejandro Date: Thu, 18 Dec 2025 13:26:23 +0100 Subject: [PATCH 2/3] Implement GetProvisionedSCIM* for Users & Groups --- github/enterprise_scim.go | 42 ++++++++++++++++++++++++++++++++-- github/enterprise_scim_test.go | 24 +++++++++---------- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/github/enterprise_scim.go b/github/enterprise_scim.go index 0ea34ba3cbd..6f97988cc4c 100644 --- a/github/enterprise_scim.go +++ b/github/enterprise_scim.go @@ -387,7 +387,30 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID, excludedAttributes string) (*SCIMEnterpriseGroupAttributes, *Response, error) { - return nil, nil, nil + var err error + u := fmt.Sprintf("scim/v2/enterprises/%v/Groups/%v", enterprise, scimGroupID) + if excludedAttributes != "" { + u, err = addOptions(u, &ListProvisionedSCIMGroupsEnterpriseOptions{ + ExcludedAttributes: &excludedAttributes, + }) + if err != nil { + return nil, nil, err + } + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + req.Header.Set("Accept", mediaTypeSCIM) + + group := new(SCIMEnterpriseGroupAttributes) + resp, err := s.client.Do(ctx, req, group) + if err != nil { + return nil, resp, err + } + + return group, resp, nil } // GetProvisionedSCIMUser gets information about a SCIM user. @@ -396,7 +419,22 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) { - return nil, nil, nil + var err error + u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + req.Header.Set("Accept", mediaTypeSCIM) + + user := new(SCIMEnterpriseUserAttributes) + resp, err := s.client.Do(ctx, req, user) + if err != nil { + return nil, resp, err + } + + return user, resp, nil } // DeleteSCIMGroup deletes a SCIM group from an enterprise. diff --git a/github/enterprise_scim_test.go b/github/enterprise_scim_test.go index b93ad22f05f..f5335ff240d 100644 --- a/github/enterprise_scim_test.go +++ b/github/enterprise_scim_test.go @@ -1043,12 +1043,12 @@ func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { }) ctx := t.Context() - got, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "") + got1, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "") if err != nil { t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) } - want := &SCIMEnterpriseGroupAttributes{ + want1 := &SCIMEnterpriseGroupAttributes{ ID: Ptr("914a"), Meta: &SCIMEnterpriseMeta{ ResourceType: "Group", @@ -1066,39 +1066,39 @@ func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { }}, } - if diff := cmp.Diff(want, got); diff != "" { + if diff := cmp.Diff(want1, got1); diff != "" { t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) } // Test 2 with values - mux.HandleFunc("/scim/v2/enterprises/ee/Groups/914a", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/scim/v2/enterprises/ee/Groups/78ba", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeSCIM) testFormValues(t, r, values{"excludedAttributes": "externalId,members,schemas,meta"}) w.WriteHeader(http.StatusOK) fmt.Fprint(w, `{ - "id": "914a", - "displayName": "gn1" + "id": "78ba", + "displayName": "gn2" }`) }) - got, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "meta") + got2, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "78ba", "externalId,members,schemas,meta") if err != nil { t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) } - want = &SCIMEnterpriseGroupAttributes{ - ID: Ptr("914a"), - DisplayName: Ptr("gn1"), + want2 := &SCIMEnterpriseGroupAttributes{ + ID: Ptr("78ba"), + DisplayName: Ptr("gn2"), } - if diff := cmp.Diff(want, got); diff != "" { + if diff := cmp.Diff(want2, got2); diff != "" { t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) } const methodName = "GetProvisionedSCIMGroup" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "\n") + _, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "\n", "") return err }) From 7ecf3787abc36e3eb846e656f148ae64b6926522 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Sat, 20 Dec 2025 17:01:14 +0100 Subject: [PATCH 3/3] Wrap ExcludedAttributes in a struct --- github/enterprise_scim.go | 33 ++++++++++++++--------- github/enterprise_scim_test.go | 48 +++++++++++---------------------- github/github-accessors.go | 8 ++++++ github/github-accessors_test.go | 11 ++++++++ 4 files changed, 55 insertions(+), 45 deletions(-) diff --git a/github/enterprise_scim.go b/github/enterprise_scim.go index 6f97988cc4c..ea45b2e5c86 100644 --- a/github/enterprise_scim.go +++ b/github/enterprise_scim.go @@ -70,7 +70,7 @@ type ListProvisionedSCIMGroupsEnterpriseOptions struct { // If specified, only results that match the specified filter will be returned. // Possible filters are `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. Filter *string `url:"filter,omitempty"` - // Excludes the specified attribute from being returned in the results. + // Excludes the specified attributes from being returned in the results. ExcludedAttributes *string `url:"excludedAttributes,omitempty"` // Used for pagination: the starting index of the first result to return when paginating through values. // Default: 1. @@ -80,6 +80,14 @@ type ListProvisionedSCIMGroupsEnterpriseOptions struct { Count *int `url:"count,omitempty"` } +// GetProvisionedSCIMGroupEnterpriseOptions represents query parameters for GetProvisionedSCIMGroup. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +type GetProvisionedSCIMGroupEnterpriseOptions struct { + // Excludes the specified attributes from being returned in the results. + ExcludedAttributes *string `url:"excludedAttributes,omitempty"` +} + // SCIMEnterpriseUserAttributes represents supported SCIM enterprise user attributes, and represents the result of calling UpdateSCIMUserAttribute. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-user-attributes @@ -162,8 +170,9 @@ type SCIMEnterpriseAttributeOperation struct { // ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise. // -// You can improve query search time by using the `excludedAttributes` query -// parameter with a value of `members` to exclude members from the response. +// You can improve query search time by using the `excludedAttributes` and +// exclude the specified attributes, e.g. `members` to exclude members from the +// response. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise // @@ -383,19 +392,18 @@ func (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise st // GetProvisionedSCIMGroup gets information about a SCIM group. // +// You can use the `excludedAttributes` from `opts` and exclude the specified +// attributes from being returned in the results. Using this parameter can +// speed up response time. +// // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id} -func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID, excludedAttributes string) (*SCIMEnterpriseGroupAttributes, *Response, error) { - var err error +func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, opts *GetProvisionedSCIMGroupEnterpriseOptions) (*SCIMEnterpriseGroupAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups/%v", enterprise, scimGroupID) - if excludedAttributes != "" { - u, err = addOptions(u, &ListProvisionedSCIMGroupsEnterpriseOptions{ - ExcludedAttributes: &excludedAttributes, - }) - if err != nil { - return nil, nil, err - } + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err } req, err := s.client.NewRequest("GET", u, nil) @@ -419,7 +427,6 @@ func (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterpr // //meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id} func (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) { - var err error u := fmt.Sprintf("scim/v2/enterprises/%v/Users/%v", enterprise, scimUserID) req, err := s.client.NewRequest("GET", u, nil) diff --git a/github/enterprise_scim_test.go b/github/enterprise_scim_test.go index f5335ff240d..edfbd64724d 100644 --- a/github/enterprise_scim_test.go +++ b/github/enterprise_scim_test.go @@ -182,6 +182,15 @@ func TestListProvisionedSCIMGroupsEnterpriseOptions_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestGetProvisionedSCIMGroupEnterpriseOptions_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &GetProvisionedSCIMGroupEnterpriseOptions{}, "{}") + + u := &GetProvisionedSCIMGroupEnterpriseOptions{ExcludedAttributes: Ptr("ea")} + want := `{"excludedAttributes": "ea"}` + testJSONMarshal(t, u, want) +} + func TestListProvisionedSCIMUsersEnterpriseOptions_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &ListProvisionedSCIMUsersEnterpriseOptions{}, "{}") @@ -1018,10 +1027,10 @@ func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { t.Parallel() client, mux, _ := setup(t) - // Test 1 without values mux.HandleFunc("/scim/v2/enterprises/ee/Groups/914a", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", mediaTypeSCIM) + testFormValues(t, r, values{"excludedAttributes": "members,meta"}) w.WriteHeader(http.StatusOK) fmt.Fprint(w, `{ "schemas": ["`+SCIMSchemasURINamespacesGroups+`"], @@ -1043,12 +1052,13 @@ func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { }) ctx := t.Context() - got1, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "") + opts := &GetProvisionedSCIMGroupEnterpriseOptions{ExcludedAttributes: Ptr("members,meta")} + got, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", opts) if err != nil { t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) } - want1 := &SCIMEnterpriseGroupAttributes{ + want := &SCIMEnterpriseGroupAttributes{ ID: Ptr("914a"), Meta: &SCIMEnterpriseMeta{ ResourceType: "Group", @@ -1066,44 +1076,18 @@ func TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) { }}, } - if diff := cmp.Diff(want1, got1); diff != "" { - t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) - } - - // Test 2 with values - mux.HandleFunc("/scim/v2/enterprises/ee/Groups/78ba", func(w http.ResponseWriter, r *http.Request) { - testMethod(t, r, "GET") - testHeader(t, r, "Accept", mediaTypeSCIM) - testFormValues(t, r, values{"excludedAttributes": "externalId,members,schemas,meta"}) - w.WriteHeader(http.StatusOK) - fmt.Fprint(w, `{ - "id": "78ba", - "displayName": "gn2" - }`) - }) - - got2, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "78ba", "externalId,members,schemas,meta") - if err != nil { - t.Fatalf("Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v", err) - } - - want2 := &SCIMEnterpriseGroupAttributes{ - ID: Ptr("78ba"), - DisplayName: Ptr("gn2"), - } - - if diff := cmp.Diff(want2, got2); diff != "" { + if diff := cmp.Diff(want, got); diff != "" { t.Fatalf("Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\n%v", diff) } const methodName = "GetProvisionedSCIMGroup" testBadOptions(t, methodName, func() (err error) { - _, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "\n", "") + _, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "\n", opts) return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { - got, resp, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", "meta") + got, resp, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, "ee", "914a", opts) if got != nil { t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got) } diff --git a/github/github-accessors.go b/github/github-accessors.go index 6b7ec07c7e9..417def5e7a6 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -10006,6 +10006,14 @@ func (g *GetAuditLogOptions) GetPhrase() string { return *g.Phrase } +// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. +func (g *GetProvisionedSCIMGroupEnterpriseOptions) GetExcludedAttributes() string { + if g == nil || g.ExcludedAttributes == nil { + return "" + } + return *g.ExcludedAttributes +} + // GetComments returns the Comments field if it's non-nil, zero value otherwise. func (g *Gist) GetComments() int { if g == nil || g.Comments == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 766bc5f2593..27ccf844711 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -12968,6 +12968,17 @@ func TestGetAuditLogOptions_GetPhrase(tt *testing.T) { g.GetPhrase() } +func TestGetProvisionedSCIMGroupEnterpriseOptions_GetExcludedAttributes(tt *testing.T) { + tt.Parallel() + var zeroValue string + g := &GetProvisionedSCIMGroupEnterpriseOptions{ExcludedAttributes: &zeroValue} + g.GetExcludedAttributes() + g = &GetProvisionedSCIMGroupEnterpriseOptions{} + g.GetExcludedAttributes() + g = nil + g.GetExcludedAttributes() +} + func TestGist_GetComments(tt *testing.T) { tt.Parallel() var zeroValue int