Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jlouros/stashapicsharp

[Atlassian] Bitbucket Server/Stash API wrapper built in C#
https://github.com/jlouros/stashapicsharp

api-wrapper bitbucket-server c-sharp dotnet

Last synced: 7 days ago
JSON representation

[Atlassian] Bitbucket Server/Stash API wrapper built in C#

Awesome Lists containing this project

README

        

![Build](https://github.com/jlouros/StashApiCSharp/workflows/Build/badge.svg) ![Infer#](https://github.com/jlouros/StashApiCSharp/workflows/Infer%23/badge.svg) ![CodeQL](https://github.com/jlouros/StashApiCSharp/workflows/CodeQL/badge.svg) [![NuGet](https://img.shields.io/nuget/v/Atlassian.Stash.Api.svg)](https://www.nuget.org/packages/Atlassian.Stash.Api/)

# Bitbucket Server (previously known as Stash) API wrapper for .Net

C# API wrapper for Atlassian Bitbucket Server (previously known as Stash)
For more information about Bitbucket Server visit: https://www.atlassian.com/software/bitbucket/server
API documentation can be found here: https://developer.atlassian.com/bitbucket/server/docs/latest/
Versions 2.0.0 and above of this project target Bitbucket Server version 4.1 and above.
If you are using a older version of Bitbucket Server (below version 4.0), please download any 1.0.* version from NuGet

## Installation

There are 2 ways to use this library:

* Install-Package Atlassian.Stash.Api (via Nuget)
* Download source code and compile

## Sample Usage
```csharp
// Create a Stash connection
// Stash client connection using basic authentication
var client = new StashClient("http://your_stash_server_url:7990/", "username", "password");

// Gets a list of projects (by default a maximum of 25 results will be return)
// we recommend use of async/await instead of forcing synchronous execution
var projects = client.Projects.Get().Result;

// Gets a list of repositories from project "PROJKEY" (by default a maximum of 25 results will be return)
// using async
var repositories = await client.Repositories.Get("PROJKEY");

// Delete repository "REPOSLUG" from project "PROJKEY"
await client.Repositories.Delete("PROJKEY", "REPOSLUG");
```

*Take a look at the integration tests project for more samples.*