Commit Graph

541 Commits

Author SHA1 Message Date
Union Palenshus 77213430f1 Adding support for the Device Flow Oauth authentication pattern (#2310)
Adding support for the Device Flow Oauth authentication pattern
2022-04-20 16:29:10 -05:00
Pedro Brito b829a8443e Add Swift language (#2344)
Co-authored-by: Pedro Brito <Pedro.Brito@checkmarx.com>
2021-08-23 09:27:09 -03:00
Sean Killeen 57fe2ce193 Add repository topics support (#2246) 2021-02-25 10:40:25 -04:00
Ivan Josipovic 6105a9deaf preview support for repository visibility (#2217) 2021-02-21 18:38:00 -04:00
Phil Haack e40c792e27 Change Payload to a Dictionary<string, string> (#2303)
When serializing the `NewDeployment` type, the `Payload` is serialized as an escaped string because JSON.NET doesn't know it's meant to be JSON.

This causes a problem when you call the API because the Payload is supposed to be a JSON dictionary that's just part of the overall payload. It's not supposed to be an escaped string.

That's why the JSON deserializer fails on it. Not only that, any deployments created using the current Octokit.net will create an invalid payload.

This PR fixes it by changing the type of `Payload` to a dictionary. THIS IS A BREAKING CHANGE, but the old behavior was broken so it forces a new correct behavior.

Fixes #2250
2021-02-21 17:11:51 -04:00
Samantha Houts 7400420c92 Add "project" to the IssueNoMetadataQualifier (#2227)
Allows you to search for issues with no project.
2021-02-13 16:34:36 -04:00
Sam Cackett 46787d2cb8 Add DeleteBranchOnMerge option for repositories (#2268) 2021-02-13 16:29:09 -04:00
Eric Carlson 20549430e5 Add support for multi users and orgs in SearchCodeRequest (#2291) 2021-02-13 16:28:32 -04:00
Jose de Jesus Medina df77be29b1 Add license to repository search (#2258) 2020-10-06 09:50:40 -03:00
Jose de Jesus Medina 66a6781584 spellcheck round 2 (#2259) 2020-10-06 09:47:36 -03:00
Brendan Forster 08e7c14ced drop unused code related to PORTABLE flag (#2202) 2020-06-08 08:33:27 -03:00
Martin Alex Philip Dawson 8d3e7b3c2c add support for organization web hooks (#1884) 2020-06-07 16:53:20 -03:00
Bob Langley 1c026db1a9 Add support for creating project cards from PRs (#2185) 2020-06-07 13:54:56 -03:00
Brendan Forster f6a9a47200 Graduate review requests to what eventually shipped (#2153) 2020-03-15 11:33:32 -03:00
Jordan Brown b904ada89f Implement Deployment Statuses Preview (#1895)
Co-authored-by: Brendan Forster <brendan@github.com>
2020-02-25 19:59:03 -04:00
Brendan Forster 5de3791626 ensure datetime offset is encoded correctly for search APIs (#2091)
* add failing integration test for timestamp

* make the test pass by encoding the value

* generalize this pattern for now

* update tests to reflect change in date formatting
2020-02-09 22:13:44 -04:00
Haytam Zanid 911dd4a9c3 Double quote issue labels in search API (#2084) 2020-02-09 11:38:59 -04:00
Brendan Forster 28892df03d some cleanup of the project (#2063) 2020-01-23 14:51:00 -04:00
Henrik Andersson a05d49e81d Expose affiliation parameter when listing collaborators (#2043) 2019-11-18 07:10:35 -04:00
Jose de Jesus Medina fd6bca910c fix language with spaces giving wrong results (#2038) 2019-11-13 09:31:24 -04:00
Jose de Jesus Medina 5eb9f06b24 Fix typos in comments (#2040) 2019-10-30 13:51:20 -03:00
Henrik Andersson 8b263cdc0f Add get/update/delete methods for organization memberships (#2014) 2019-10-21 20:08:58 -03:00
Jose de Jesus Medina 90812951f4 add JupyterNotebook to Repository Search (#2032) 2019-10-21 20:02:33 -03:00
Eric Carlson 3e7c70cf4e add support for multiple extension filters (#2019)
* add support for multiple extension filters

* update documentation, use ienumerable instead of ilist
2019-10-03 08:53:33 -03:00
Brendan Forster ce5ea64428 migrate to dotnet-format tool (#2016)
* migrate to new dotnet-format tool in build script (run on local build)
* reformat code
2019-09-24 11:34:50 -03:00
Brendan Forster 8cd0b341dd Begin implementation of Enterprise ManagementConsole API, redux (#2010)
* Initial implementation of ManagementConsole - maintenance mode

* Add environment var support for management console password for integration tests

* Add reactive client and unit tests

* Update some xmlDoc

* I think this is a better way to setup the underlying baseUri on IConneciton, to achieve managemet console access rather than requiring a specific GitHubClient that cant call normal API's
Instead, the management client methods can check the base Url and if it contains /api/v3/ they can set their relative endpoint Uri to include a leading "/" which will cause the /api/v3/ to be removed.

* Update EnterpriseClient.cs

Fix xml comments

* Update IEnterpriseClient.cs

Fix xml comments

* Still trying to get the xmDoc perfect, thanks app veyor :)

* XmlDoc'ing my way to success

* Add specific test attribute for management console tests

* check chronic string empty/null

* Use helper's password field in test

* Tidy up maintenance mode tests by using a context/destructor to manage the initial/end state of maintenance mode

* make internal and tidy up URL concatenation

* move GHE endpoint fixup inside ApiUrls methods

* Rework request object to be the correct structure so SimpleJsonSerializer can be used to serialize it.  Remove MaintenanceDate class and just pass in the Date/string for when
Still need to use UrlFormEncoding rather than json in the POST body though...

* Create abstract base class for FormUrlEncoded parameters (similar to existing RequetParameters) and inherit from it in UpdateMaintenanceRequest

* Fix maintenance context logic - destructor should always turn maintenance OFF regardless of initial requested state

* Fix xml comment

* Fix Xml comment

* Those pesky xml comments!

* Fine, I give up!

* Fix string.Format

* fix bad rebase

* fix failing convention tests

* restore missing whitespace

* writing some docs

* some edits

* edit
2019-09-22 15:09:56 -03:00
Henrik Andersson fafbf33b78 Implement Draft Pull Requests (#2009)
* Add draft PR preview header

* Add Draft property to models

* Update pull requests client and tests to use draft PR accept header

* Update observable pull requests client and tests to use draft PR accept header

* Add integration tests to create and retrieve draft pull requests
2019-09-22 13:38:56 -03:00
Brendan Forster 6433b9123e fix timezone offset handling (#1988)
* port tests to use DateTimeOffset

* drop the whitespace when emitting DateTimeOffset values

* tidy up stale regions
2019-09-16 10:27:27 -03:00
Ben McMorran 70fe726954 Correctly support language filter in repo search (#1951)
* Correctly support language filter in repo search

* Fix failing client test

* Use the correct language code for C++
2019-04-01 13:55:07 +10:00
Patrick d16ac98d00 DateRange does not include time #1904 (#1905)
* DateRange does not include time #1904

* DateRange does not include time #1904

* DateRange does not include time #1904

* DateRange does not include time #1904

* DateRange does not include time #1904

* Requested changed by ryangribble

* Update to Obselete Attribute messages

#1904 #1905
2019-03-19 21:03:14 +10:00
Ryan Gribble cf442499ff add RequiredApprovingReview preview functionality to branch protection calls (#1912) 2019-01-30 21:20:50 +10:00
Patrik Svensson 64cecbb264 Adds missing OAuth login request parameters (#1919)
* Adds support for 'login' parameter
* Adds support for 'allow_signup' parameter

Closes #1918
2019-01-30 21:12:39 +10:00
Ryan Gribble d166a8c142 Implement changes to Checks API for Annotations models and re-request endpoint (#1857)
* Attempt to handle both old and new annotations models so we support the changes on github.com as well as still support GHE2.14
add Path and AnnotationLevel fields
flag Filename and WarningLevel as deprecated/obsolete
also flag BlobHref as deprecated on NewCheckRunAnnotation
Adjust ctors to handle new and legacy field options

* adjust tests to remove use of obsoleted fields

* fix a couple of other tests using unrelated obsoleted fields

* Mark check suite Request method and request object as obsolete

* Add Rerequest() method to normal and observable clients
Add unit and integration tests

* add StartColumn and EndColumn as optional fields for CheckRunAnnotation response and NewCheckRunAnnotation request

* remove integration tests for Request() method as they no longer work on github.com anyway
2018-09-03 20:52:03 +10:00
Jordan Brown 08853d21d8 Fixes check runs taking over 2017 years to complete (#1852)
* Fixes check runs taking over 2017 years to complete

* Make StartedAt and Status fields nullable, since they dont have to be provided on new or update requests
2018-07-25 20:07:59 +10:00
Ryan Gribble 101522070d Release v0.31 - Check yo' self! (#1851)
* Fix whitespace/formatting with /FormatCode build option

* Update release notes

* fix a few failing integration tests

* Adjust required fields on UpdateCheckRun and NewCheckRun request models and fix tests
Tidy up field accessors and XmlDoc comments

* Update date in ReleaseNotes

* Keeping request models simple (avoid inheritance) - makes it easier when we move to generated models
2018-07-21 18:12:42 +10:00
Ryan Gribble c5d5df5b08 Implement Check Runs API (#1847)
* Add CheckRunEventPayload

* add CheckRunEventPayload into all the right places

* forgot integration tests for RepositoryId methods (+1 squashed commits)

Squashed commits:

[b2445bf3] Implement Create CheckRun methods for normal and observable clients including unit and integration tests and xmldoc comments

* Implement Update CheckRun method
Refactored NewCheckRun to inherit CheckRunUpdate since they share all fields except HeadSha

* Implement GetAllForReference method

* Implement GetAllForCheckSuite method

* tweak XmlDoc to match github documentation

* Implement Get method

* Implement GetAllAnnotations
Moved CheckRunAnnotation model from Request to Common and added a parameterless ctor, since it is now a response model as well as a request model

* Split common CheckRunAnnotation model into separate response and request models due to different field and ctor requirements
Rename other CheckRun request sub classes to be consistent with NewCheckRunAnnotation (eg NewCheckRunOutput, NewCheckRunImage, etc)

* add title field back into CheckRunAnnotation

* fix up XmlDocs

* fix mutable response property - hooray for convention tests!
2018-07-19 08:29:12 +10:00
Jeysson Jose Guevara Mendivil 8407369485 Added 'Archived' flag to Repository response. (#1845)
* Added 'Archived' flag to Repository response.

* add Archived support to repository update
add Archived support to search repo and search issues

* add archived field to ctor
2018-07-17 12:21:48 +10:00
Ryan Gribble 4df21a61de Implement Check Suites API (#1846)
* Check run request models

* Check Run response models

* Check run clients

* Check run ApiUrls and AcceptHeaders

* Pack it all together for now

* Add missing accept headers to connection calls

* Standardize class definitions

* Standardize function names

* Merge ICheckRunAnnotationsClient into ICheckRunsClient

* Properly organize clients

* Cleanup CheckRun response model

* Fix slug check run urls

* Add checks installation permission

* Use StringEnums where appropriate

* Cleanup check run output models

* Flesh out CheckSuite model

* Delete CheckRunsList

* Remove a sealed, fix some line endings

* Adding check suite models

* Skeleton check suite client implementation

* Add check suite ApiUrls

* Flesh out check suites client

* Add parameterless CheckRun constructor

* Add DebuggerDisplay to checks models

* Add observable checks interfaces

* Add return values to POST and PATCH check clients

* Fix some check suite client return values

* Skeleton reactive checks implementation

* Implement observable checks clients

* Remove rogue tabs

* Add CheckSuiteEventPayload

* Add CheckRunEventPayload

* Add DebuggerDisplay attributes to checks API payloads

* Properly nullables check suite/run conclusion

* Add CheckSuiteEventTests

* Fix checks client accessor naming issues

* Add missing Text field to CheckRunOutput

* Marks CheckRunUpdate's conclusion as nullable

* Fix reactive checks client naming

* Today I learned DateTimeOffset is a struct

Makes CheckRunUpdate's DateTimeOffsets nullable

* Modify check clients to put slug version before repo id version

* Add nullable to CheckRun.CompletedAt

* Implement parameterless ICheckRunsClient.GetAllForReference and GetAllForCheckSuite

* Add missing RequestParameters base to CheckSuiteRequest

* Implement checks API GetAll methods

* Bring parity to Reactive checks clients

* fix project settings to get GitHubApp helper working again

* remove un-needed InstallationId setting - provide helper method to find installation based on owner

* fix up request object ctors based on required/optional parameters

* fix up request object ctors based on required/optional parameters

* add some initial integration tests for CheckSuites and CheckRuns including some helper methods

* Add test for Request CheckSuite
Fix Request CheckSuite to use correct Uri
Fix Request CheckSuite return type as it doesnt return an object
Fix CheckSuiteTriggerRequest ctor to make required fields mandatory

* simplify Get CheckSuite test to not require as much data setup

* Add test for CheckSuite GetAllForReference

* Add test for CheckSuite UpdatePreferences

* rename response models

* rename CheckSuitesList to CheckSuitesResponse and use as response to the GetAll calls

* Fix tests

* Fix observable

* fix model convention tests

* remove CheckRuns so we can focus only on CheckSuites for now

* naming things is hard

* oh so many unit tests for CheckSuites methods

* make client mockable

* Fix issue with .Max() when no results returned

* fix request parameter names

* add Xml doc comments

* Add XmlDoc comments to request/common model objects

* rename class to match usage

* tidy ups

* xmldoc for observable clients

* fix method order

* add observable unit tests and get them passing

* Add Observable unit tests and get them passing

* add observable integration tests

* tidy up ApiUrl method name

* whitespace/using tidy ups

* Ensure CheckSuiteEventPayload class is handled in deserializer and add to activity test

* add response model XmlDoc comments

* missed one xmldoc

* add xmldoc to NewCheckSuite request and remove HeadBranch property as it doesnt exist anymore

* add some extra check suites integration tests
2018-07-14 20:01:41 +10:00
Ryan Gribble 043e64b89f Implement new Project Card archiving (#1842)
* add Archived to ProjectCard response
add Archived to ProjectCardUpdate
update integration tests

* Add ProjectCardRequest model and update GetAll calls to use it
Update unit tests
Update integration tests

* skip_branch_with_pr still ends up building the branch on the initial push, so let's only build master instead
2018-07-11 20:38:54 +10:00
William Quelho Ferreira 74dc51a6f5 [WIP] Fixes #1718 Implement Repository Transfer functionality (#1813)
* Add "transfer repository" accept header

* Create RepositoryTransfer class

This will be used to send the POST request to initiate the transfer.

* Create Ensure method to check for empty or null arrays

* Change arg name in Ensure for nonempty arrays

array -> value

* Add xmldoc for ArgumentNotNullOrEmptyArray

* Create Transfer method in IRepositoriesClient

* Implement Transfer method in RepositoriesClient

* Fix typo in xmldoc for Transfer

* Add <returns> to Transfer xmldoc

* Create Transfer method in IObservableRepositoriesClient

* Implement Transfer in ObservableRepositoriesClient

* Add DebuggerDIsplayAttribute do RepositoryTransfer

* Add unit tests for RepositoryTransfer constructors

* Change TeamId property type to IReadOnlyList<int>

* Rewrite DebuggerDisplay property into something more succint

* Make new Ensure method into an IEnumerable<T> checker

* Add XmlDoc to RepositoryTransfer

* Tweaks to first ctor XmlDoc

* Create basic unit tests for Transfer

* Create ApiUrls.RepositoryTransfer

* Use ApiUrls.RepositoryTransfer to get URI in Transfer

Previous implementation used wrong URI

* Start implementing RepositoriesClientTests.TheTransferMethod

* Implement org -> user transfer integration test

* Implement user -> org transfer integration test

* [WIP] Implement user -> org transfer with teams

Implementation doesn't work, API usage seems correct.

* Mark transfer user -> org w/ teams integration test with FIXME

* Add second end point URI to ApiUrls

* Add other Transfer overload to RepositoriesClient for other end point

* Create unit tests for other Transfer endpoint

* Add overload to IRepositoriesClient

* Add integration tests for overload

* Reorganize unit tests for TheTransferMethod

* Rename id to repositoryId

* Reorganize unit tests for RepositoriesClientTests.Transfer

* Add second endpoint to IObservableRepositoriesClient

* Add XmlDoc to second Transfer endpoint

* Add XmlDoc to second Transfer endpoint in RepositoriesClient

* Reimplement "with teams" integration tests using TeamContext

* Rename integration test for consistency

* Add asserts to actual ownership transfer

* Rename RepositoryTransfer.TeamId property to TeamIds

* Add awaiit to ThrowsAsync in RepositoriesClientTests

* Put await in right places for unit tests

* Add Ensures for Transfer method in RepositoriesClient

* Add XmlDoc to ApiUrls.RepositoryTransfer with repo id

* Update XmlDoc for RepositoryTransfer constructor and teamIds property

* Rename currentOwner to owner

* Add Ensure guards to ObservableRepositoriesClient.Transfer methods

* Add unit tests for ObservableRepositoriesClient
2018-06-24 22:33:33 +10:00
Ryan Gribble 3b2be81486 Release v0.30 - Where Have You Been All My Life? (#1816)
* run FormatCode build task to fix whitespace/formatting

* correctly flag some GitHub Enterprise tests

* Add Release Notes

* tweak appveyor to not build branch in the repo, when a PR exists already

* travis to only build master branch and PRs

* output actual "dotnet run" command being executed for cake.frosting builds

* update latest Cake.Frosting

* use normal verbosity at the moment due to apparent conflict with "verbose" and latest SDK on appveyor

* try using double dash so dotnet executable doesnt look at --verbosity argument

* travis OSX couldn't download SDK 2.0.3 anymore, lets try the latest 2.1.300
2018-06-18 08:34:14 +10:00
Jozef Izso fc3e9c2cd2 Implement improved labels API (#1802)
* Implement new attributes for labels

* Include correct API header in all Labels calls

* Add integration tests for Create and Update methods for labels

* Use improved labels API in observable client

* found even more endpoints that need the preview header!

* RemoveFromIssue actually returns the list of remaining labels rather than null.  This change should be source compatible but not binary compatible

* Implement new labels search method in SearchClient

* Implement reactive client SearchLabels

* Improve documentation for label search methods

* more comment tidy up
2018-05-17 21:48:45 +10:00
tasadar2 f771147f1d Added a pre-receive environments client (#1796)
* Added pre-receive environment client

https://developer.github.com/v3/enterprise-admin/pre_receive_environments

* Added unit and integration tests for the pre-receive environments client

* moved test setup outside of tests

* fixed unit test

* Added reactive components for pre-receive environment endpoints

* Debugger display's and non public setters on response object conventions

* removed redundant parameter attributes

implemented update request independently of new request
changed ints to longs for future proofing
updated unit tests
changed update integration tests to create a new update request to ensure optional values function

* updating reactive environmentids to longs as well

* also converting response id to a long

* Fixed an incorrect unit test

renamed some test variable names for consistency
Added mockable ctors on responses, and parameterless ctors to maintain functionality

* Adding missing state parameter

* rename client member accessor to singular form in accordance with octokit naming conventions

* fixup tests

* add integration tests for observable client
2018-05-08 21:49:52 +10:00
Jordan Brown 82b1b2144f Adds MaintainerCanModify to PullRequest (#1771)
* Adds MaintainerCanModify to PullRequest

* Make MaintainerCanModify nullable

* Tweak MaintainerCanModify doc comment

* Add MaintainerCanModify to NewPullRequest

* Add MaintainerCanModify to PullRequestUpdate

* Update NewPulRequest tests

* Convert tabs to spaces

* Fix PullRequestUpdate and NewPullRequest doc comments

* Revert "Update NewPulRequest tests"

This reverts commit f20dfa7d0efc5ed18b7d622a0eb9b5d1f578f9a5.

* Make MaintainerCanModify fields nullable

* tweak doco comment and make setter public so it can be used
2018-04-23 21:27:44 +10:00
Ryan Gribble 600c8657e4 Remove method/members previously deprecated (#1780)
* removes obsolete OranizationsClient.GetAll (replaced with GetAllForUser)

* removes obsolete PullRequestsClient.Comment (replaced with ReviewComment)

* removes obsolete TeamsClient.GetMembership (replaced with GetMembershipDetails)
removes obsolete TeamsClient.AddMembership (replaced with AddOrEditMembership)
removes obsolete TeamsClient.AddMembership (replaced with AddOrEditMembership)
removes obsolete TeamMembership response class (replaced with TeamMembershipDetails)

* removes obsolete RepositoryBranchesClient.GetRequiredStatusChecksContexts (replaced with GetAllRequiredStatusChecksContexts)
removes obsolete RepositoryBranchesClient.GetProtectedBranchTeamRestrictions (replaced with GetAllProtectedBranchTeamRestrictions)
removes obsolete RepositoryBranchesClient.GetProtectedBranchUserRestrictions (replaced with GetAllProtectedBranchUserRestrictions)

* removes obsolete RepositoryTrafficClient.GetReferrers (replaced with GetAllReferrers)
removes obsolete RepositoryTrafficClient.GetPaths (replaced with GetAllPaths)

* removes obsolete constructors from BranchProtectionUpdateSettings and UpdateTeam request models

* removes obsolete Assignee property from NewIssue and IssueUpdate request models (replaced with Assignees)
2018-04-22 09:58:06 +10:00
mkArtak 6577c3ccba Enable support for milestone-based issues queries (#1788)
* Added support for Milestone filter in SearchIssuesRequest

* Fixed some styling issues to match with the style of the existing code

* Wrap milestone value with double quotes as milestones can contain spaces

* Allow milestone filter to contain double quotes

* Ability to search by milestone exclusions

* Moved the EscapeDoubleQuotes method to StringExtensions
2018-03-28 16:45:51 +10:00
Itai Bar-Haim 4e804f61a6 Prefer using nameof(x) over literal "x" (#1781)
* updated XML docs and added some missing bits.

* prefer nameof(x) over literal "x"
2018-03-07 20:43:10 +10:00
Ryan Gribble 0f0a0dc2b5 Release v0.27 - On a Roll (#1687)
* Fix integration test - protected branch status can now only be retrieved by an authorized user

* Fix integration test - labels in octokit.net repo were renamed

* Run build task "FormatCode"

* Update release notes for v0.27
2017-10-07 13:15:14 +10:00
Ryan Gribble e93646c9f1 Implement Nested Teams preview API changes (#1682)
* Add new AcceptsHeader
add Parent field to Team
add ParentId field to NewTeam and UpdateTeam
update Create Edit and Delete Team methods to use preview header

* Implement new API call GetAllChildTeams()

* Implement GetAllChildTeams for ObservableClient

* add integration test for observable client

* Add pagination tests for GetAllChildTeams

* Add NestedTeams preview header to all the API calls that use it

* Update tests for accepts header

* Add accepts header to observable client calls

* Fix DELETE implementation to use correct overload

* Fix tests - parent and child teams must be visibility Closed whereas the default if not specified is Private

* make sure all tests are flagged as [OrganizationTest]

* Make sure Update tests change the parent of the team

* Update new methods with NesterTeams preview API header and adjust tests
2017-10-04 16:21:42 +10:00
Ryan Gribble da0c7a5785 Implement Team Membership changes (#1670)
* Fixup TeamContext helper name

* Implement overload for GetAllMembers to take request parameter

* Update tests

* Implement Obersvable client changes

* Observable tests

* Implement AddOrEditMembership function returning a new response model, and obsolete the old AddMembership function returning an enum

* Implement GetMembershipDetails function returning new TeamMembershipDetails response model, and obsolete the old GetMembership function returning an enum

* Clarify that an exception is thrown when not a member

* Add integration tests for AddOrEditMembership and GetMembershipDetails

* fixup exception test for observable client

* Update wording of obsolete message
2017-09-26 21:37:43 +10:00