Skip to content

Change item id from int to long #59

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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 Source/Podio .NET/Models/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace PodioAPI.Models
public class Item
{
[JsonProperty("item_id")]
public int ItemId { get; set; }
public long ItemId { get; set; }

[JsonProperty("external_id")]
public string ExternalId { get; set; }
Expand Down
42 changes: 21 additions & 21 deletions Source/Podio .NET/Services/ItemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ItemService(Podio currentInstance)
/// </param>
/// <param name="hook">If set to false, hooks will not be executed for the change</param>
/// <returns>Id of the created item</returns>
public async Task<int> AddNewItem(int appId, Item item, int? spaceId = null, bool silent = false, bool hook = true)
public async Task<long> AddNewItem(int appId, Item item, int? spaceId = null, bool silent = false, bool hook = true)
{
JArray fieldValues = JArray.FromObject(item.Fields.Select(f => new { external_id = f.ExternalId, field_id = f.FieldId, values = f.Values }));

Expand Down Expand Up @@ -210,7 +210,7 @@ public async Task<Item> GetItem(int itemId, bool markedAsViewed = true)
/// notifications untouched, Default value true
/// </param>
/// <returns></returns>
public async Task<Item> GetItemBasic(int itemId, bool markedAsViewed = true)
public async Task<Item> GetItemBasic(long itemId, bool markedAsViewed = true)
{
string viewedVal = markedAsViewed == true ? "1" : "0";
var requestData = new Dictionary<string, string>()
Expand Down Expand Up @@ -357,12 +357,12 @@ public async Task<BulkDeletionStatus> BulkDeleteItems(int appId, BulkDeleteReque
/// generated
/// </param>
/// <returns>The id of the cloned item</returns>
public async Task<int> CloneItem(int itemId, bool silent = false)
public async Task<int> CloneItem(long itemId, bool silent = false)
{
string url = string.Format("/item/{0}/clone", itemId);
url = Utility.PrepareUrlWithOptions(url, new CreateUpdateOptions(silent));
dynamic tw = await _podio.Post<dynamic>(url);
return int.Parse(tw["item_id"].ToString());
return long.Parse(tw["item_id"].ToString());
}

/// <summary>
Expand All @@ -375,7 +375,7 @@ public async Task<int> CloneItem(int itemId, bool silent = false)
/// generated
/// </param>
/// <param name="hook">If set to false, hooks will not be executed for the change</param>
public async System.Threading.Tasks.Task DeleteItem(int itemId, bool silent = false, bool hook = true)
public async System.Threading.Tasks.Task DeleteItem(long itemId, bool silent = false, bool hook = true)
{
string url = string.Format("/item/{0}", itemId);
url = Utility.PrepareUrlWithOptions(url, new CreateUpdateOptions(silent, hook));
Expand All @@ -387,7 +387,7 @@ public async System.Threading.Tasks.Task DeleteItem(int itemId, bool silent = fa
/// <para>Podio API Reference: https://developers.podio.com/doc/items/delete-item-reference-7302326 </para>
/// </summary>
/// <param name="itemId"></param>
public async System.Threading.Tasks.Task DeleteItemReference(int itemId)
public async System.Threading.Tasks.Task DeleteItemReference(long itemId)
{
string url = string.Format("/item/{0}/ref", itemId);
await _podio.Delete<dynamic>(url);
Expand Down Expand Up @@ -509,7 +509,7 @@ public async Task<AppValues> GetAppValues(int appId)
/// <param name="itemId"></param>
/// <param name="fieldId"></param>
/// <returns></returns>
public async Task<T> GetItemFieldValues<T>(int itemId, int fieldId) where T : new()
public async Task<T> GetItemFieldValues<T>(long itemId, int fieldId) where T : new()
{
string url = string.Format("/item/{0}/value/{1}", itemId, fieldId);
return await _podio.Get<T>(url);
Expand All @@ -522,7 +522,7 @@ public async Task<AppValues> GetAppValues(int appId)
/// <param name="itemId"></param>
/// <param name="fieldId"></param>
/// <returns></returns>
public async Task<Item> GetItemBasicByField(int itemId, string fieldId)
public async Task<Item> GetItemBasicByField(long itemId, string fieldId)
{
string url = string.Format("/item/{0}/reference/{1}/preview", itemId, fieldId);
return await _podio.Get<Item>(url);
Expand All @@ -535,7 +535,7 @@ public async Task<Item> GetItemBasicByField(int itemId, string fieldId)
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<List<ItemReference>> GetItemReferences(int itemId)
public async Task<List<ItemReference>> GetItemReferences(long itemId)
{
string url = string.Format("/item/{0}/reference/", itemId);
return await _podio.Get<List<ItemReference>>(url);
Expand Down Expand Up @@ -573,7 +573,7 @@ public async Task<Range> GetFieldRanges(int fieldId)
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<List<ItemField>> GetItemValues(int itemId)
public async Task<List<ItemField>> GetItemValues(long itemId)
{
string url = string.Format("/item/{0}/value", itemId);
return await _podio.Get<List<ItemField>>(url);
Expand All @@ -585,7 +585,7 @@ public async Task<List<ItemField>> GetItemValues(int itemId)
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<ItemRevision> GetItemRevision(int itemId, int revision)
public async Task<ItemRevision> GetItemRevision(long itemId, int revision)
{
string url = string.Format("/item/{0}/revision/{1}", itemId, revision);
return await _podio.Get<ItemRevision>(url);
Expand All @@ -597,7 +597,7 @@ public async Task<ItemRevision> GetItemRevision(int itemId, int revision)
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<List<ItemRevision>> GetItemRevisions(int itemId)
public async Task<List<ItemRevision>> GetItemRevisions(long itemId)
{
string url = string.Format("/item/{0}/revision/", itemId);
return await _podio.Get<List<ItemRevision>>(url);
Expand All @@ -610,7 +610,7 @@ public async Task<List<ItemRevision>> GetItemRevisions(int itemId)
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<string> GetMeetingUrl(int itemId)
public async Task<string> GetMeetingUrl(long itemId)
{
string url = string.Format("/item/{0}/meeting/url", itemId);
dynamic response = await _podio.Get<dynamic>(url);
Expand All @@ -626,7 +626,7 @@ public async Task<string> GetMeetingUrl(int itemId)
/// </summary>
/// <param name="itemId"></param>
/// <param name="status">The new status, either "invited", "accepted", "declined" or "tentative"</param>
public async System.Threading.Tasks.Task SetParticipation(int itemId, string status)
public async System.Threading.Tasks.Task SetParticipation(long itemId, string status)
{
dynamic requestData = new
{
Expand All @@ -644,7 +644,7 @@ public async System.Threading.Tasks.Task SetParticipation(int itemId, string sta
/// <param name="fieldId"></param>
/// <param name="limit"></param>
/// <returns></returns>
public async Task<List<ItemMicro>> GetReferencesToItemByField(int itemId, int fieldId, int limit = 20)
public async Task<List<ItemMicro>> GetReferencesToItemByField(long itemId, int fieldId, int limit = 20)
{
var requestData = new Dictionary<string, string>()
{
Expand All @@ -661,7 +661,7 @@ public async Task<List<ItemMicro>> GetReferencesToItemByField(int itemId, int fi
/// <param name="itemId"></param>
/// <param name="type">The type of the reference</param>
/// <param name="id">The id of the reference</param>
public async System.Threading.Tasks.Task UpdateItemReference(int itemId, string type, int referenceId)
public async System.Threading.Tasks.Task UpdateItemReference(long itemId, string type, int referenceId)
{
dynamic requestData = new
{
Expand All @@ -680,7 +680,7 @@ public async System.Threading.Tasks.Task UpdateItemReference(int itemId, string
/// <param name="itemId"></param>
/// <param name="revisionId"></param>
/// <returns>The id of the new revision</returns>
public async Task<int?> RevertItemRevision(int itemId, int revisionId)
public async Task<int?> RevertItemRevision(long itemId, int revisionId)
{
var url = string.Format("/item/{0}/revision/{1}", itemId, revisionId);
var response = await _podio.Delete<dynamic>(url);
Expand All @@ -698,7 +698,7 @@ public async System.Threading.Tasks.Task UpdateItemReference(int itemId, string
/// <param name="itemId"></param>
/// <param name="revision"></param>
/// <returns>revision</returns>
public async Task<int?> RevertToRevision(int itemId, int revision)
public async Task<int?> RevertToRevision(long itemId, int revision)
{
var url = string.Format("/item/{0}/revision/{1}/revert_to", itemId, revision);
var response = await _podio.Delete<dynamic>(url);
Expand Down Expand Up @@ -744,7 +744,7 @@ public async Task<List<Item>> FindReferenceableItems(int fieldId, int limit = 13
/// </summary>
/// <param name="itemId"></param>
/// <returns></returns>
public async Task<Clone> GetItemClone(int itemId)
public async Task<Clone> GetItemClone(long itemId)
{
string url = string.Format("/item/{0}/clone", itemId);
return await _podio.Get<Clone>(url);
Expand All @@ -758,13 +758,13 @@ public async Task<Clone> GetItemClone(int itemId)
/// <param name="revisionFrom"></param>
/// <param name="revisionTo"></param>
/// <returns></returns>
public async Task<List<ItemDiff>> GetItemRevisionDifference(int itemId, int revisionFrom, int revisionTo)
public async Task<List<ItemDiff>> GetItemRevisionDifference(long itemId, int revisionFrom, int revisionTo)
{
string url = string.Format("/item/{0}/revision/{1}/{2}", itemId, revisionFrom, revisionTo);
return await _podio.Get<List<ItemDiff>>(url);
}

public async Task<ItemCalculate> Calcualate(int itemId, ItemCalculateRequest ItemCalculateRequest, int limit = 30)
public async Task<ItemCalculate> Calcualate(long itemId, ItemCalculateRequest ItemCalculateRequest, int limit = 30)
{
ItemCalculateRequest.Limit = ItemCalculateRequest.Limit == 0 ? 30 : ItemCalculateRequest.Limit;
string url = string.Format("/item/app/{0}/calculate", itemId);
Expand Down