Skip to content

Commit fb620e2

Browse files
author
Ethan Hann
committed
Merge branch 'master' into develop
2 parents 025fbe3 + 18f9abd commit fb620e2

File tree

12 files changed

+189
-26
lines changed

12 files changed

+189
-26
lines changed

IntegrationEngine.Client.net40/IntegrationEngine.Client.net40.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<ProjectGuid>{BBF7B784-DF72-4561-92B9-4021B5F7D8E3}</ProjectGuid>
88
<OutputType>Library</OutputType>
99
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>IntegrationEngine.Client.net40</RootNamespace>
11-
<AssemblyName>IntegrationEngine.Client.net40</AssemblyName>
10+
<RootNamespace>IntegrationEngine.Client</RootNamespace>
11+
<AssemblyName>IntegrationEngine.Client</AssemblyName>
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
1414
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@@ -32,6 +32,10 @@
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
3434
<ItemGroup>
35+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
36+
<SpecificVersion>False</SpecificVersion>
37+
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net40\Newtonsoft.Json.dll</HintPath>
38+
</Reference>
3539
<Reference Include="RestSharp">
3640
<HintPath>..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll</HintPath>
3741
</Reference>
@@ -47,12 +51,12 @@
4751
<Compile Include="..\configuration\SharedAssemblyInfo.cs">
4852
<Link>Properties\SharedAssemblyInfo.cs</Link>
4953
</Compile>
50-
<Compile Include="..\IntegrationEngine.Client\Client.cs">
51-
<Link>Client.cs</Link>
52-
</Compile>
5354
<Compile Include="..\IntegrationEngine.Client\EndpointName.cs">
5455
<Link>EndpointName.cs</Link>
5556
</Compile>
57+
<Compile Include="..\IntegrationEngine.Client\InEngineClient.cs">
58+
<Link>InEngineClient.cs</Link>
59+
</Compile>
5660
<Compile Include="Properties\AssemblyInfo.cs" />
5761
</ItemGroup>
5862
<ItemGroup>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net40" />
34
<package id="RestSharp" version="105.0.1" targetFramework="net40" />
45
</packages>

IntegrationEngine.Client/Client.cs renamed to IntegrationEngine.Client/InEngineClient.cs

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,110 +3,124 @@
33
using System.Linq;
44
using IntegrationEngine.Model;
55
using RestSharp;
6+
using Newtonsoft.Json;
67

78
namespace IntegrationEngine.Client
89
{
9-
public class Client
10+
public class InEngineClient
1011
{
1112
public RestClient RestClient { get; set; }
1213

13-
public Client()
14+
public InEngineClient()
1415
: this("http://localhost:9001/api/")
1516
{
1617
}
1718

18-
public Client(string apiUrl)
19+
public InEngineClient(string apiUrl)
1920
{
2021
RestClient = new RestClient(apiUrl);
2122
}
2223

2324
#region CronTrigger
24-
public List<ICronTrigger> GetCronTriggers()
25+
public IList<CronTrigger> GetCronTriggers()
2526
{
2627
var request = new RestRequest(EndpointName.CronTrigger, Method.GET);
27-
return RestClient.Execute<List<ICronTrigger>>(request).Data;
28+
request.RequestFormat = DataFormat.Json;
29+
var result = RestClient.Execute(request);
30+
return JsonConvert.DeserializeObject<IList<CronTrigger>>(result.Content);
2831
}
2932

3033
public CronTrigger GetCronTriggerById(string id)
3134
{
3235
var request = new RestRequest(EndpointName.CronTrigger + "/{id}", Method.GET);
3336
request.AddUrlSegment("id", id);
34-
return RestClient.Execute<CronTrigger>(request).Data;
37+
var result = RestClient.Execute(request);
38+
return JsonConvert.DeserializeObject<CronTrigger>(result.Content);
3539
}
3640

3741
public CronTrigger CreateCronTrigger(CronTrigger cronTrigger)
3842
{
3943
var request = new RestRequest(EndpointName.CronTrigger, Method.POST);
4044
request.AddObject(cronTrigger);
41-
return RestClient.Execute<CronTrigger>(request).Data;
45+
var result = RestClient.Execute(request);
46+
return JsonConvert.DeserializeObject<CronTrigger>(result.Content);
4247
}
4348

4449
public CronTrigger UpdateCronTrigger(CronTrigger cronTrigger)
4550
{
4651
var request = new RestRequest(EndpointName.CronTrigger + "/{id}", Method.PUT);
4752
request.AddUrlSegment("id", cronTrigger.Id);
4853
request.AddObject(cronTrigger);
49-
return RestClient.Execute<CronTrigger>(request).Data;
54+
var result = RestClient.Execute(request);
55+
return JsonConvert.DeserializeObject<CronTrigger>(result.Content);
5056
}
5157

5258
public CronTrigger DeleteCronTrigger(string id)
5359
{
5460
var request = new RestRequest(EndpointName.CronTrigger + "/{id}", Method.DELETE);
5561
request.AddUrlSegment("id", id);
56-
return RestClient.Execute<CronTrigger>(request).Data;
62+
var result = RestClient.Execute(request);
63+
return JsonConvert.DeserializeObject<CronTrigger>(result.Content);
5764
}
5865
#endregion
5966

6067
#region SimpleTrigger
61-
public List<SimpleTrigger> GetSimpleTriggers()
68+
public IList<SimpleTrigger> GetSimpleTriggers()
6269
{
6370
var request = new RestRequest(EndpointName.SimpleTrigger, Method.GET);
64-
return RestClient.Execute<List<SimpleTrigger>>(request).Data;
71+
var result = RestClient.Execute(request);
72+
return JsonConvert.DeserializeObject<IList<SimpleTrigger>>(result.Content);
6573
}
6674

6775
public SimpleTrigger GetSimpleTriggerById(string id)
6876
{
6977
var request = new RestRequest(EndpointName.SimpleTrigger + "/{id}", Method.GET);
7078
request.AddUrlSegment("id", id);
71-
return RestClient.Execute<SimpleTrigger>(request).Data;
79+
var result = RestClient.Execute(request);
80+
return JsonConvert.DeserializeObject<SimpleTrigger>(result.Content);
7281
}
7382

7483
public SimpleTrigger CreateSimpleTrigger(SimpleTrigger simpleTrigger)
7584
{
7685
var request = new RestRequest(EndpointName.SimpleTrigger, Method.POST);
7786
request.AddObject(simpleTrigger);
78-
return RestClient.Execute<SimpleTrigger>(request).Data;
87+
var result = RestClient.Execute(request);
88+
return JsonConvert.DeserializeObject<SimpleTrigger>(result.Content);
7989
}
8090

8191
public SimpleTrigger UpdateSimpleTrigger(SimpleTrigger simpleTrigger)
8292
{
8393
var request = new RestRequest(EndpointName.SimpleTrigger + "/{id}", Method.PUT);
8494
request.AddUrlSegment("id", simpleTrigger.Id);
8595
request.AddObject(simpleTrigger);
86-
return RestClient.Execute<SimpleTrigger>(request).Data;
96+
var result = RestClient.Execute(request);
97+
return JsonConvert.DeserializeObject<SimpleTrigger>(result.Content);
8798
}
8899

89100
public SimpleTrigger DeleteSimpleTrigger(string id)
90101
{
91102
var request = new RestRequest(EndpointName.SimpleTrigger + "/{id}", Method.DELETE);
92103
request.AddUrlSegment("id", id);
93-
return RestClient.Execute<SimpleTrigger>(request).Data;
104+
var result = RestClient.Execute(request);
105+
return JsonConvert.DeserializeObject<SimpleTrigger>(result.Content);
94106
}
95107
#endregion
96108

97109
#region TimeZone
98-
public List<TimeZone> GetTimeZones()
110+
public IList<TimeZone> GetTimeZones()
99111
{
100112
var request = new RestRequest(EndpointName.TimeZone, Method.GET);
101-
return RestClient.Execute<List<TimeZone>>(request).Data;
113+
var result = RestClient.Execute(request);
114+
return JsonConvert.DeserializeObject<IList<TimeZone>>(result.Content);
102115
}
103116
#endregion
104117

105118
#region JobType
106-
public List<string> GetJobTypes()
119+
public IList<string> GetJobTypes()
107120
{
108121
var request = new RestRequest(EndpointName.JobType, Method.GET);
109-
return RestClient.Execute<List<string>>(request).Data;
122+
var result = RestClient.Execute(request);
123+
return JsonConvert.DeserializeObject<IList<string>>(result.Content);
110124
}
111125
#endregion
112126
}

IntegrationEngine.Client/IntegrationEngine.Client.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
<ConsolePause>false</ConsolePause>
3131
</PropertyGroup>
3232
<ItemGroup>
33+
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
34+
<SpecificVersion>False</SpecificVersion>
35+
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
36+
</Reference>
3337
<Reference Include="System" />
3438
<Reference Include="RestSharp">
3539
<HintPath>..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll</HintPath>
@@ -39,8 +43,8 @@
3943
<Compile Include="..\configuration\SharedAssemblyInfo.cs">
4044
<Link>Properties\SharedAssemblyInfo.cs</Link>
4145
</Compile>
46+
<Compile Include="InEngineClient.cs" />
4247
<Compile Include="Properties\AssemblyInfo.cs" />
43-
<Compile Include="Client.cs" />
4448
<Compile Include="EndpointName.cs" />
4549
</ItemGroup>
4650
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

IntegrationEngine.Client/package.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</references>
1919
<dependencies>
2020
<dependency id="IntegrationEngine.Model" version="$version$" />
21+
<dependency id="Newtonsoft.Json" version="6.0.8" />
2122
<dependency id="RestSharp" version="105.0.1" />
2223
</dependencies>
2324
</metadata>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3+
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
34
<package id="RestSharp" version="105.0.1" targetFramework="net45" />
45
</packages>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{46DB723B-F767-4F5A-A1DA-53A6CF13704B}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>IntegrationEngine.ConsoleClient</RootNamespace>
11+
<AssemblyName>IntegrationEngine.ConsoleClient</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<Prefer32Bit>false</Prefer32Bit>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<PlatformTarget>AnyCPU</PlatformTarget>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\Release\</OutputPath>
32+
<DefineConstants>TRACE</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
<Prefer32Bit>false</Prefer32Bit>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="Program.cs" />
48+
<Compile Include="Properties\AssemblyInfo.cs" />
49+
</ItemGroup>
50+
<ItemGroup>
51+
<ProjectReference Include="..\IntegrationEngine.Client\IntegrationEngine.Client.csproj">
52+
<Project>{f3fcb706-f0dd-46c1-b121-785757fae9b9}</Project>
53+
<Name>IntegrationEngine.Client</Name>
54+
</ProjectReference>
55+
<ProjectReference Include="..\IntegrationEngine.Model\IntegrationEngine.Model.csproj">
56+
<Project>{0b499fe4-0bdb-4080-bcb7-f8d4ce54a4ff}</Project>
57+
<Name>IntegrationEngine.Model</Name>
58+
</ProjectReference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<None Include="app.config" />
62+
</ItemGroup>
63+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
64+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
65+
Other similar extension points exist, see Microsoft.Common.targets.
66+
<Target Name="BeforeBuild">
67+
</Target>
68+
<Target Name="AfterBuild">
69+
</Target>
70+
-->
71+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using IntegrationEngine.Client;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
7+
namespace IntegrationEngine.ConsoleClient
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
var client = new InEngineClient();
14+
}
15+
}
16+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("IntegrationEngine.ConsoleClient")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("IntegrationEngine.ConsoleClient")]
13+
[assembly: AssemblyCopyright("Copyright © 2015")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("a84058ae-627b-44ef-b6e5-b8780d5c69b8")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>

0 commit comments

Comments
 (0)