Skip to content

Commit

Permalink
Changed repository layout + added .nuspec file for NuGet packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenba committed Dec 2, 2014
1 parent db0af73 commit 350ef16
Show file tree
Hide file tree
Showing 25 changed files with 643 additions and 559 deletions.
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ obj
*.nupkg
**/test-results/*
*Resharper*
test
test
release/
40 changes: 20 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Copyright (c) 2012 SyntaxTree.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2012 SyntaxTree.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
110 changes: 55 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
## SyntaxTree.FastSpring.Api

SyntaxTree.FastSpring.Api is a C# library to query the [FastSpring](http://www.fastspring/) REST API.

It works on .NET 3.5, .NET 4.0 and .NET 4.5.

## API

```csharp
namespace SyntaxTree.FastSpring.Api
{
public sealed class CompanyStore
{
public CompanyStore(StoreCredential credential) {}

public Order Order(string reference) {}
}

public sealed class StoreCredential
{
public string Company { get; set; }
public string Username { get; set; }
public string Password { get; set; }

public StoreCredential(string company, string username, string password) {}
}
}
```

Usage sample:

```csharp
using SyntaxTree.FastSpring.Api;

public class Program
{
public static void Main()
{
var store = new CompanyStore(
new StoreCredential(
company: "Microsoft",
username: "api-user",
password: "xxx"));

var order = store.Order(reference: "SYNXXXXXX-XXXX-XXXXX");

Console.WriteLine(order.Customer.FirstName);
}
}
```

We currently only support the order and coupon API, not the subscription one.

All calls made to the FastSpring server are currently made synchronous and blocking.
Wrap your calls into a Task if you want them to to be asynchronous.
## SyntaxTree.FastSpring.Api

SyntaxTree.FastSpring.Api is a C# library to query the [FastSpring](http://www.fastspring/) REST API.

It works on .NET 3.5, .NET 4.0 and .NET 4.5.

## API

```csharp
namespace SyntaxTree.FastSpring.Api
{
public sealed class CompanyStore
{
public CompanyStore(StoreCredential credential) {}

public Order Order(string reference) {}
}

public sealed class StoreCredential
{
public string Company { get; set; }
public string Username { get; set; }
public string Password { get; set; }

public StoreCredential(string company, string username, string password) {}
}
}
```

Usage sample:

```csharp
using SyntaxTree.FastSpring.Api;

public class Program
{
public static void Main()
{
var store = new CompanyStore(
new StoreCredential(
company: "Microsoft",
username: "api-user",
password: "xxx"));

var order = store.Order(reference: "SYNXXXXXX-XXXX-XXXXX");

Console.WriteLine(order.Customer.FirstName);
}
}
```

We currently only support the order and coupon API, not the subscription one.

All calls made to the FastSpring server are currently made synchronous and blocking.
Wrap your calls into a Task if you want them to to be asynchronous.
25 changes: 25 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@echo Off
set config=%1
if "%config%" == "" (
set config=Release
)

set version=
if not "%PackageVersion%" == "" (
set version=-Version %PackageVersion%
)

REM Package restore
REM tools\nuget.exe restore src\SyntaxTree.FastSpring.Api.sln -OutputDirectory %cd%\src\packages -NonInteractive

REM Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild src\SyntaxTree.FastSpring.Api.sln /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false

REM Package
mkdir release
mkdir release\nuget
tools\nuget.exe pack "src\SyntaxTree.FastSpring.Api\SyntaxTree.FastSpring.Api.csproj" -symbols -o release\nuget -p Configuration=%config% %version%

REM Plain assemblies
mkdir release\assemblies
copy src\SyntaxTree.FastSpring.Api\bin\%config%\SyntaxTree.FastSpring*.dll release\assemblies
17 changes: 17 additions & 0 deletions msbuild.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Build started 2/12/2014 13:40:53.
1>Project "D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
1>Project "D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api.sln" (1) is building "D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api\SyntaxTree.FastSpring.Api.csproj" (2) on node 1 (default targets).
2>CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
CopyFilesToOutputDirectory:
SyntaxTree.FastSpring.Api -> D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api\bin\Release\SyntaxTree.FastSpring.Api.dll
2>Done Building Project "D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api\SyntaxTree.FastSpring.Api.csproj" (default targets).
1>Done Building Project "D:\Projects\Git\SyntaxTree.FastSpring.Api\src\SyntaxTree.FastSpring.Api.sln" (default targets).

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.60
40 changes: 20 additions & 20 deletions SyntaxTree.FastSpring.Api.sln → src/SyntaxTree.FastSpring.Api.sln
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxTree.FastSpring.Api", "SyntaxTree.FastSpring.Api.csproj", "{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SyntaxTree.FastSpring.Api", "SyntaxTree.FastSpring.Api\SyntaxTree.FastSpring.Api.csproj", "{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14DE6DBD-DDE0-4041-A1E9-570D40E03BE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
54 changes: 27 additions & 27 deletions Address.cs → src/SyntaxTree.FastSpring.Api/Address.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
using System.Xml.Serialization;

namespace SyntaxTree.FastSpring.Api
{
public sealed class Address
{
[XmlElement("addressLine1")]
public string FirstLine { get; set; }

[XmlElement("addressLine2")]
public string SecondLine { get; set; }

[XmlElement("city")]
public string City { get; set; }

[XmlElement("region")]
public string Region { get; set; }

[XmlElement("regionCustom")]
public string RegionCustom { get; set; }

[XmlElement("postalCode")]
public string PostalCode { get; set; }

[XmlElement("country")]
public string Country { get; set; }
}
using System.Xml.Serialization;

namespace SyntaxTree.FastSpring.Api
{
public sealed class Address
{
[XmlElement("addressLine1")]
public string FirstLine { get; set; }

[XmlElement("addressLine2")]
public string SecondLine { get; set; }

[XmlElement("city")]
public string City { get; set; }

[XmlElement("region")]
public string Region { get; set; }

[XmlElement("regionCustom")]
public string RegionCustom { get; set; }

[XmlElement("postalCode")]
public string PostalCode { get; set; }

[XmlElement("country")]
public string Country { get; set; }
}
}
Loading

0 comments on commit 350ef16

Please sign in to comment.