diff --git a/github/enterprise_scim.go b/github/enterprise_scim.go index fe7aa3406df..806954360a0 100644 --- a/github/enterprise_scim.go +++ b/github/enterprise_scim.go @@ -14,6 +14,10 @@ import ( // This constant represents the standard SCIM core schema for group objects as defined by RFC 7643. const SCIMSchemasURINamespacesGroups = "urn:ietf:params:scim:schemas:core:2.0:Group" +// SCIMSchemasURINamespacesUser is the SCIM schema URI namespace for user resources. +// This constant represents the standard SCIM core schema for user objects as defined by RFC 7643. +const SCIMSchemasURINamespacesUser = "urn:ietf:params:scim:schemas:core:2.0:User" + // SCIMSchemasURINamespacesListResponse is the SCIM schema URI namespace for list response resources. // This constant represents the standard SCIM namespace for list responses used in paginated queries, as defined by RFC 7644. const SCIMSchemasURINamespacesListResponse = "urn:ietf:params:scim:api:messages:2.0:ListResponse" @@ -61,15 +65,79 @@ type SCIMEnterpriseGroups struct { 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"` + Filter *string `url:"filter,omitempty"` // Excludes the specified attribute from being returned in the results. - ExcludedAttributes string `url:"excludedAttributes,omitempty"` + ExcludedAttributes *string `url:"excludedAttributes,omitempty"` + // Used for pagination: the starting index of the first result to return when paginating through values. + // Default: 1. + StartIndex *int `url:"startIndex,omitempty"` + // Used for pagination: the number of results to return per page. + // Default: 30. + Count *int `url:"count,omitempty"` +} + +// SCIMEnterpriseUserAttributes represents supported SCIM enterprise user attributes. +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-user-attributes +type SCIMEnterpriseUserAttributes struct { + DisplayName string `json:"displayName"` // Human-readable name for a user + Name *SCIMEnterpriseUserName `json:"name,omitempty"` // The user's full name + UserName string `json:"userName"` // The username for the user (GitHub Account after normalized), generated by the SCIM provider. Must be unique per user. + Emails []*SCIMEnterpriseUserEmail `json:"emails"` // List of the user's emails. They all must be unique per user. + Roles []*SCIMEnterpriseUserRole `json:"roles,omitempty"` // List of the user's roles. + ExternalID string `json:"externalId"` // This identifier is generated by a SCIM provider. Must be unique per user. + Active bool `json:"active"` // Indicates whether the identity is active (true) or should be suspended (false). + Schemas []string `json:"schemas"` // The URIs that are used to indicate the namespaces of the SCIM schemas. + // Bellow: Only populated as a result of calling SetSCIMInformationForProvisionedUser: + ID *string `json:"id,omitempty"` // Identifier generated by the GitHub's SCIM endpoint. + Groups []*SCIMEnterpriseDisplayReference `json:"groups,omitempty"` // List of groups who are assigned to the user in SCIM provider + Meta *SCIMEnterpriseMeta `json:"meta,omitempty"` // The metadata associated with the creation/updates to the user. +} + +// SCIMEnterpriseUserName represents SCIM enterprise user's name information. +type SCIMEnterpriseUserName struct { + GivenName string `json:"givenName"` // The first name of the user. + FamilyName string `json:"familyName"` // The last name of the user. + Formatted *string `json:"formatted,omitempty"` // The user's full name, including all middle names, titles, and suffixes, formatted for display. + MiddleName *string `json:"middleName,omitempty"` // The middle name(s) of the user. +} + +// SCIMEnterpriseUserEmail represents SCIM enterprise user's emails. +type SCIMEnterpriseUserEmail struct { + Value string `json:"value"` // The email address. + Primary bool `json:"primary"` // Whether this email address is the primary address. + Type string `json:"type"` // The type of email address +} + +// SCIMEnterpriseUserRole is an enterprise-wide role granted to the user. +type SCIMEnterpriseUserRole struct { + Value string `json:"value"` // The role value representing a user role in GitHub. + Display *string `json:"display,omitempty"` + Type *string `json:"type,omitempty"` + Primary *bool `json:"primary,omitempty"` // Is the role a primary role for the user? +} + +// SCIMEnterpriseUsers represents the result of calling ProvisionSCIMEnterpriseUser. +type SCIMEnterpriseUsers struct { + Schemas []string `json:"schemas,omitempty"` + TotalResults *int `json:"totalResults,omitempty"` + ItemsPerPage *int `json:"itemsPerPage,omitempty"` + StartIndex *int `json:"startIndex,omitempty"` + Resources []*SCIMEnterpriseUserAttributes `json:"Resources,omitempty"` +} + +// ListProvisionedSCIMUsersEnterpriseOptions represents query parameters for ListSCIMProvisionedUsers. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +type ListProvisionedSCIMUsersEnterpriseOptions struct { + // If specified, only results that match the specified filter will be returned. + // Possible filters are `userName`, `externalId`, `id`, and `displayName`. For example, `externalId eq "a123"`. + Filter *string `url:"filter,omitempty"` // Used for pagination: the starting index of the first result to return when paginating through values. // Default: 1. - StartIndex int `url:"startIndex,omitempty"` + StartIndex *int `url:"startIndex,omitempty"` // Used for pagination: the number of results to return per page. // Default: 30. - Count int `url:"count,omitempty"` + Count *int `url:"count,omitempty"` } // ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise. @@ -88,6 +156,7 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter if err != nil { return nil, nil, err } + req.Header.Set("Accept", mediaTypeSCIM) groups := new(SCIMEnterpriseGroups) resp, err := s.client.Do(ctx, req, groups) @@ -97,3 +166,30 @@ func (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enter return groups, resp, nil } + +// ListProvisionedSCIMUsers lists provisioned SCIM enterprise users. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +// +//meta:operation GET /scim/v2/enterprises/{enterprise}/Users +func (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterprise string, opts *ListProvisionedSCIMUsersEnterpriseOptions) (*SCIMEnterpriseUsers, *Response, error) { + u := fmt.Sprintf("scim/v2/enterprises/%v/Users", enterprise) + u, err := addOptions(u, opts) + 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) + + users := new(SCIMEnterpriseUsers) + resp, err := s.client.Do(ctx, req, users) + if err != nil { + return nil, resp, err + } + + return users, resp, nil +} diff --git a/github/enterprise_scim_test.go b/github/enterprise_scim_test.go index 5b1d222ae15..adf9099ccea 100644 --- a/github/enterprise_scim_test.go +++ b/github/enterprise_scim_test.go @@ -67,6 +67,139 @@ func TestSCIMEnterpriseGroups_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } +func TestSCIMEnterpriseUsers_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &SCIMEnterpriseUsers{}, "{}") + + u := &SCIMEnterpriseUsers{ + Schemas: []string{SCIMSchemasURINamespacesListResponse}, + TotalResults: Ptr(1), + ItemsPerPage: Ptr(1), + StartIndex: Ptr(1), + Resources: []*SCIMEnterpriseUserAttributes{{ + Active: true, + Emails: []*SCIMEnterpriseUserEmail{{ + Primary: true, + Type: "work", + Value: "un1@email.com", + }}, + Roles: []*SCIMEnterpriseUserRole{{ + Display: Ptr("rd1"), + Primary: Ptr(true), + Type: Ptr("rt1"), + Value: "rv1", + }}, + Schemas: []string{SCIMSchemasURINamespacesUser}, + UserName: "un1", + Groups: []*SCIMEnterpriseDisplayReference{{ + Value: "idgn1", + Ref: "https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1", + Display: Ptr("gn1"), + }}, + ID: Ptr("idun1"), + ExternalID: "eidun1", + DisplayName: "dun1", + Meta: &SCIMEnterpriseMeta{ + ResourceType: "User", + Created: &Timestamp{referenceTime}, + LastModified: &Timestamp{referenceTime}, + Location: Ptr("https://api.github.com/scim/v2/enterprises/ee/User/idun1"), + }, + Name: &SCIMEnterpriseUserName{ + GivenName: "gnn1", + FamilyName: "fnn1", + Formatted: Ptr("f1"), + MiddleName: Ptr("mn1"), + }, + }}, + } + + want := `{ + "schemas": ["` + SCIMSchemasURINamespacesListResponse + `"], + "TotalResults": 1, + "itemsPerPage": 1, + "StartIndex": 1, + "Resources": [{ + "active": true, + "emails": [{ + "primary": true, + "type": "work", + "value": "un1@email.com" + }], + "roles": [{ + "display": "rd1", + "primary": true, + "type": "rt1", + "value": "rv1" + }], + "schemas": ["` + SCIMSchemasURINamespacesUser + `"], + "userName": "un1", + "groups": [{ + "value": "idgn1", + "$ref": "https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1", + "display": "gn1" + }], + "id": "idun1", + "externalId": "eidun1", + "name": { + "givenName": "gnn1", + "familyName": "fnn1", + "formatted": "f1", + "middleName": "mn1" + }, + "displayName": "dun1", + "meta": { + "resourceType": "User", + "created": ` + referenceTimeStr + `, + "lastModified": ` + referenceTimeStr + `, + "location": "https://api.github.com/scim/v2/enterprises/ee/User/idun1" + } + }] + }` + + testJSONMarshal(t, u, want) +} + +func TestListProvisionedSCIMGroupsEnterpriseOptions_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &ListProvisionedSCIMGroupsEnterpriseOptions{}, "{}") + + u := &ListProvisionedSCIMGroupsEnterpriseOptions{ + Filter: Ptr("f"), + ExcludedAttributes: Ptr("ea"), + StartIndex: Ptr(5), + Count: Ptr(9), + } + + want := `{ + "filter": "f", + "excludedAttributes": "ea", + "startIndex": 5, + "count": 9 + }` + + testJSONMarshal(t, u, want) +} + +func TestListProvisionedSCIMUsersEnterpriseOptions_Marshal(t *testing.T) { + t.Parallel() + testJSONMarshal(t, &ListProvisionedSCIMUsersEnterpriseOptions{}, "{}") + + u := &ListProvisionedSCIMUsersEnterpriseOptions{ + Filter: Ptr("f"), + StartIndex: Ptr(3), + Count: Ptr(7), + } + + want := `{ + "filter": "f", + "startIndex": 3, + "count": 7 + }` + + testJSONMarshal(t, u, want) +} + func TestSCIMEnterpriseGroupAttributes_Marshal(t *testing.T) { t.Parallel() testJSONMarshal(t, &SCIMEnterpriseGroupAttributes{}, "{}") @@ -110,12 +243,13 @@ func TestSCIMEnterpriseGroupAttributes_Marshal(t *testing.T) { testJSONMarshal(t, u, want) } -func TestEnterpriseService_ListProvisionedSCIMEnterpriseGroups(t *testing.T) { +func TestEnterpriseService_ListProvisionedSCIMGroups(t *testing.T) { t.Parallel() client, mux, _ := setup(t) mux.HandleFunc("/scim/v2/enterprises/ee/Groups", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSCIM) testFormValues(t, r, values{ "startIndex": "1", "excludedAttributes": "members,meta", @@ -150,14 +284,14 @@ func TestEnterpriseService_ListProvisionedSCIMEnterpriseGroups(t *testing.T) { ctx := t.Context() opts := &ListProvisionedSCIMGroupsEnterpriseOptions{ - StartIndex: 1, - ExcludedAttributes: "members,meta", - Count: 3, - Filter: `externalId eq "914a"`, + StartIndex: Ptr(1), + ExcludedAttributes: Ptr("members,meta"), + Count: Ptr(3), + Filter: Ptr(`externalId eq "914a"`), } groups, _, err := client.Enterprise.ListProvisionedSCIMGroups(ctx, "ee", opts) if err != nil { - t.Errorf("Enterprise.ListProvisionedSCIMGroups returned error: %v", err) + t.Fatalf("Enterprise.ListProvisionedSCIMGroups returned unexpected error: %v", err) } want := SCIMEnterpriseGroups{ @@ -199,3 +333,108 @@ func TestEnterpriseService_ListProvisionedSCIMEnterpriseGroups(t *testing.T) { return r, err }) } + +func TestEnterpriseService_ListProvisionedSCIMUsers(t *testing.T) { + t.Parallel() + client, mux, _ := setup(t) + + mux.HandleFunc("/scim/v2/enterprises/octo-org/Users", func(w http.ResponseWriter, r *http.Request) { + testMethod(t, r, "GET") + testHeader(t, r, "Accept", mediaTypeSCIM) + testFormValues(t, r, values{ + "startIndex": "1", + "count": "3", + "filter": `userName eq "octocat@github.com"`, + }) + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte(`{ + "schemas": ["` + SCIMSchemasURINamespacesListResponse + `"], + "totalResults": 1, + "itemsPerPage": 1, + "startIndex": 1, + "Resources": [ + { + "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/organizations/octo-org/Users/5fc0" + } + } + ] + }`)) + }) + + ctx := t.Context() + opts := &ListProvisionedSCIMUsersEnterpriseOptions{ + StartIndex: Ptr(1), + Count: Ptr(3), + Filter: Ptr(`userName eq "octocat@github.com"`), + } + users, _, err := client.Enterprise.ListProvisionedSCIMUsers(ctx, "octo-org", opts) + if err != nil { + t.Fatalf("Enterprise.ListProvisionedSCIMUsers returned unexpected error: %v", err) + } + + want := SCIMEnterpriseUsers{ + Schemas: []string{SCIMSchemasURINamespacesListResponse}, + TotalResults: Ptr(1), + ItemsPerPage: Ptr(1), + StartIndex: Ptr(1), + Resources: []*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/organizations/octo-org/Users/5fc0"), + }, + }}, + } + + if diff := cmp.Diff(want, *users); diff != "" { + t.Errorf("Enterprise.ListProvisionedSCIMUsers diff mismatch (-want +got):\n%v", diff) + } + + const methodName = "ListProvisionedSCIMUsers" + testBadOptions(t, methodName, func() (err error) { + _, _, err = client.Enterprise.ListProvisionedSCIMUsers(ctx, "\n", opts) + return err + }) + + testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { + _, r, err := client.Enterprise.ListProvisionedSCIMUsers(ctx, "o", opts) + return r, err + }) +} diff --git a/github/github-accessors.go b/github/github-accessors.go index 52798ac89d3..b95be28e733 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -14350,6 +14350,62 @@ func (l *ListProjectsPaginationOptions) GetPerPage() int { return *l.PerPage } +// GetCount returns the Count field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetCount() int { + if l == nil || l.Count == nil { + return 0 + } + return *l.Count +} + +// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetExcludedAttributes() string { + if l == nil || l.ExcludedAttributes == nil { + return "" + } + return *l.ExcludedAttributes +} + +// GetFilter returns the Filter field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetFilter() string { + if l == nil || l.Filter == nil { + return "" + } + return *l.Filter +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetStartIndex() int { + if l == nil || l.StartIndex == nil { + return 0 + } + return *l.StartIndex +} + +// GetCount returns the Count field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMUsersEnterpriseOptions) GetCount() int { + if l == nil || l.Count == nil { + return 0 + } + return *l.Count +} + +// GetFilter returns the Filter field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMUsersEnterpriseOptions) GetFilter() string { + if l == nil || l.Filter == nil { + return "" + } + return *l.Filter +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (l *ListProvisionedSCIMUsersEnterpriseOptions) GetStartIndex() int { + if l == nil || l.StartIndex == nil { + return 0 + } + return *l.StartIndex +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListRepositories) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -26262,6 +26318,94 @@ func (s *SCIMEnterpriseMeta) GetLocation() string { return *s.Location } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserAttributes) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetMeta returns the Meta field. +func (s *SCIMEnterpriseUserAttributes) GetMeta() *SCIMEnterpriseMeta { + if s == nil { + return nil + } + return s.Meta +} + +// GetName returns the Name field. +func (s *SCIMEnterpriseUserAttributes) GetName() *SCIMEnterpriseUserName { + if s == nil { + return nil + } + return s.Name +} + +// GetFormatted returns the Formatted field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserName) GetFormatted() string { + if s == nil || s.Formatted == nil { + return "" + } + return *s.Formatted +} + +// GetMiddleName returns the MiddleName field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserName) GetMiddleName() string { + if s == nil || s.MiddleName == nil { + return "" + } + return *s.MiddleName +} + +// GetDisplay returns the Display field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserRole) GetDisplay() string { + if s == nil || s.Display == nil { + return "" + } + return *s.Display +} + +// GetPrimary returns the Primary field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserRole) GetPrimary() bool { + if s == nil || s.Primary == nil { + return false + } + return *s.Primary +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUserRole) GetType() string { + if s == nil || s.Type == nil { + return "" + } + return *s.Type +} + +// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUsers) GetItemsPerPage() int { + if s == nil || s.ItemsPerPage == nil { + return 0 + } + return *s.ItemsPerPage +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUsers) GetStartIndex() int { + if s == nil || s.StartIndex == nil { + return 0 + } + return *s.StartIndex +} + +// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise. +func (s *SCIMEnterpriseUsers) GetTotalResults() int { + if s == nil || s.TotalResults == nil { + return 0 + } + return *s.TotalResults +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (s *SCIMMeta) GetCreated() Timestamp { if s == nil || s.Created == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 894a3685b95..9abcb49dcde 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -18656,6 +18656,83 @@ func TestListProjectsPaginationOptions_GetPerPage(tt *testing.T) { l.GetPerPage() } +func TestListProvisionedSCIMGroupsEnterpriseOptions_GetCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListProvisionedSCIMGroupsEnterpriseOptions{Count: &zeroValue} + l.GetCount() + l = &ListProvisionedSCIMGroupsEnterpriseOptions{} + l.GetCount() + l = nil + l.GetCount() +} + +func TestListProvisionedSCIMGroupsEnterpriseOptions_GetExcludedAttributes(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListProvisionedSCIMGroupsEnterpriseOptions{ExcludedAttributes: &zeroValue} + l.GetExcludedAttributes() + l = &ListProvisionedSCIMGroupsEnterpriseOptions{} + l.GetExcludedAttributes() + l = nil + l.GetExcludedAttributes() +} + +func TestListProvisionedSCIMGroupsEnterpriseOptions_GetFilter(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListProvisionedSCIMGroupsEnterpriseOptions{Filter: &zeroValue} + l.GetFilter() + l = &ListProvisionedSCIMGroupsEnterpriseOptions{} + l.GetFilter() + l = nil + l.GetFilter() +} + +func TestListProvisionedSCIMGroupsEnterpriseOptions_GetStartIndex(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListProvisionedSCIMGroupsEnterpriseOptions{StartIndex: &zeroValue} + l.GetStartIndex() + l = &ListProvisionedSCIMGroupsEnterpriseOptions{} + l.GetStartIndex() + l = nil + l.GetStartIndex() +} + +func TestListProvisionedSCIMUsersEnterpriseOptions_GetCount(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListProvisionedSCIMUsersEnterpriseOptions{Count: &zeroValue} + l.GetCount() + l = &ListProvisionedSCIMUsersEnterpriseOptions{} + l.GetCount() + l = nil + l.GetCount() +} + +func TestListProvisionedSCIMUsersEnterpriseOptions_GetFilter(tt *testing.T) { + tt.Parallel() + var zeroValue string + l := &ListProvisionedSCIMUsersEnterpriseOptions{Filter: &zeroValue} + l.GetFilter() + l = &ListProvisionedSCIMUsersEnterpriseOptions{} + l.GetFilter() + l = nil + l.GetFilter() +} + +func TestListProvisionedSCIMUsersEnterpriseOptions_GetStartIndex(tt *testing.T) { + tt.Parallel() + var zeroValue int + l := &ListProvisionedSCIMUsersEnterpriseOptions{StartIndex: &zeroValue} + l.GetStartIndex() + l = &ListProvisionedSCIMUsersEnterpriseOptions{} + l.GetStartIndex() + l = nil + l.GetStartIndex() +} + func TestListRepositories_GetTotalCount(tt *testing.T) { tt.Parallel() var zeroValue int @@ -33889,6 +33966,121 @@ func TestSCIMEnterpriseMeta_GetLocation(tt *testing.T) { s.GetLocation() } +func TestSCIMEnterpriseUserAttributes_GetID(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMEnterpriseUserAttributes{ID: &zeroValue} + s.GetID() + s = &SCIMEnterpriseUserAttributes{} + s.GetID() + s = nil + s.GetID() +} + +func TestSCIMEnterpriseUserAttributes_GetMeta(tt *testing.T) { + tt.Parallel() + s := &SCIMEnterpriseUserAttributes{} + s.GetMeta() + s = nil + s.GetMeta() +} + +func TestSCIMEnterpriseUserAttributes_GetName(tt *testing.T) { + tt.Parallel() + s := &SCIMEnterpriseUserAttributes{} + s.GetName() + s = nil + s.GetName() +} + +func TestSCIMEnterpriseUserName_GetFormatted(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMEnterpriseUserName{Formatted: &zeroValue} + s.GetFormatted() + s = &SCIMEnterpriseUserName{} + s.GetFormatted() + s = nil + s.GetFormatted() +} + +func TestSCIMEnterpriseUserName_GetMiddleName(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMEnterpriseUserName{MiddleName: &zeroValue} + s.GetMiddleName() + s = &SCIMEnterpriseUserName{} + s.GetMiddleName() + s = nil + s.GetMiddleName() +} + +func TestSCIMEnterpriseUserRole_GetDisplay(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMEnterpriseUserRole{Display: &zeroValue} + s.GetDisplay() + s = &SCIMEnterpriseUserRole{} + s.GetDisplay() + s = nil + s.GetDisplay() +} + +func TestSCIMEnterpriseUserRole_GetPrimary(tt *testing.T) { + tt.Parallel() + var zeroValue bool + s := &SCIMEnterpriseUserRole{Primary: &zeroValue} + s.GetPrimary() + s = &SCIMEnterpriseUserRole{} + s.GetPrimary() + s = nil + s.GetPrimary() +} + +func TestSCIMEnterpriseUserRole_GetType(tt *testing.T) { + tt.Parallel() + var zeroValue string + s := &SCIMEnterpriseUserRole{Type: &zeroValue} + s.GetType() + s = &SCIMEnterpriseUserRole{} + s.GetType() + s = nil + s.GetType() +} + +func TestSCIMEnterpriseUsers_GetItemsPerPage(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMEnterpriseUsers{ItemsPerPage: &zeroValue} + s.GetItemsPerPage() + s = &SCIMEnterpriseUsers{} + s.GetItemsPerPage() + s = nil + s.GetItemsPerPage() +} + +func TestSCIMEnterpriseUsers_GetStartIndex(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMEnterpriseUsers{StartIndex: &zeroValue} + s.GetStartIndex() + s = &SCIMEnterpriseUsers{} + s.GetStartIndex() + s = nil + s.GetStartIndex() +} + +func TestSCIMEnterpriseUsers_GetTotalResults(tt *testing.T) { + tt.Parallel() + var zeroValue int + s := &SCIMEnterpriseUsers{TotalResults: &zeroValue} + s.GetTotalResults() + s = &SCIMEnterpriseUsers{} + s.GetTotalResults() + s = nil + s.GetTotalResults() +} + func TestSCIMMeta_GetCreated(tt *testing.T) { tt.Parallel() var zeroValue Timestamp diff --git a/github/github.go b/github/github.go index 8e7d58ae671..eba55176108 100644 --- a/github/github.go +++ b/github/github.go @@ -55,6 +55,7 @@ const ( mediaTypeOrgPermissionRepo = "application/vnd.github.v3.repository+json" mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" mediaTypeStarring = "application/vnd.github.star+json" + mediaTypeSCIM = "application/scim+json" // Media Type values to access preview APIs. // These media types will be added to the API request as headers