Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added UWP Support #324

Merged
merged 2 commits into from
Mar 7, 2018
Merged
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
2 changes: 1 addition & 1 deletion GitVersionConfig.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 3.7.2
next-version: 3.7.3
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
build-metadata-padding: 0
Expand Down
81 changes: 81 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# EditorConfig is awesome:http://EditorConfig.org

# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom

# Xml project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# JSON files
[*.json]
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]
trim_trailing_whitespace = true
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

# CSharp code style settings:
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Suggest more modern language features when available
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
45 changes: 44 additions & 1 deletion src/ZendeskApi_v2.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
VisualStudioVersion = 15.0.27130.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZendeskApi_v2", "ZendeskApi_v2\ZendeskApi_v2.csproj", "{5E961B79-3175-468E-BFDA-41FE9842D78A}"
EndProject
Expand All @@ -11,27 +11,70 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZendeskApi_v2.Example", "Ze
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{DC18BBC5-665C-4A9F-8E17-418CBFE2BEB6}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
..\GitVersionConfig.yaml = ..\GitVersionConfig.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|ARM.Build.0 = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|x64.Build.0 = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|x86.ActiveCfg = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Debug|x86.Build.0 = Debug|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|Any CPU.Build.0 = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|ARM.ActiveCfg = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|ARM.Build.0 = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|x64.ActiveCfg = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|x64.Build.0 = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|x86.ActiveCfg = Release|Any CPU
{5E961B79-3175-468E-BFDA-41FE9842D78A}.Release|x86.Build.0 = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|ARM.ActiveCfg = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|ARM.Build.0 = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|x64.ActiveCfg = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|x64.Build.0 = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|x86.ActiveCfg = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Debug|x86.Build.0 = Debug|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|Any CPU.Build.0 = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|ARM.ActiveCfg = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|ARM.Build.0 = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|x64.ActiveCfg = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|x64.Build.0 = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|x86.ActiveCfg = Release|Any CPU
{BE7FB5E8-2B78-435E-B781-F72D4D650902}.Release|x86.Build.0 = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|ARM.Build.0 = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|x64.ActiveCfg = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|x64.Build.0 = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|x86.ActiveCfg = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Debug|x86.Build.0 = Debug|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|Any CPU.Build.0 = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|ARM.ActiveCfg = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|ARM.Build.0 = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|x64.ActiveCfg = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|x64.Build.0 = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|x86.ActiveCfg = Release|Any CPU
{C1A3D493-49E3-4DEF-ABA9-34EF2153C08B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
16 changes: 15 additions & 1 deletion src/ZendeskApi_v2/Models/Requests/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
namespace ZendeskApi_v2.Models.Requests
{

public enum RequestType
{
none,
question,
incident,
problem,
task
}


public class Request
{

Expand All @@ -20,6 +30,10 @@ public class Request
[JsonProperty("id")]
public long? Id { get; set; }

[JsonConverter(typeof(StringEnumConverter))]
[JsonProperty("type")]
public RequestType? Type { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

Expand All @@ -33,7 +47,7 @@ public class Request
public long? OrganizationId { get; set; }

[JsonProperty("via")]
public Via Via { get; set; }
public Via Via { get; set; }

[JsonProperty("custom_fields")]
public IList<CustomField> CustomFields { get; set; }
Expand Down
7 changes: 3 additions & 4 deletions src/ZendeskApi_v2/Models/Tickets/GroupTicketExportResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand All @@ -7,7 +7,6 @@
using ZendeskApi_v2.Models.Shared;
using ZendeskApi_v2.Models.SharingAgreements;
using ZendeskApi_v2.Models.Users;
using ZendeskApi_v2.Serialization;

namespace ZendeskApi_v2.Models.Tickets
{
Expand All @@ -17,7 +16,7 @@ public class GroupTicketExportResponse
public long Count { get; set; }

[JsonProperty("end_time")]
[JsonConverter(typeof(UnixEpochTimeConverter))]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime EndTime { get; set; }

[JsonProperty("groups")]
Expand Down Expand Up @@ -47,4 +46,4 @@ public class GroupTicketExportResponse
[JsonProperty("users")]
public IList<User> Users { get; set; }
}
}
}
44 changes: 0 additions & 44 deletions src/ZendeskApi_v2/Serialization/UnixEpochTimeConverter.cs

This file was deleted.

27 changes: 22 additions & 5 deletions src/ZendeskApi_v2/ZendeskApi_v2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
<IncludeSymbols>false</IncludeSymbols>
<IncludeSource>false</IncludeSource>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<OutputType>Library</OutputType>
</PropertyGroup>

<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!--;net35-->
<TargetFrameworks>net40;net45;portable40-net40+sl5+win8+wpa81+wp8</TargetFrameworks>
<TargetFrameworks>net40;net45;portable40-net40+sl5+win8+wpa81+wp8;uap10.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net45'">
Expand All @@ -51,9 +52,13 @@
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Serialization\UnixEpochTimeConverter.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitVersionTask" Version="4.0.0-beta0012" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'portable40-net40+sl5+win8+wpa81+wp8' ">
Expand All @@ -78,8 +83,20 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<PackageReference Include="Microsoft.Net.Http">
<Version>2.2.29</Version>
</PackageReference>
<PackageReference Include="Microsoft.Net.Http" Version="2.2.29" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.4.1" />
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.0.9" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<DefineConstants>$(DefineConstants);ASYNC</DefineConstants>
</PropertyGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
3 changes: 2 additions & 1 deletion test/ZendeskApi_v2.Test/RequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ public void CanCreateAndUpdateRequests()
var req = new Request
{
Subject = "end user request test",
Type = RequestType.incident,
Comment = new Comment {Body = "end user test", HtmlBody = "end user test with </br> new line", Public = true}
};

var res = _api.Requests.CreateRequest(req);
Assert.IsNotNull(res);
Assert.IsNotNull(res.Request);
Assert.IsTrue(res.Request.Id.HasValue);
Assert.That(res.Request.Type == RequestType.incident);
Assert.True(res.Request.Id.Value > 0);

var res1 = _api.Requests.GetRequestById(res.Request.Id.Value);
Expand All @@ -172,7 +174,6 @@ public void CanCreateAndUpdateRequests()
};

var res2 = _api.Requests.UpdateRequest(res1.Request);
//var res2 = api.Requests.UpdateRequest(res.Request.Id.Value, new Comment() {Body = "something more to say"});
var res3 = _api.Requests.GetRequestCommentsById(res.Request.Id.Value);

Assert.AreEqual(res3.Comments.Last().Body.Replace("\n", ""), "something more to say");
Expand Down