Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions PandaSharp.Bamboo.Test/BambooApiFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ public void BambooApiBasicConstructionTest()
bambooApi.ProjectRequest.ShouldNotBeNull();
}

[Test]
public void BambooApiAccessTokenConstructionTest()
{
var bambooApi = BambooApiFactory.CreateWithAccessTokenAuthentication("http://test.bamboo.com", "tokenSecret");

bambooApi.BuildRequest.ShouldNotBeNull();
bambooApi.PlanRequest.ShouldNotBeNull();
bambooApi.SearchRequest.ShouldNotBeNull();
bambooApi.UsersRequest.ShouldNotBeNull();
bambooApi.ProjectRequest.ShouldNotBeNull();
}

[Test]
public void BambooApiOAuthConstructionTest()
{
Expand Down
13 changes: 13 additions & 0 deletions PandaSharp.Bamboo/BambooApiFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using PandaSharp.Framework.IoC;
using PandaSharp.Framework.Utils;
using RestSharp.Authenticators.OAuth2;

namespace PandaSharp.Bamboo
{
Expand All @@ -14,6 +15,18 @@ public static IBambooApi CreateWithBasicAuthentication(string baseUrl, string us
return container.Resolve<IBambooApi>();
}

public static IBambooApi CreateWithAccessTokenAuthentication(string baseUrl, string accesstoken)
{
var container = new PandaContainer();
var authentication = new OAuth2AuthorizationRequestHeaderAuthenticator(
accesstoken, "Bearer"
);
container.RegisterWithCustomAuthentication(baseUrl, authentication);
container.RegisterPandaModules();

return container.Resolve<IBambooApi>();
}

public static IBambooApi CreateWithOAuthAuthentication(
string baseUrl,
string consumerKey,
Expand Down
4 changes: 2 additions & 2 deletions PandaSharp.Bamboo/PandaSharp.Bamboo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
<Authors>Tom Birras</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>C# wrapper for Atlassian Bamboo</Description>
Expand Down Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup Condition="'$(BuildWithLocalReferences)' != true">
<PackageReference Include="PandaSharp.Framework" Version="1.0.4" />
<PackageReference Include="PandaSharp.Framework" Version="1.0.5" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions PandaSharp.Bamboo/Services/Build/Response/BuildResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ public sealed class BuildResponse
[JsonProperty("buildResultKey")]
public string BuildKey { get; set; }

[JsonProperty("buildReason")]
public string BuildReason { get; set; }

[JsonProperty("buildTestSummary")]
public string TestSummary { get; set; }

[JsonProperty("successful")]
public bool Successful { get; set; }

[JsonProperty("successfulTestCount")]
public uint? SuccessfulTestCount { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions PandaSharp.Bamboo/Services/Plan/Response/PlanResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public sealed class PlanResponse
[JsonProperty("shortName")]
public string PlanName { get; set; }

[JsonProperty("name")]
public string CompositeName { get; set; }

[JsonProperty("shortKey")]
public string PlanKey { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PandaSharp.Bamboo
C# wrapper for Atlassian Bamboo Rest API
C# wrapper for Atlassian Bamboo Rest API derived from:

[![Build status](https://ci.appveyor.com/api/projects/status/pt3xl353bgywoiea/branch/master?svg=true)](https://ci.appveyor.com/project/Metablex/pandasharp-bamboo/branch/master)

Expand Down