Commit Graph

87 Commits

Author SHA1 Message Date
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
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
Jan Klass
1f01b22de5 Fix typo (#1985) 2019-09-04 08:41:13 -03:00
Abhijeet
153250fbcd adding example for creating PR from fork (#1944)
* adding example for creating PR from fork

* addressing pr feedback
2019-02-24 21:30:57 +10:00
Brian Chavez
3470f45b32 Spellcheck documentation. (#1929) 2019-01-14 08:11:27 -04:00
Brendan Forster
d1528ce57d update docs to include the await keyword (#1924) 2019-01-11 07:31:48 -04:00
Sébastien Ros
2cdc2679b1 Fixing sample (#1879) 2018-10-02 17:43:40 +10:00
Rich Lander
2cb1821295 Updating to more recent repo names 2018-09-24 10:22:29 -04:00
d-a-s
90b0a7c551 appClient - all GitHubApps methods inside subclass (#1853)
In implementing this, I found that `appClient.GetCurrent()` (etc.) don't work, but that there is a subclass, so that `appClient.GitHubApps.GetCurrent()` etc does work. Took me a while to figure it out, thought that updated docs might help others.
2018-07-29 11:47:26 +10:00
Adrian Godong
1515dc2a2f Update github-apps.md (#1843) 2018-07-04 22:29:44 +10:00
Ryan Gribble
ef1994d86f Attempt to clarify GitHubApp docs (#1824)
* Attempt to clarify GitHubApp docs

* Tweak additional notes formatting

* more tweaks
2018-06-29 16:06:03 +10:00
Ehsan Mirsaeedi
f34a4298e4 Mentioning the reset time is based on UTC standard (#1819) 2018-06-20 22:32:12 +10:00
Mark Adamson
596d0cfdcc Fix typo causing compile error (#1804) 2018-06-02 12:50:35 +10:00
Mark Adamson
03ee6d7bb8 Correct upload asset code (#1805)
1. Remove incorrect usage of await on synchronous method
2. Dispose of stream after use
2018-06-02 12:49:17 +10:00
Itai Bar-Haim
5ffc96995f Adding initial support for GitHub Apps. (#1738)
* Added authentication using bearer token.

* Added Installation and AccessToken clients.

* Added new clients to Reactive project

* added support for DateTime serialized as FileTime

* added support for StatusEventPayload

* added support for StatusEventPayload

* Added test for StatusEventPayload and fixed serializer to return that event payload type.

* WIP - added ApplicationClient and related Api Urls.

* Continued implementing Installations support.

* Fixing build (WIP)

* fixed build

* added Account property to Installation. prefer nameof(x) over literal "x".

* fixed according to code review.

* fixed build.

* switched Installation ID from int to long.

* added Permissions and Events properties to Installation.

* added documentation to Application and Installation properties in IGitHubClient.

* wip - added tests to new clients

* wip - fix build

* wip - fixed build.

* added InstallationsClient tests.

* added integration test for InstallationsClient.

* changes requested in code review.

* add Get method for App

* Create GitHubApp response model instead of re-using existing Application response model

* add Get method to observable client

* fixed build (both locally and failed test).

* Fixed documentation and added some missing XML docs.

* added DebuggerDisplay to StatusEventPayload

* updated XML docs and added some missing bits. prefer nameof(x) over literal "x".

* Add xml comments to AccessToken response model and use DateTimeOffset rather than DateTime

* Tidy up XmlComments and make consistent across client and observable client and interfaces

* fixup unit tests to independently verify preview header

* Implement GetInstallation method

* revert commits unrelated to GitHubApps - these can be done on a separate PR if required

* this extra authenticator class doesnt appear to be used anywhere

* undo project file change as it doesnt appear to be necessary

* Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps"

This reverts commit c53cc110b8d807f62fdfeaa7df19e1532d050007, reversing
changes made to 0c9e413d420a4725738644ea5b13af6ec102d456.

* Revert "Revert "Merge remote-tracking branch 'remote/GitHubApps' into GitHubApps""

This reverts commit 02d52b8adf814b6945c60cb59a907a8cd34b1ce7.

* add XmlDoc comments to response models and flesh out installation permissions

* name AcceptHeaders member consistently

* accidentally lost changes to Credentials.cs

* Enhance Intergation test framework to handle GitHubApp settings and discoer tests appropriately
Get code ready for GitHubJWT nuget package but for now just hardcode a JWT in ENV VAR
Add 1 integration test for each method and ensure they are working!

* fixed compiler warnings.

* Added support for Installation=>Id field that arrives in a Pull Request Event payload.

(See the last field in the sample JSON of https://developer.github.com/v3/activity/events/types/#pullrequestevent)

* Change integration test project to netcoreapp2.0 so we can use GitHubJwt nuget package in integration tests

* First cut at some GitHubApp doco

* update mkdocs config

* Moved the Installation property to ActivityPayload, so it's available in all payloads.

This feature is not undocumented, unfortunately, but valid:
https://platform.github.community/t/determining-which-installation-an-event-came-from/539/11

* Split Installation to Installation and InstallationId, and added a comfort method for gaining its AccessToken.

* fixed InstallationId CreateAccessToken to receive IGitHubAppsClient. added (and fixed) docs.

* reverted object-oriented style comfort method and it's docs.

* update all test projects to netcoreapp2.0

* tweak build configs to use 2.0.3 SDK

* also need to update cake frosting build to netcoreapp2.0

* tweak docs some more

* fix convention test failures

* test projects still had some old runtime parts in them!

* travis osx image needs to be at least 10.12 for .NET Core 2.0

* shell script might need the same argument tweak for cake

* more doc tweaks

* Make sure compiler warning output isnt somehow causing Linux and OSX builds to fail

* moar logging for linux/OSX builds

* stop sourcelink on linux/OSX builds to see if that is the problem

* set verbosity to detailed for the dotnet build step

* try new sourcelink and list out remotes

* is travis being weird with git clone?

* SourceLink may be defaulting to true on CI server so explicitly set it as false rather than omitting it

* detailed is a bit too verbose for travis, try normal

* turn sourcelink back on for Linux/OSX

* fix compiler warning

* Try SourceLink.Create.CommandLine instead of SourceLink.Create.GitHub

* CliToolReferences did not update to latest versions

* remove debug origin info

* turn off msbuild output

* go back to SourceLink.Create.GitHub!

* time diff between dev PC and API causes issues if specifying a full 600 second token

* handle extra date format that Installation end point now returns

* field needs to be protected in order to be deserialized

* provide even more buffer for client vs server clock drift

* Update to latest GitHubJwt reference

* go back to SDK 1 since SDK 2 is having sporadic travisCI faliures in TestSourceLink build step

* get appveyor working

* update sourcelink back to latest, and use SDK 1.04 (runtime 1.0.5)
2018-04-16 20:42:23 +10:00
Andrius Bentkus
7aeea34fb2 Add csharp hint to code blocks (#1791) 2018-04-04 20:57:53 +10:00
Ehsan Mirsaeedi
f1b9674110 Improve Rate Limits' Documentation (#1742)
* Improve Rate Limits' Documentation

I added an example about client.Miscellaneous.GetRateLimits().

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md

* Update getting-started.md
2018-01-22 12:59:36 +10:00
Michael Scovetta
73679d0657 Remove extra space before close ticks. (#1699)
This is breaking the layout at http://octokitnet.readthedocs.io/en/latest/http-client/.
2017-10-29 22:07:44 +10:00
Prashant Cholachagudda
2495487608 Fixed code formatting (#1691) 2017-10-23 12:50:09 +10:00
Ryan Gribble
7114bcb41e General updates (#1653)
* Update README and shipping-releases as they are a bit out of date

* Update year/copyright info

* Update cake.frosting to latest for newest dotnet tooling support, and adjust builds for new configuration parameters

* update xunit packages so codelens works for nested test classes (VS2017 15.3 update is also required)

* Fixup VS version and remove win debugging tools
2017-08-16 21:33:03 +10:00
Kristian Hellang
5ee4d64046 Add StringEnum to handle unknown enum values returned from API (#1595)
* Added StringEnum<TEnum>

* Added tests

* Make sure the serializer can work with StringEnum

* Use StringEnum for EventInfo.Event

* Add convention test to assert that all Response models use StringEnum<> to wrap enum properties

* Add Stringnum<> to all response types failing convention test

* Handle StringEnum to Enum conversion when Issue response model populates IssueUpdate request model

* Fix unit test

* Refactor SimpleJsonSerializer to expose the DeserializeEnum strategy so it can be used in StringEnum class

* Need to expose/use SerializeEnum functionality too, so we use the correct string representation of enum values that have custom properties (eg ReactionType Plus1 to "+1")

* fix unit tests, since the string is now the "correct" upstream api value

* Add a couple of tests for the Enum serialize/deserialize when underscores, hyphens and custom property attributes are present

* Compare parsed values for equality

* add convention test to ensure enum members all have Parameter property set

* update test to cover implicit conversions too

* this test should work but fails at the moment due to magic hyphen removal in deserializer causing a one way trip from utf-8 to EncodingType.Utf8 with no way to get back

* (unsuccesfully) expand event info test to try to catch more cases of unknown event types

* fix broken integration test while im here

* Fixed build errors after .NET Core merge

* Value -> StringValue, ParsedValue -> Value

* Don't allow StringValue to be null

* Ignore enums not used in request/response models

* Added ParameterAttribute to almost all enum values

* Ignore Language enum

* Fix failing tests

* Fix milestone sort parameter and tests

* whitespace

* fix milestone unit tests

* Fix StringEnum.Equals ... This could've been embarrassing!

* Change SimpleJsonSerializer Enum handling to only use `[Parameter()]` attributes (no more magic removal of hyphen/underscores from strings)

* Tidy up this integration test while im here

* Only test request/response enums in convention test

* Keep skipping Language

* Remove unused method

* Remove excluded enum types

* Removed unnecessary ParameterAttributes

* Remove unused enum

* Add StringEnum test for string-comparison of two invalid values

* Bring back IssueCommentSort and use it in IssueCommentRequest

This reverts commit 38a4a291d1476ef8c992fe0f76956974b6f32a49.

* Use assembly instead of namespace for Octokit check

* Add failing test to reproduce the issue where only the first enum paramter/value was added to the cache

* Fix deserializer enum cache to include all enum members rather than only the first member encountered

* Use a static SimpleJsonSerializer in StringEnum

* Remove serializer instance in StringEnum

* Add some documentation on StringEnum<TEnum>

* Fix parameter value to resolve failing integration test
2017-06-25 19:29:57 +10:00
Elias Ojala
8877eea1cb Added syntax highlighting to docs/getting-started.md (#1619) 2017-06-25 19:20:22 +10:00
Luke Watson
afb81b7c48 ReleaseUpdate should be NewRelease in create release section 2017-06-07 09:26:24 -04:00
Naoto TAKAHASHI
30e3ec8f61 [doc/issues]fix typo 2017-05-07 15:27:15 +09:00
Ryan Gribble
79dc11d89f Update release code sample to client.Repository.Release 2017-04-02 22:59:40 +10:00
Sean Killeen
3a1070feca Add docs snippet for label coloring (#1530)
* Update label docs to reflect color information

Resolves #790

* Clarify doc language

Because I couldn't just have a one-commit PR. No, that'd be too easy.

* Futher clarification

I guess we might as well make it right.
2017-01-10 07:11:11 +10:00
Sean Killeen
49c2d52030 Add ApiInfo Rate limiting description to Getting Started (#1524)
* Draft section on ApiInfo in getting started

* typo: to --> do

* Add link to github api

* Add note on authenticated client limits

* wording tweak

* Point to better API doc link

* change variable init in code sample
2017-01-01 15:20:10 +10:00
Abdul Rehman Gill
e893895a0b Update git-database.md
"GitDatabase" has been removed. Use "Git" instead.
2016-09-30 13:27:45 +05:00
Brendan Forster
8dcb1db0da just marking up some code 2016-09-29 11:43:22 +10:00
Phil Haack
693cc29dd5 Code to test URL for an enterprise instance. (#1404)
* Code to test URL for an enterprise instance.

Based on code we use in GitHub Desktop for Windows.

* Add an example of the enterprise probe

* Add helpful constructor to EnterpriseProbe

* Suppress code analysis warning
Add xml comments to ctors and make consistent with GitHubClient/Connection etc

* Update getting started to use the new EnterpriseProbe ctor
2016-09-21 15:28:12 +10:00
Brendan Forster
74feebbffb add some examples to pagination docs (#1378) 2016-06-14 16:38:04 +10:00
Brendan Forster
2ed5999f08 Merge pull request #760 from octokit/api-paging-part-deux
Pagination Support
2016-03-14 15:50:25 +11:00
Alex P
31fc029b56 #1130 Change issue sample placeholder to indicate that they should be changed 2016-03-07 09:09:09 +02:00
Thijs Brobbel
4f5a2c37a8 Add proper syntax highlighting to docs 2016-03-04 08:51:29 +01:00
Brendan Forster
0ea28a94f3 added some basic documentation 2016-02-14 17:22:40 +11:00
Brendan Forster
46a020ed77 --cached, not -cached 2016-02-02 18:17:54 +10:30
Brendan Forster
32e8d9059c moving things around 2016-01-27 13:08:26 +10:30
Brendan Forster
64a0cda80c added a sample script using Octokit 2016-01-27 12:36:55 +10:30
Brendan Forster
47e06b5300 documenting running up the docs locally, and a bit of cleanup 2016-01-27 12:36:49 +10:30
Brendan Forster
62453830b3 Merge branch 'master' into documentation 2016-01-27 11:06:16 +10:30
Phil Haack
9f8cb5634b Merge pull request #1055 from JakesCode/patch-3
Update labels.md
2016-01-03 13:02:54 -08:00
Jake's Code
90c34140f1 Update labels.md 2016-01-01 20:24:56 +00:00
Jake's Code
929883af9b Clarified "_issuesClient" 2016-01-01 02:54:13 +00:00
Haroon
538b33bba1 💄 2015-11-03 21:11:45 +00:00
Haroon
3f6297ae5a Prepping searching code doc 2015-10-31 22:08:49 +00:00
Haroon
93393b1996 💄 2015-10-31 10:59:51 +00:00
Haroon
d5e69e32fc Searching users docs 2015-10-30 23:13:08 +00:00
Haroon
44efdc902c 💄 2015-10-30 21:45:44 +00:00
Haroon
f8379c7252 Move things around a bit 2015-10-30 21:44:54 +00:00
Haroon
472f2535b7 How do we use the searchRepos 2015-10-30 21:30:15 +00:00