Skip to content

Commit 9ffe069

Browse files
authored
framework and SDK update (#534)
* framework and SDK update fixes #527 * Updated to GitVersion.MsBuild * NUnit.Analyzers added debug condition
1 parent 92925c4 commit 9ffe069

File tree

15 files changed

+77
-91
lines changed

15 files changed

+77
-91
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,5 @@ FakesAssemblies/
213213
/docs/Gemfile.lock
214214
/ci/SignClient.exe
215215
/ci/.store/
216+
/dbgmd-00002.unknown
217+
/dbgmd-00001.sign

GitVersionConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
next-version: 3.10.5
1+
next-version: 3.12.0
22
assembly-versioning-scheme: MajorMinorPatch
33
mode: ContinuousDeployment
44
tag-prefix: '[vV]'

ci/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
displayName: 'Use .NET Core sdk'
4343
inputs:
4444
packageType: sdk
45-
version: 3.0.103
45+
version: 3.1.413
4646
installationPath: $(Agent.ToolsDirectory)/dotnet
4747

4848
- task: DotNetCoreCLI@2

src/ZendeskApi_v2.Example/ZendeskApi_v2.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<LangVersion>latest</LangVersion>
77
</PropertyGroup>
88

src/ZendeskApi_v2/Models/Organizations/Organization.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ namespace ZendeskApi_v2.Models.Organizations
1313
public class Organization : IndividualSearchableResponseBase
1414
{
1515
[JsonProperty("external_id")]
16-
public object ExternalId { get; set; }
16+
public string ExternalId { get; set; }
1717

1818
[JsonProperty("name")]
1919
public string Name { get; set; }
2020

2121
[JsonProperty("domain_names")]
22-
public IList<object> DomainNames { get; set; }
22+
public IList<string> DomainNames { get; set; }
2323

2424
[JsonProperty("details")]
25-
public object Details { get; set; }
25+
public string Details { get; set; }
2626

2727
[JsonProperty("notes")]
28-
public object Notes { get; set; }
28+
public string Notes { get; set; }
2929

3030
[JsonProperty("group_id")]
31-
public object GroupId { get; set; }
31+
public long? GroupId { get; set; }
3232

3333
[JsonProperty("shared_tickets")]
3434
public bool SharedTickets { get; set; }

src/ZendeskApi_v2/Models/Requests/Request.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
using Newtonsoft.Json.Converters;
66
using System;
77
using System.Collections.Generic;
8+
using System.Runtime.Serialization;
89
using ZendeskApi_v2.Models.Shared;
910
using ZendeskApi_v2.Models.Tickets;
1011

1112
namespace ZendeskApi_v2.Models.Requests
1213
{
13-
1414
public enum RequestType
1515
{
16-
none,
17-
question,
18-
incident,
19-
problem,
20-
task
16+
[EnumMember(Value = "none")]
17+
None,
18+
[EnumMember(Value = "question")]
19+
Question,
20+
[EnumMember(Value = "incident")]
21+
Incident,
22+
[EnumMember(Value = "problem")]
23+
Problem,
24+
[EnumMember(Value = "task")]
25+
Task
2126
}
2227

23-
2428
public class Request
2529
{
26-
2730
[JsonProperty("url")]
2831
public string Url { get; set; }
2932

@@ -101,7 +104,7 @@ public class Request
101104
public long TicketFormId { get; set; }
102105

103106
[JsonProperty("recipient")]
104-
public string recipient { get; set; }
107+
public string Recipient { get; set; }
105108

106109
[JsonProperty("followup_source_id")]
107110
public string FollowupSourceId { get; set; }

src/ZendeskApi_v2/Models/Shared/Data.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,46 @@ namespace ZendeskApi_v2.Models.Shared
88
public class Data
99
{
1010
[JsonProperty("from")]
11-
public string from { get; set; }
11+
public string From { get; set; }
1212

1313
[JsonProperty("to")]
14-
public string to { get; set; }
14+
public string To { get; set; }
1515

1616
[JsonProperty("recording_url")]
17-
public string recording_url { get; set; }
17+
public string RecordingUrl { get; set; }
1818

1919
[JsonProperty("call_id")]
20-
public long call_id { get; set; }
20+
public long CallId { get; set; }
2121

2222
[JsonProperty("call_duration")]
23-
public long call_duration { get; set; }
23+
public long CallDuration { get; set; }
2424

2525
[JsonProperty("answered_by_id")]
26-
public long? answered_by_id { get; set; }
26+
public long? AnsweredById { get; set; }
2727

2828
[JsonProperty("started_at")]
2929
[JsonConverter(typeof(IsoDateTimeConverter))]
30-
public DateTimeOffset? started_at { get; set; }
31-
32-
[JsonProperty("")]
33-
public string MyProperty { get; set; }
30+
public DateTimeOffset? StartedAt { get; set; }
3431

3532
[JsonProperty("location")]
36-
public string location { get; set; }
33+
public string Location { get; set; }
3734

3835
[JsonProperty("author_id")]
39-
public long? author_id { get; set; }
36+
public long? AuthorId { get; set; }
4037

4138
[JsonProperty("public")]
4239
public bool? Public { get; set; }
4340

4441
[JsonProperty("brand_id")]
45-
public long brand_id { get; set; }
42+
public long BrandId { get; set; }
4643

4744
[JsonProperty("via_id")]
48-
public long via_id { get; set; }
45+
public long ViaId { get; set; }
4946

5047
[JsonProperty("answered_by_name")]
51-
public string answered_by_name { get; set; }
48+
public string AnsweredByName { get; set; }
5249

5350
[JsonProperty("transcription_status")]
54-
public string transcription_status { get; set; }
51+
public string TranscriptionStatus { get; set; }
5552
}
5653
}

src/ZendeskApi_v2/Requests/Attachments.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Upload UploadAttachment(ZenFile file, string token, int? timeout = null)
104104

105105
public bool DeleteUpload(Upload upload)
106106
{
107-
return (upload?.Token == null ? false : GenericDelete($"/uploads/{upload.Token}.json"));
107+
return (upload?.Token) != null && GenericDelete($"/uploads/{upload.Token}.json");
108108
}
109109

110110
public IndividualAttachmentResponse RedactCommentAttachment(long attachmentId, long ticketId, long commentId)
@@ -167,7 +167,7 @@ public async Task<Upload> UploadAttachmentAsync(ZenFile file, string token = "",
167167

168168
public async Task<bool> DeleteUploadAsync(Upload upload)
169169
{
170-
return (upload?.Token == null ? false : await GenericDeleteAsync($"/uploads/{upload.Token}.json"));
170+
return (upload?.Token) != null && await GenericDeleteAsync($"/uploads/{upload.Token}.json");
171171
}
172172

173173
public async Task<ZenFile> DownloadAttachmentAsync(Attachment attachment)

src/ZendeskApi_v2/Serialization/TargetJsonConverter.cs

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,22 @@ public class TargetJsonConverter : BaseJsonConverter<BaseTarget>
99
protected override BaseTarget Create(Type objectType, JObject jsonObject)
1010
{
1111
var typeName = jsonObject["type"].ToString();
12-
switch (typeName)
12+
return typeName switch
1313
{
14-
case "basecamp_target":
15-
return new BasecampTarget();
16-
case "campfire_target":
17-
return new CampfireTarget();
18-
case "clickatell_target":
19-
return new ClickatellTarget();
20-
case "email_target":
21-
return new EmailTarget();
22-
case "flowdock_target":
23-
return new FlowdockTarget();
24-
case "get_satisfaction_target":
25-
return new GetSatisfactionTarget();
26-
case "jira_target":
27-
return new JiraTarget();
28-
case "pivotal_target":
29-
return new PivotalTarget();
30-
case "twitter_target":
31-
return new TwitterTarget();
32-
case "url_target":
33-
return new URLTarget();
34-
case "http_target":
35-
return new HTTPTarget();
36-
case "url_target_v2":
37-
return new HTTPTarget();
38-
default:
39-
return null;
40-
}
14+
"basecamp_target" => new BasecampTarget(),
15+
"campfire_target" => new CampfireTarget(),
16+
"clickatell_target" => new ClickatellTarget(),
17+
"email_target" => new EmailTarget(),
18+
"flowdock_target" => new FlowdockTarget(),
19+
"get_satisfaction_target" => new GetSatisfactionTarget(),
20+
"jira_target" => new JiraTarget(),
21+
"pivotal_target" => new PivotalTarget(),
22+
"twitter_target" => new TwitterTarget(),
23+
"url_target" => new URLTarget(),
24+
"http_target" => new HTTPTarget(),
25+
"url_target_v2" => new HTTPTarget(),
26+
_ => null,
27+
};
4128
}
4229
}
4330
}

src/ZendeskApi_v2/ZendeskApi_v2.csproj

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,33 @@
2828

2929
<PropertyGroup>
3030
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
31-
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
31+
<TargetFrameworks>netstandard2.1;net462</TargetFrameworks> <!---->
3232
<NoWarn>1701;1702;NU5105;NU1605;NU1701;$(NoWarn)</NoWarn>
3333
</PropertyGroup>
3434

35-
<PropertyGroup Condition="'$(TargetFramework)'=='net452'">
35+
<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
3636
<DefineConstants>$(DefineConstants);ASYNC;SYNC</DefineConstants>
3737
</PropertyGroup>
3838

39-
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
39+
<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.1'">
4040
<DefineConstants>$(DefineConstants);ASYNC;SYNC</DefineConstants>
4141
</PropertyGroup>
4242

4343
<ItemGroup>
44-
<PackageReference Include="GitVersionTask" Version="5.0.1">
44+
<PackageReference Include="GitVersion.MsBuild" Version="5.7">
4545
<PrivateAssets>all</PrivateAssets>
4646
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4747
</PackageReference>
48+
49+
<!--<PackageReference Include="GitVersionTask" Version="5.0.1">
50+
<PrivateAssets>all</PrivateAssets>
51+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
52+
</PackageReference>-->
4853
<!--<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.4-beta" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers" />-->
4954
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
5055
</ItemGroup>
5156

52-
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
57+
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
5358
<Reference Include="System.Net.Http" />
5459
</ItemGroup>
5560

0 commit comments

Comments
 (0)