An "alpha" version of a generated .NET SDK in C# from GitHub's OpenAPI spec, built on Kiota. View on NuGet.
To install the package, you can use either of the following options:
- In Visual Studio, from the Package Explorer, search for
GitHub.Octokit.SDK
, or - Type
Install-Package GitHub.Octokit.SDK
into the Package Manager Console, or - Type
dotnet add ./path/to/myproject.csproj package GitHub.Octokit.SDK
in a terminal (replace./path/to/myproject.csproj
by the path to the *.csproj file you want to add the dependency)
using GitHub;
using GitHub.Octokit.Client;
using GitHub.Octokit.Authentication;
var token = Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? "";
var request = RequestAdapter.Create(new TokenAuthenticationProvider("Octokit.Gen", token));
var gitHubClient = new GitHubClient(request);
var pullRequests = await gitHubClient.Repos["octokit"]["octokit.net"].Pulls.GetAsync();
foreach (var pullRequest in pullRequests)
{
Console.WriteLine($"#{pullRequest.Number} {pullRequest.Title}");
}
Important
This SDK is not yet stable. Breaking changes may occur at any time.
We want to...
- provide 100% coverage of the API in our SDK
- use this as a building block for future SDK tooling
We have a substantial userbase that uses .NET and we wanted them to get access to our generated SDK as early as possible.
Please use this project's issues!
Currently this project is fairly simple (we hope it can stay that way). All of the package based source is contained in the GitHub
folder.
- Authentication - everything related to authenticating requests
- Client - the logic for constructing the plumbing to interact with the GitHub API
- Middleware - this represents object and handlers that can mutate the request and are "injected" into the request/response flow.
- Octokit - types which represent request/response objects