136 Commits

Author SHA1 Message Date
Colby Williams f9fb116eab [FEAT]: Add support for Public Keys API (#2945)
* Add support for /mets/public_keys/<keyType>

* "files.insertFinalNewline": false

* revert and make setttings.json change csharp only

* formatting

* remove final new line

---------

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
2024-12-27 14:05:00 -06:00
Nick Floyd 6565a07974 [BREAKING CHANGES]: int to long Ids for PreReceiveHook, Deployment Environments, Repository, Org Team, Repo Invitations, Public Key, Project Cards, Organization Invitation, Migrations, GpgKey, Deployment, Authorizations, Accounts / Profiles, Codespace / Workspaces (#2941)
* Fixes ids for Releases, Collaborators, and Contributors

* updates the interface for releases

* update the obverable release client

* updates ids from int to long based on GH database schema

* converts a test condition to use the proper type

* updates generated paging and observable classes
2024-06-26 10:57:30 -05:00
Colby Williams c2aee1ac54 [FEAT]: Create a GitHub App from a manifest
* Create a GitHub App from a manifest

* Add missing InstallationPermissions

* observable and tests

* Remove ManualRoute on Observable route

---------

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
2024-06-24 12:24:45 -05:00
Colby Williams 1053a2045d [FEAT]: Search based on repository custom property (#2936)
search based on repository custom property
2024-06-21 12:09:43 -07:00
Colby Williams 9a3177e385 [FEAT]: Custom Properties (#2933)
* add custom properties model and clients

* observable

* observable tests

* add search

* error CS8370: 'target-typed object creation'

* Error CS8370: 'target-typed object creation'

* add patch with body that return status code

* fixes for failed ConventionTests

* working UnitTests

* (de)serialization and model tests

* Update Repository.cs
2024-06-17 15:01:20 -07:00
awedist 7d54cb0d85 feat: Implement dependency review and dependency submission APIs (#2932)
Implement dependency review and dependency submission

Co-authored-by: André Pereira <Andre.LuisPereira@Student.HTW-Berlin.de>
2024-06-14 17:03:11 -05:00
Tom Longhurst cd1835326b Fix xUnit Warnings (#2906)
* Fix xUnit Warnings

* Fix

* Fix formatting in AsyncPaginationExtensionGenerator.cs

---------

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2024-04-15 13:19:26 -07:00
skyemcleman 41d5d240ec feat: Add create organization invitation via email (#2895)
* Add API request to create org invitation

* Add tests for create org invitation

* Add IObservable API request to create org invitation

* Add tests for IObservable create org invitation
2024-03-11 13:02:31 -05:00
Mihail Gribkov 4254287aef [feat] Add Rocket & Eyes reactions to ReactionSummary 2024-01-16 16:20:48 -06:00
Tom Longhurst 958bc5f1f8 [feat]: SDKs for ActionsArtifacts APIs 2023-09-25 14:16:41 -05:00
Liam Neville dcc31b8e0c [Feat] Add suspended_at and suspended_by to the Installation model 2023-09-21 16:12:30 -05:00
capdiem c40c6b8e5c fix(SearchIssuesRequest): wrap label in quotes if it contains spaces (#2767) 2023-08-31 08:51:53 -05:00
Jordan Dominion d7fd665622 [Breaking Change]: Fix DeploymentStatus IDs Overflowing (#2736) 2023-07-03 17:01:24 -05:00
Liam Neville afac3e0bcf Add CreatedAt to WorkflowJob model (#2729)
* make some fields nullable on workflowjob

* add CreatedAt to WorkflowJob model
2023-06-26 14:23:40 -07:00
Heath Stewart 7f11726852 [Bug] Correctly deserialize CollaboratorPermissionResponse (#2682)
Fixes #2681
2023-03-10 12:09:08 -06:00
Heath Stewart 8ba882e98d Add StateReason to IssueUpdate (#2665)
Fixes #2664

Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
2023-02-21 16:03:20 -06:00
notauserx 46b5077b16 add islocked filter to SeachIssuesRequest (#2623)
* add islocker filter to SeachIssuesRequest

* update docs

* Update docs/search.md with review suggestions

Co-authored-by: Keegan Campbell <me@kfcampbell.com>

Co-authored-by: notauserx <notauserx@users.noreply.github.com>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2022-11-30 15:20:19 -08:00
Martin Costello 8f01a31694 [feat]: Adds Actions workflow API clients 2022-11-23 09:35:58 -06:00
Chris Simpson 971fa50d6e Base classes need protected setters, ActivityPayload had privates (#2591) 2022-10-07 12:32:36 -05:00
Hans Bakker 098557b767 Adds missing fields for deployments API (#2560) 2022-09-12 13:37:54 -05:00
notauserx 536e5c3737 feat: adds active lock reason to issue (#2525) 2022-08-05 16:44:17 -05:00
Chris Simpson 9af552eeaa feat: Add missing properties to RepositoryUpdate (#2492) 2022-07-22 14:49:08 -05:00
Chris Simpson 8b5a7fceaf feat: Fixing master > main in integration tests (#2489) 2022-07-20 17:17:10 -05:00
Matt 0e469a9e3b [feat] Deployment task is arbitrary string value (#2413) 2022-07-13 12:49:57 -05: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
Miguel Ventura 36829cba3a Fix property types in PullRequestCommit (#2224)
PullRequestCommit Author and Committer fields were mistakenly typed with
Committer when they should be of type User.

Previously the types of properties were:

* `PullRequestCommit.Author/Committer`: `Committer`
* `Commit.Author/Committer`: `Committer`

Correct types should be:

* `PullRequestCommit.Author/Committer`: `User`
* `Commit.Author/Committer`: `Committer`

These fields always fail to deserialize in the API calls but produce no
errors, only objects with default values.
2021-02-13 16:33:35 -04:00
Jose de Jesus Medina df77be29b1 Add license to repository search (#2258) 2020-10-06 09:50:40 -03:00
Brendan Forster d02a230172 some tidy up before cutting the release (#2201) 2020-06-07 18:25:51 -03:00
Martin Alex Philip Dawson 8d3e7b3c2c add support for organization web hooks (#1884) 2020-06-07 16:53:20 -03:00
Mitch Denny b9d1f448d4 Handle requested_action field for check-runs. (#2197) 2020-06-05 16:59:00 -03:00
Brendan Forster 287861e4a7 rewrite the setup of responses to use a standard helper function (#2177) 2020-04-14 11:30:15 -03:00
Brendan Forster 4b0e7255b1 remove all usages of TaskFactory in test suite (#2164) 2020-03-31 16:57:16 -03:00
Haytam Zanid 911dd4a9c3 Double quote issue labels in search API (#2084) 2020-02-09 11:38:59 -04:00
Jose de Jesus Medina fd6bca910c fix language with spaces giving wrong results (#2038) 2019-11-13 09:31:24 -04:00
Brendan Forster aeb8d19f29 address new Travis build warning (#2017)
* make explicit that which previously was fine

* suppress build warning
2019-09-24 11:19:10 -03:00
Brendan Forster eb65e090ca next batch of test cleanup (#2004) 2019-09-20 10:41:04 -03:00
Brendan Forster 45bc5eced7 autofix tests based on feedback from xunit analyzers (#1997) 2019-09-16 19:46:40 -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
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
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
Ryan Gribble 23b25f5922 add GraphQL Node ID's to response models (#1806)
* add node_id to Deployments payloads (Deployment and DeploymentStatus and Account/User/Organization)

* add node_id to gist responses

* add node_id to Git Blob

* add node_id to Git Commit response

* add node_id to GitReference response

* add node_id to everything that inherits GitReference

* add node_id to Issue

* add node_id to IssueComment/IssueEvent

* add node_id to Label

* add node_id to Milestone

* add node_id to Project/ProjectCard/ProjectColumn

* add node_id to Reaction

* add node_id to Release/ReleaseAsset

* add node_id to Team

* add node_id to Repository.RepositoryContributor/RepositoryInvitation/RepositoryTag

* add node_id to Commit related responses

* Add node_id to PullRequest related responses

* Add node_id to any response models it was found to be missing, based on auditing integration test responses

* remove unused test variable that was using a response ctor

* fix tests that need to handle node_id now

* Committer is a request object as well as response, so make nodeId optional

* fix test
2018-06-29 15:41:50 +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
tasadar2 3345f76fc9 Adding a convention test to detect whether a model has a constructor exposing all properties (#1798)
* Added a convention test to detect a model constructor exposing all properties

* add ctors to classes where they are missing

* rename ctor parameters that dont match properties

* add missing parameters to existing ctors

* add specific PunchCard ctor to allow mocking, and update test to resolve call ambiguity

* Added base class properties to the convention test

Added member exclusion attribute

* Updated newly offending classes

2 excludes and 2 ctors

* rename exclusion attribute to be a bit shorter
2018-04-25 21:03:13 +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
Ryan Gribble 41b4059c11 Deserializer should handle nullable StringEnum<T> (#1760)
* add deserializer tests for nullable enums, StringEnum and nullable StringEnum properties

* Fix deserializing nullable structs by using the underlying type when nullable

* StringEnum<T> should behave like an enum, returning default(T) when it is uninitialised/null/blank

* Don't allow null to be passed into StringEnum ctor - if it needs to be null then it should be declared as nullable

* fix expected json

* move logic to determine if property is a StringEnum<T> into helper function

* serializer needs to treat StringEnum<T> specially by serializing the enum value according to existing serializer strategy (parameter attributes and so on)

* remove fallback to default(T)

* add test to assert ctor throws exception when null passed in

* remove test for default(T) fallback behaviour

* Fix exception in serializer test - StringEnum property must be initialized otherwise an exception is thrown when attempting to serialize

* Dont allow empty strings either
2018-02-16 20:12:44 +10:00