70 Commits
Author SHA1 Message Date
Manav Sharma 65628e2d60 refactor!: Rename UsersService.Edit to Update, introduce UserUpdateRequest, and pass request by value (#4433)
BREAKING CHANGE: `UsersService.Edit` is now `Update` and uses a new `UserUpdateRequest` body value.
2026-08-06 12:01:43 -04:00
Steve Hipwell 2bcee70c64 feat: Add user team membership fields (#4347) 2026-07-06 10:45:42 -04:00
Oleksandr Redko 3f47638460 refactor: Fix parameters in method endpoints (#4300) 2026-06-17 07:19:34 -04:00
Steve Hipwell 9fbf4bef19 feat!: Refactor request context (#4151)
BREAKING CHANGE: All internal calls now provide `Context` via the `Request` itself.
2026-04-24 14:45:31 -04:00
Oleksandr Redko 33cf038ac1 docs: Add apiVersion to GitHub API link (#4147) 2026-04-11 10:47:17 -04:00
Oleksandr Redko ffd18dc823 fix: Add missing User fields (#4146) 2026-04-10 16:19:49 -04:00
Glenn Lewis a2063a76fb chore: Remove unnecessary use of new and &SomeStruct{} and add new extraneousnew custom linter (#4106) 2026-03-18 17:12:53 -04:00
Glenn Lewis 71958fb26f fix!: Pass url struct tags by value instead of by reference (#3991)
BREAKING CHANGE: Many `*Options` structs now pass `omitempty` URL struct fields by value instead of by reference.
2026-02-11 14:07:37 -05:00
Dhananjay Mishra b02895efc8 fix!: Replace UserListOptions.ListOptions with UserListOptions.PerPage (#3977)
BREAKING CHANGE: Replaces `UserListOptions.ListOptions` with `UserListOptions.PerPage` which also removes `UsersService.ListAllIter`.
2026-02-08 10:58:31 -05:00
niveshdandyan 5126e84c99 refactor!: Use RepositoryPermissions struct for User.Permissions (#3963)
BREAKING CHANGE: `User.Permissions` is now `*RepositoryPermissions` instead of `map[string]bool`.
2026-02-03 10:00:07 -05:00
Oleksandr Redko d14f4f3d8d docs: Improve displaying GitHub API links on pkg.go.dev (#3845) 2025-12-01 14:55:37 -05:00
Glenn Lewis 4505771989 Prefer %v over %d,%s and add fmtpercentv custom linter (#3756) 2025-10-05 21:39:53 -04:00
tomfeigin a8a3177767 feat!: Change User.InheritedFrom to a slice (#3460)
BREAKING CHANGE: `User.InheritedFrom` is changed from a `*Team` to a `[]*Team`.
2025-02-05 07:49:44 -05:00
Steve Hipwell 1616008c74 feat: Add assignment for org role associations (#3371)
Fixes: #3364.
2024-12-09 17:31:28 -05:00
Glenn Lewis 02f31995d5 Update openapi_operations.yaml (#3322) 2024-10-10 09:35:11 -04:00
WillAbides a54bc7da1d Use metadata to reconcile go-github with GitHub's OpenAPI descriptions (#2919) 2023-11-03 10:26:59 -04:00
Glenn Lewis 7b27977c44 Change PrivateRepos from int to int64 (#2738)
Fixes: #2736.
2023-04-05 13:10:17 -04:00
Joshua Hancox 697804fa0c Add RoleName field to User struct (#2386) 2022-06-16 12:45:18 -04:00
Glenn Lewis 7a7a7f0943 Update URLs (#2373)
Fixes: #2360.
2022-05-24 08:43:48 -04:00
Glenn Lewis 77a5f59b56 Change all *map to map in JSON structs (#1870)
Fixes: #1865.
2021-05-12 09:29:46 -04:00
Glenn Lewis a64f3a6d08 Update URLs (#1659) 2020-12-02 10:39:08 -05:00
Glenn Lewis 159b448168 Switch to new GitHub v3 API Documentation website (#1621) 2020-09-01 18:30:47 -04:00
Glenn Lewis 0683ca03b4 Update URLs (#1558) 2020-06-24 19:27:03 -04:00
Ryan Mast 2c8de65144 Add missing fields to user and org types (#1548) 2020-05-31 16:04:47 -04:00
Glenn Lewis 259aa56b9e Create tool to update and validate GitHub v3 API URLs (#1477)
Fixes #1476.
2020-04-09 21:28:23 -04:00
Glenn Lewis e4b511744f Add pointers to structs in slices (#1443) 2020-02-28 09:37:37 -05:00
kadern0 69231319df Change opt param to opts (#1417)
Fixes #1415.
2020-02-09 20:01:54 -05:00
Vaibhav Singh 40fcc261cf Remove custom preview headers from "graduated" APIs (#1355)
Fixes #1351.
2019-12-26 10:09:21 -05:00
anjanashenoy ababee01b0 Add missing LdapDn field in Users class (#1211)
Fixes #1210 for GitHub Enterprise users.
2019-06-25 15:29:59 -04:00
Kautilya Tripathi 8c4c7c1da9 GitHub Repository Invitation API: Remove custom media type (#1068)
Fixes #708.
2018-12-12 20:20:17 -05:00
shakeelrao 8a2df7d66b Add 2FA field to User struct (#1054)
Fixes #1053.
2018-11-16 09:35:38 -05:00
Andy Grunwald 68a79fc6a3 Godoc: Add GitHub API doc link for "Get the authenticated user" (#1034) 2018-10-20 08:39:47 -04:00
Glenn Lewis 5d3c7cb89d Support Preview Hovercard API (#973)
Fixes #875.
Closes #890.
2018-08-10 13:09:23 -04:00
Parker Moore 4430a04b20 Add NodeID to a few structs (#970)
Helps #814.
2018-08-09 21:19:12 -04:00
Sandeep Sukhani eafdb65781 Documentation update for 'OrganizationsListOptions' and 'UserListOptions' (#903)
Fixes #900.
2018-05-03 20:51:46 -04:00
Kshitij Saraogi e48060a28f Migrate IDs to int64 type (#816)
A helper function "Int64" is also implemented to assist the migration of
unit tests.

Refer #597.
2018-01-25 10:59:44 -08:00
Sam Minnée fc60e1f520 Add *ListOptions parameter to 7 methods that support pagination. (#635)
This is an unavoidable breaking API change. To update to new version
without changing behavior, you can provide nil value for *ListOptions.

Bump libraryVersion to 7.

This adds a *ListOptions parameter to 7 methods that support pagination,
but inadvertently omitted this parameter:

-	AuthorizationsService.ListGrants
-	GistsService.ListCommits
-	PullRequestsService.ListReviewers
-	PullRequestsService.ListReviews
-	PullRequestsService.ListReviewComments
-	RepositoriesService.ListPagesBuilds
-	UsersService.ListInvitations

This is needed to support pagination. Without this parameter, it’s not
possible to fetch anything other than the first page (of default size)
of results.

Add _withOptions tests for each of the methods, that ignore the result
but ensure that ?page=2 is added to the API requests.
2017-05-11 21:42:59 -04:00
Dmitri Shuralyov 23d6cb9cac Add support for context package to all endpoints. (#529)
This is a large breaking API change. It is unavoidable and necessary
to resolve #526. This breaking change is part of bump to libraryVersion 3.

It adds ctx context.Context as first parameter to all endpoint methods,
including Do.

Updating for this API change should be easy and the compiler will help
catch instances that need to be updated. For example:

	main.go:193: not enough arguments in call to gh.Activity.MarkRepositoryNotificationsRead
		have (string, string, time.Time)
		want (context.Context, string, string, time.Time)
	...

You should pass the available context as first parameter. If your code
does not have context.Context available and you want to maintain previous
normal behavior, use context.Background(). Don't pass nil context; use
context.TODO() instead if you wish to delay figuring out the best context
to use. Then you can address the TODO at a later time.

Refer to documentation of package context at https://godoc.org/context
for more information.

This commit also changes ./tests/fields to use context.Background()
instead of deprecated oauth2.NoContext.

Resolves #526.
2017-02-20 16:05:42 -05:00
Kevin Burke 82629e0459 Use HTTPS for all developer.github.com links. (#551)
Avoids a redirect and possible tampering.
2017-02-17 20:59:02 -05:00
Dmitri Shuralyov 493b233dca Use single space after period. (#549)
This commit was largely generated by:

	perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')

With additional manual followups to catch the few remaining missed
cases, such as inside non-go files, spaces after question marks, etc.

Fixes #548.
2017-02-15 16:14:26 -05:00
Nick Spragg 30a21ee1a3 Return nil error explicitly when there is no error. (#546)
Helps #536.
Follows #542.
2017-02-13 17:27:33 -05:00
Glenn Lewis f7b63ba4fc Change new([]*...) to slice zero value
This change is a proposal and is open for discussion.

Also fixed a couple locations that were returning nil
instead of returning the valid err.

Change-Id: I62da2980c76d6220ce2ef12e6a1e64b60769ab01
2017-01-31 10:12:48 -08:00
Matthew Dempsky 8808be6605 Avoid unnecessary FooService allocations
Fixes #389
Fixes #390
2016-06-29 07:21:34 -07:00
Glenn Lewis 5c1b3a05b4 add support for new repository invitations
Fixes #371.

Change-Id: I97f2fc28ce048442ee8af3bd11c48b5b2084e09b
2016-06-19 21:24:55 -07:00
Glenn Lewis 4ea1b10b74 replace []Issue with []*Issue and for other large structs as well
Note that this is an API-breaking change but should have minimal
impact on users of this package due to the nice inference
properties of the Go programming language.

Bumped `libraryVersion` to `2` due to API-breaking change as
discussed in #376.

Fixes #180.

Change-Id: Ib386135e6b8f306d1f54278968c576f3ceccc4e7
2016-06-19 19:42:35 -07:00
Glenn Lewis e1bc3a7920 move examples to github_test package in examples_test.go
See #367 for discussion.

Change-Id: I10e26bddebeea2a1485fc4389caab1ff12421382
2016-06-16 15:48:10 -07:00
Glenn Lewis 71e65bb773 document 'since' pagination for Users.ListAll
Fixes #278.

Change-Id: Ia1d0c1f6b395d493714d91e0f6e79dc2506f8fde
2016-06-16 11:24:18 -07:00
Bryan Boreham c2beba44cf Add missing ListOptions to various structs
Make it possible for callers of IssuesService.ListMilestones() and
similar to step through pages of results.
2016-06-08 10:10:06 -07:00
Quinn Slack 1acbd99794 Add UsersService.GetByID method.
Note: GetByID uses the undocumented GitHub API endpoint /user/:id.

Resolves #329 (assuming #332 is also merged).
Closes #333
2016-04-09 11:37:19 -07:00
griffin_stewie 6387a9448d Add "SuspendedAt" field to User struct. 2016-02-03 17:10:20 -08:00