Skip to content

Commit

Permalink
Int to long (#264)
Browse files Browse the repository at this point in the history
* Changed all public properties to from int to long per docs
https://developer.zendesk.com/rest_api/docs/core/introduction#id-integers

fixed #263, fixed #262

* updated version number

* fixing double build

* adding notification to build

* change notification
  • Loading branch information
mozts2005 authored Jan 26, 2017
1 parent cf3296e commit 620e374
Show file tree
Hide file tree
Showing 35 changed files with 89 additions and 90 deletions.
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.5.3
next-version: 3.6.0
assembly-versioning-scheme: MajorMinorPatch
mode: ContinuousDeployment
build-metadata-padding: 0
Expand Down
14 changes: 12 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true

# Maximum number of concurrent jobs for the project
max_jobs: 1

install:
- ps: >-
Expand Down Expand Up @@ -34,7 +40,6 @@ install:
Write-Host "Is the build Prerelease: " $env:Is_Prerelease
pull_requests:
do_not_increment_build_number: true
skip_branch_with_pr: true
image: Visual Studio 2015
configuration: Release
platform: Any CPU
Expand Down Expand Up @@ -73,4 +78,9 @@ deploy:
name: PreRelease Nuget Feed
on:
branch: master
Is_Prerelease: true
Is_Prerelease: true
notifications:
- provider: GitHubPullRequest
on_build_success: true
on_build_failure: true
on_build_status_changed: false
Binary file modified src/.nuget/NuGet.exe
Binary file not shown.
4 changes: 0 additions & 4 deletions src/Tests/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ public class Settings
public const string DefaultOrg = "csharpapi";
public const string DefaultExternalId = "1234abc";


public const string AdminPassword = "&H3n!0q^3OjDLdm";
public const string AdminEmail = "[email protected]";

//public const string AdminEmail = "[email protected]";
//public const string AdminPassword = "pa55word";

public const string ApiToken = "R5PXRh5hEwT9Ry3hfSzGF2WKsxPf3ScSCq0suxii";
public const string Phone = "1234567890";
public const string FormattedPhone = "(111) 222-3333";
Expand Down
5 changes: 2 additions & 3 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
<Reference Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="NUnit" version="3.5.0" targetFramework="net45" />
<package id="NUnit" version="3.6.0" targetFramework="net45" />
<package id="NUnit3TestAdapter" version="3.6.0" targetFramework="net45" />
</packages>
5 changes: 2 additions & 3 deletions src/ZendeskApi_v2.Example/ZendeskApi_v2.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="ZendeskApi_v2, Version=3.5.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ZendeskApi_v2.3.5.1\lib\net45\ZendeskApi_v2.dll</HintPath>
<Private>True</Private>
<Reference Include="ZendeskApi_v2, Version=3.5.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ZendeskApi_v2.3.5.3\lib\net45\ZendeskApi_v2.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2.Example/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="ZendeskApi_v2" version="3.5.1" targetFramework="net452" />
<package id="ZendeskApi_v2" version="3.5.3" targetFramework="net452" />
</packages>
4 changes: 2 additions & 2 deletions src/ZendeskApi_v2/Models/AccountsAndActivities/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class Activity
public string Title { get; set; }

[JsonProperty("user")]
public ZendeskApi_v2.Models.Users.User User { get; set; }
public Users.User User { get; set; }

[JsonProperty("actor")]
public ZendeskApi_v2.Models.Users.User Actor { get; set; }
public Users.User Actor { get; set; }

[JsonProperty("created_at")]
[JsonConverter(typeof(IsoDateTimeConverter))]
Expand Down
6 changes: 3 additions & 3 deletions src/ZendeskApi_v2/Models/Articles/Article.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public class Article
public bool Promoted { get; set; }

[JsonProperty("position")]
public int Position { get; set; }
public long Position { get; set; }

[JsonProperty("vote_sum")]
public int VoteSum { get; set; }
public long VoteSum { get; set; }

[JsonProperty("vote_count")]
public int VoteCount { get; set; }
public long VoteCount { get; set; }

[JsonProperty("section_id")]
public long? SectionId { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions src/ZendeskApi_v2/Models/Articles/ArticleSearchResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ namespace ZendeskApi_v2.Models.Articles {
public class ArticleSearchResults
{
[JsonProperty("page")]
public int Page { get; set; }
public long Page { get; set; }

[JsonProperty("count")]
public int Count { get; set; }
public long Count { get; set; }

[JsonProperty("per_page")]
public int PerPage { get; set; }
public long PerPage { get; set; }

[JsonProperty("page_count")]
public int PageCount { get; set; }
public long PageCount { get; set; }

[JsonProperty("next_page")]
public string NextPage { get; set; }
Expand Down
20 changes: 7 additions & 13 deletions src/ZendeskApi_v2/Models/Articles/Result.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using ZendeskApi_v2.Models.Shared;
using ZendeskApi_v2.Models.Tickets;

namespace ZendeskApi_v2.Models.Articles {
namespace ZendeskApi_v2.Models.Articles
{
public class Result
{

{
[JsonProperty("id")]
public long? Id { get; set; }

Expand All @@ -35,16 +29,16 @@ public class Result
public bool Promoted { get; set; }

[JsonProperty("position")]
public int Position { get; set; }
public long Position { get; set; }

[JsonProperty("vote_sum")]
public int VoteSum { get; set; }
public long VoteSum { get; set; }

[JsonProperty("vote_count")]
public int VoteCount { get; set; }
public long VoteCount { get; set; }

[JsonProperty("section_id")]
public int SectionId { get; set; }
public long SectionId { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/CustomRoles/CustomRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ZendeskApi_v2.Models.CustomRoles
public class CustomRole
{
[JsonProperty("id")]
public int Id { get; set; }
public long Id { get; set; }

[JsonProperty("name")]
public string Name { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/Forums/Forum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class Forum
public bool Locked { get; set; }

[JsonProperty("position")]
public int Position { get; set; }
public long Position { get; set; }

[JsonProperty("forum_type")]
public string ForumType { get; set; }
Expand Down
29 changes: 15 additions & 14 deletions src/ZendeskApi_v2/Models/GroupResponseBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using ZendeskApi_v2.Extensions;

Expand All @@ -11,50 +12,50 @@ public interface IGroupResponseBase
{
string NextPage { get; set; }
string PreviousPage { get; set; }
int Count { get; set; }
int Page { get; }
int PageSize { get; }
int TotalPages { get; }
long Count { get; set; }
long Page { get; }
long PageSize { get; }
long TotalPages { get; }
}

public class GroupResponseBase : IGroupResponseBase
{
public class GroupResponseBase:IGroupResponseBase
{
[JsonProperty("next_page")]
public string NextPage { get; set; }

[JsonProperty("previous_page")]
public string PreviousPage { get; set; }

[JsonProperty("count")]
public int Count { get; set; }
public long Count { get; set; }

[JsonProperty("page")]
public int Page
public long Page
{
get { return GetPageFromParameter(); }
}

[JsonProperty("per_page")]
public int PageSize
public long PageSize
{
get { return GetPageSizeFromParameter(); }
}

[JsonProperty("total_pages")]
public int TotalPages
public long TotalPages
{
get { return (int)Math.Ceiling(Count/(double)PageSize); }
get { return (int)Math.Ceiling(Count / (double)PageSize); }
}

private int GetPageFromParameter()
private long GetPageFromParameter()
{
if (string.IsNullOrEmpty(PreviousPage))
return 1;

if (string.IsNullOrEmpty(NextPage))
return TotalPages;

var dict = NextPage.GetQueryStringDict();
Dictionary<string, string> dict = NextPage.GetQueryStringDict();
if (dict.ContainsKey("page"))
{
return int.Parse(dict["page"]) - 1;
Expand All @@ -69,7 +70,7 @@ private int GetPageSizeFromParameter()
if (page == null)
return 100;

var dict = page.GetQueryStringDict();
Dictionary<string, string> dict = page.GetQueryStringDict();
if (dict.ContainsKey("per_page"))
{
return int.Parse(dict["per_page"]);
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/HelpCenter/Categories/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Category
public string HtmlUrl { get; set; }

[JsonProperty("position")]
public int? Position { get; set; }
public long? Position { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions src/ZendeskApi_v2/Models/HelpCenter/Post/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Post : HelpCenterBase
/// The id of the author of the post.
/// </summary>
[JsonProperty("author_id")]
public int AuthorId { get; set; }
public long AuthorId { get; set; }

/// <summary>
/// When true, pins the post to the top of its topic
Expand Down Expand Up @@ -51,25 +51,25 @@ public class Post : HelpCenterBase
/// The total sum of votes on the post
/// </summary>
[JsonProperty("vote_sum")]
public int VoteSum { get; set; }
public long VoteSum { get; set; }

/// <summary>
/// The number of votes cast on the post
/// </summary>
[JsonProperty("vote_count")]
public int VoteCount { get; set; }
public long VoteCount { get; set; }

/// <summary>
/// The number of comments on the post
/// </summary>
[JsonProperty("comment_count")]
public int CommentCount { get; set; }
public long CommentCount { get; set; }

/// <summary>
/// The number of followers of the post
/// </summary>
[JsonProperty("follower_count")]
public int FollowerCount { get; set; }
public long FollowerCount { get; set; }

/// <summary>
/// The id of the topic that the post belongs to
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/Search/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Result
public IList<Attachment> Attachments { get; set; }

[JsonProperty("comments_count")]
public int? CommentsCount { get; set; }
public long? CommentsCount { get; set; }

[JsonProperty("created_at")]
[JsonConverter(typeof(IsoDateTimeConverter))]
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/Sections/Section.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Section
public string Visibility { get; set; }

[JsonProperty("position")]
public int Position { get; set; }
public long Position { get; set; }

[JsonProperty("created_at")]
public string CreatedAt { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/Shared/Attachment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Attachment
public string ContentType { get; set; }

[JsonProperty("size")]
public int Size { get; set; }
public long Size { get; set; }

[JsonProperty("inline")]
public bool Inline { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/ZendeskApi_v2/Models/Shared/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Data
public long call_id { get; set; }

[JsonProperty("call_duration")]
public int call_duration { get; set; }
public long call_duration { get; set; }

[JsonProperty("answered_by_id")]
public long? answered_by_id { get; set; }
Expand All @@ -45,7 +45,7 @@ public class Data
public long brand_id { get; set; }

[JsonProperty("via_id")]
public int via_id { get; set; }
public long via_id { get; set; }

[JsonProperty("answered_by_name")]
public string answered_by_name { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/ZendeskApi_v2/Models/Shared/JobStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class JobStatus
public string Url { get; set; }

[JsonProperty("total")]
public int? Total { get; set; }
public long? Total { get; set; }

[JsonProperty("progress")]
public int? Progress { get; set; }
public long? Progress { get; set; }

[JsonProperty("status")]
public string Status { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/ZendeskApi_v2/Models/Shared/Thumbnail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public class Thumbnail
public string ContentType { get; set; }

[JsonProperty("size")]
public int Size { get; set; }
public long Size { get; set; }
}
}
Loading

0 comments on commit 620e374

Please sign in to comment.