Skip to content

Commit 42568a0

Browse files
authored
Merge pull request #161 from andrederoos/replace_item_id_from_int_to_long
Replace all occurences of itemId from int to long
2 parents 60d52a8 + 63aa2ba commit 42568a0

File tree

214 files changed

+3176
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+3176
-752
lines changed

BunqSdk.Tests/Config.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public static PointerObject GetCounterPartyAliasSelf()
5151
return new PointerObject(type, alias);
5252
}
5353

54-
public static int GetSecondMonetaryAccountId()
54+
public static long GetSecondMonetaryAccountId()
5555
{
56-
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID2].ToObject<int>();
56+
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID2].ToObject<long>();
5757
}
5858

59-
public static int GetMonetaryAccountId()
59+
public static long GetMonetaryAccountId()
6060
{
61-
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID].ToObject<int>();
61+
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID].ToObject<long>();
6262
}
6363

6464
public static string GetAttachmentPathIn()
@@ -90,9 +90,9 @@ public static string GetApiKey()
9090
return GetConfig()[FIELD_API_KEY].ToString();
9191
}
9292

93-
public static int GetUserId()
93+
public static long GetUserId()
9494
{
95-
return GetConfig()[FIELD_USER_ID].ToObject<int>();
95+
return GetConfig()[FIELD_USER_ID].ToObject<long>();
9696
}
9797

9898
private static JObject GetConfig()

BunqSdk.Tests/Context/Psd2ApiContextTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void TestCreateOauthClient()
5555
return;
5656
}
5757

58-
int clientId = OauthClientApiObject.Create().Value;
58+
long clientId = OauthClientApiObject.Create().Value;
5959
OauthClientApiObject oauthClient = OauthClientApiObject.Get(clientId).Value;
6060
Assert.NotNull(oauthClient);
6161

BunqSdk.Tests/Model/Generated/Endpoint/MonetaryAccountBankTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void TestCreationNewMonetaryAccount()
3131
DeleteMonetaryAccount(monetaryAccountToCloseId);
3232
}
3333

34-
private static void DeleteMonetaryAccount(int idToClose)
34+
private static void DeleteMonetaryAccount(long idToClose)
3535
{
3636
MonetaryAccountBankApiObject.Update(idToClose, status: Status, subStatus: SubStatus, reason: Reason,
3737
reasonDescription: ReasonDescription);

BunqSdk/Context/ApiContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class ApiContext
4646
/// <summary>
4747
/// Dummy ID to pass to Session endpoint.
4848
/// </summary>
49-
private const int SESSION_ID_DUMMY = 0;
49+
private const long SESSION_ID_DUMMY = 0;
5050

5151
/// <summary>
5252
/// Encoding of the serialized context.

BunqSdk/Context/SessionContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class SessionContext
3838
public DateTime ExpiryTime { get; private set; }
3939

4040
[JsonProperty(PropertyName = "user_id")]
41-
public int UserId { get; private set; }
41+
public long UserId { get; private set; }
4242

4343
[JsonProperty(PropertyName = "user_person")]
4444
public UserPersonApiObject UserPerson { get; private set; }
@@ -89,7 +89,7 @@ private void SetUser(BunqModel user)
8989
}
9090
}
9191

92-
private static int GetUserId(SessionServer sessionServer)
92+
private static long GetUserId(SessionServer sessionServer)
9393
{
9494
if (sessionServer.UserCompany != null)
9595
{
@@ -155,7 +155,7 @@ private static double GetSessionTimeout(SessionServer sessionServer)
155155

156156
private static double GetSessionTimeOutForUser(BunqModel user)
157157
{
158-
int? sessionTimeout;
158+
long? sessionTimeout;
159159

160160
if (user.GetType() == typeof(UserPersonApiObject))
161161
{
@@ -177,7 +177,7 @@ private static double GetSessionTimeOutForUser(BunqModel user)
177177
return GetDoubleFromSessionTimeout(sessionTimeout);
178178
}
179179

180-
private static double GetDoubleFromSessionTimeout(int? sessionTimeout)
180+
private static double GetDoubleFromSessionTimeout(long? sessionTimeout)
181181
{
182182
if (sessionTimeout == null)
183183
{

BunqSdk/Context/UserContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public MonetaryAccountBankApiObject PrimaryMonetaryAccountBank
2929
private set => primaryMonetaryAccountBank = value ?? throw new ArgumentNullException(nameof(value));
3030
}
3131

32-
public int UserId { get; }
32+
public long UserId { get; }
3333

34-
public UserContext(int userId, BunqModel user)
34+
public UserContext(long userId, BunqModel user)
3535
{
3636
UserId = userId;
3737
SetUser(user);

BunqSdk/Http/Pagination.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ public class Pagination
2020
public const string PARAM_FUTURE_ID = "future_id";
2121
public const string PARAM_COUNT = "count";
2222

23-
public int? OlderId { get; set; }
24-
public int? NewerId { get; set; }
25-
public int? FutureId { get; set; }
26-
public int? Count { get; set; }
23+
public long? OlderId { get; set; }
24+
public long? NewerId { get; set; }
25+
public long? FutureId { get; set; }
26+
public long? Count { get; set; }
2727

2828
/// <summary>
2929
/// Get the URL params required to request the next page of the listing.
@@ -58,7 +58,7 @@ private void AddCountToParamsIfNeeded(IDictionary<string, string> urlParams)
5858
}
5959
}
6060

61-
private int? NextId
61+
private long? NextId
6262
{
6363
get { return HasNextPageAssured() ? NewerId : FutureId; }
6464
}

BunqSdk/Model/Core/BunqModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ protected static BunqResponse<T> FromJsonArrayNested<T>(BunqResponseRaw response
3939
}
4040

4141
/// <summary>
42-
/// De-serializes an ID object and returns its integer value.
42+
/// De-serializes an ID object and returns its long value.
4343
/// </summary>
44-
protected static BunqResponse<int> ProcessForId(BunqResponseRaw responseRaw)
44+
protected static BunqResponse<long> ProcessForId(BunqResponseRaw responseRaw)
4545
{
4646
var responseItemObject = GetResponseItemObject(responseRaw);
4747
var unwrappedItemJsonString = GetUnwrappedItemJsonString(responseItemObject, FIELD_ID);
4848
var responseValue = BunqJsonConvert.DeserializeObject<Id>(unwrappedItemJsonString).IdInt;
4949

50-
return new BunqResponse<int>(responseValue, responseRaw.Headers);
50+
return new BunqResponse<long>(responseValue, responseRaw.Headers);
5151
}
5252

5353
private static JObject GetResponseItemObject(BunqResponseRaw responseRaw)
@@ -218,12 +218,12 @@ protected static ApiContext GetApiContext()
218218
return BunqContext.ApiContext;
219219
}
220220

221-
protected static int DetermineUserId()
221+
protected static long DetermineUserId()
222222
{
223223
return BunqContext.UserContext.UserId;
224224
}
225225

226-
protected static int DetermineMonetaryAccountId(int? monetaryAccountId = null)
226+
protected static long DetermineMonetaryAccountId(long? monetaryAccountId = null)
227227
{
228228
return monetaryAccountId ?? BunqContext.UserContext.PrimaryMonetaryAccountBank.Id.Value;
229229
}

BunqSdk/Model/Core/DeviceServerInternal.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class DeviceServerInternal : DeviceServerApiObject
1717
/// more at this link <a href="https://bunq.com/en/apikey-dynamic-ip"
1818
/// target="_blank">https://bunq.com/en/apikey-dynamic-ip</a>.
1919
/// </summary>
20-
public static BunqResponse<int> Create(ApiContext apiContext, string description, string secret,
20+
public static BunqResponse<long> Create(ApiContext apiContext, string description, string secret,
2121
List<string> permittedIps = null,
2222
IDictionary<string, string> customHeaders = null)
2323
{

BunqSdk/Model/Core/Id.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace Bunq.Sdk.Model.Core
44
{
55
public class Id
66
{
7-
[JsonProperty(PropertyName = "id")] public int IdInt { get; private set; }
7+
[JsonProperty(PropertyName = "id")] public long IdInt { get; private set; }
88

9-
public Id(int idInt)
9+
public Id(long idInt)
1010
{
1111
IdInt = idInt;
1212
}

0 commit comments

Comments
 (0)