Skip to content
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
12 changes: 6 additions & 6 deletions BunqSdk.Tests/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public static PointerObject GetCounterPartyAliasSelf()
return new PointerObject(type, alias);
}

public static int GetSecondMonetaryAccountId()
public static long GetSecondMonetaryAccountId()
{
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID2].ToObject<int>();
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID2].ToObject<long>();
}

public static int GetMonetaryAccountId()
public static long GetMonetaryAccountId()
{
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID].ToObject<int>();
return GetConfig()[FIELD_MONETARY_ACCOUNT_ID].ToObject<long>();
}

public static string GetAttachmentPathIn()
Expand Down Expand Up @@ -90,9 +90,9 @@ public static string GetApiKey()
return GetConfig()[FIELD_API_KEY].ToString();
}

public static int GetUserId()
public static long GetUserId()
{
return GetConfig()[FIELD_USER_ID].ToObject<int>();
return GetConfig()[FIELD_USER_ID].ToObject<long>();
}

private static JObject GetConfig()
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk.Tests/Context/Psd2ApiContextTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void TestCreateOauthClient()
return;
}

int clientId = OauthClientApiObject.Create().Value;
long clientId = OauthClientApiObject.Create().Value;
OauthClientApiObject oauthClient = OauthClientApiObject.Get(clientId).Value;
Assert.NotNull(oauthClient);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void TestCreationNewMonetaryAccount()
DeleteMonetaryAccount(monetaryAccountToCloseId);
}

private static void DeleteMonetaryAccount(int idToClose)
private static void DeleteMonetaryAccount(long idToClose)
{
MonetaryAccountBankApiObject.Update(idToClose, status: Status, subStatus: SubStatus, reason: Reason,
reasonDescription: ReasonDescription);
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Context/ApiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ApiContext
/// <summary>
/// Dummy ID to pass to Session endpoint.
/// </summary>
private const int SESSION_ID_DUMMY = 0;
private const long SESSION_ID_DUMMY = 0;

/// <summary>
/// Encoding of the serialized context.
Expand Down
8 changes: 4 additions & 4 deletions BunqSdk/Context/SessionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SessionContext
public DateTime ExpiryTime { get; private set; }

[JsonProperty(PropertyName = "user_id")]
public int UserId { get; private set; }
public long UserId { get; private set; }

[JsonProperty(PropertyName = "user_person")]
public UserPersonApiObject UserPerson { get; private set; }
Expand Down Expand Up @@ -89,7 +89,7 @@ private void SetUser(BunqModel user)
}
}

private static int GetUserId(SessionServer sessionServer)
private static long GetUserId(SessionServer sessionServer)
{
if (sessionServer.UserCompany != null)
{
Expand Down Expand Up @@ -155,7 +155,7 @@ private static double GetSessionTimeout(SessionServer sessionServer)

private static double GetSessionTimeOutForUser(BunqModel user)
{
int? sessionTimeout;
long? sessionTimeout;

if (user.GetType() == typeof(UserPersonApiObject))
{
Expand All @@ -177,7 +177,7 @@ private static double GetSessionTimeOutForUser(BunqModel user)
return GetDoubleFromSessionTimeout(sessionTimeout);
}

private static double GetDoubleFromSessionTimeout(int? sessionTimeout)
private static double GetDoubleFromSessionTimeout(long? sessionTimeout)
{
if (sessionTimeout == null)
{
Expand Down
4 changes: 2 additions & 2 deletions BunqSdk/Context/UserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public MonetaryAccountBankApiObject PrimaryMonetaryAccountBank
private set => primaryMonetaryAccountBank = value ?? throw new ArgumentNullException(nameof(value));
}

public int UserId { get; }
public long UserId { get; }

public UserContext(int userId, BunqModel user)
public UserContext(long userId, BunqModel user)
{
UserId = userId;
SetUser(user);
Expand Down
10 changes: 5 additions & 5 deletions BunqSdk/Http/Pagination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class Pagination
public const string PARAM_FUTURE_ID = "future_id";
public const string PARAM_COUNT = "count";

public int? OlderId { get; set; }
public int? NewerId { get; set; }
public int? FutureId { get; set; }
public int? Count { get; set; }
public long? OlderId { get; set; }
public long? NewerId { get; set; }
public long? FutureId { get; set; }
public long? Count { get; set; }

/// <summary>
/// Get the URL params required to request the next page of the listing.
Expand Down Expand Up @@ -58,7 +58,7 @@ private void AddCountToParamsIfNeeded(IDictionary<string, string> urlParams)
}
}

private int? NextId
private long? NextId
{
get { return HasNextPageAssured() ? NewerId : FutureId; }
}
Expand Down
10 changes: 5 additions & 5 deletions BunqSdk/Model/Core/BunqModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ protected static BunqResponse<T> FromJsonArrayNested<T>(BunqResponseRaw response
}

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

return new BunqResponse<int>(responseValue, responseRaw.Headers);
return new BunqResponse<long>(responseValue, responseRaw.Headers);
}

private static JObject GetResponseItemObject(BunqResponseRaw responseRaw)
Expand Down Expand Up @@ -218,12 +218,12 @@ protected static ApiContext GetApiContext()
return BunqContext.ApiContext;
}

protected static int DetermineUserId()
protected static long DetermineUserId()
{
return BunqContext.UserContext.UserId;
}

protected static int DetermineMonetaryAccountId(int? monetaryAccountId = null)
protected static long DetermineMonetaryAccountId(long? monetaryAccountId = null)
{
return monetaryAccountId ?? BunqContext.UserContext.PrimaryMonetaryAccountBank.Id.Value;
}
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Model/Core/DeviceServerInternal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DeviceServerInternal : DeviceServerApiObject
/// more at this link <a href="https://bunq.com/en/apikey-dynamic-ip"
/// target="_blank">https://bunq.com/en/apikey-dynamic-ip</a>.
/// </summary>
public static BunqResponse<int> Create(ApiContext apiContext, string description, string secret,
public static BunqResponse<long> Create(ApiContext apiContext, string description, string secret,
List<string> permittedIps = null,
IDictionary<string, string> customHeaders = null)
{
Expand Down
4 changes: 2 additions & 2 deletions BunqSdk/Model/Core/Id.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace Bunq.Sdk.Model.Core
{
public class Id
{
[JsonProperty(PropertyName = "id")] public int IdInt { get; private set; }
[JsonProperty(PropertyName = "id")] public long IdInt { get; private set; }

public Id(int idInt)
public Id(long idInt)
{
IdInt = idInt;
}
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Model/Core/Installation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static byte[] GenerateRequestBodyBytes(string publicKeyClientString)
return Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(installationRequestBody));
}

public int GetIdInt()
public long GetIdInt()
{
return id.IdInt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static BunqResponse<List<NotificationFilterUrlObject>> CreateWithListResp
/// Create notification filters with list response type.
/// </summary>
public static BunqResponse<List<NotificationFilterUrlObject>> CreateWithListResponse(
int monetaryAccountId,
long monetaryAccountId,
List<NotificationFilterUrlObject> allNotificationFilter
)
{
Expand All @@ -38,7 +38,7 @@ List<NotificationFilterUrlObject> allNotificationFilter
/// Create notification filters with list response type.
/// </summary>
public static BunqResponse<List<NotificationFilterUrlObject>> CreateWithListResponse(
int? monetaryAccountId,
long? monetaryAccountId,
List<NotificationFilterUrlObject> allNotificationFilter,
Dictionary<string, string> customHeaders
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class AdditionalTransactionInformationCategoryApiObject : BunqModel
/// The sort order of the category.
/// </summary>
[JsonProperty(PropertyName = "order")]
public int? Order { get; set; }
public long? Order { get; set; }
/// <summary>
/// The description of the category.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class AdditionalTransactionInformationCategoryUserDefinedApiObject : Bunq
/// <param name="description">The description of the category.</param>
/// <param name="color">The color of the category.</param>
/// <param name="icon">The icon of the category.</param>
public static BunqResponse<int> Create(string status, string category = null, string description = null, string color = null, string icon = null, IDictionary<string, string> customHeaders = null)
public static BunqResponse<long> Create(string status, string category = null, string description = null, string color = null, string icon = null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AttachmentConversationContentApiObject : BunqModel
/// <summary>
/// Get the raw content of a specific attachment.
/// </summary>
public static BunqResponse<byte[]> List(int chatConversationId, int attachmentId, IDictionary<string, string> customHeaders = null)
public static BunqResponse<byte[]> List(long chatConversationId, long attachmentId, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public class AttachmentMonetaryAccountApiObject : BunqModel
/// The ID of the attachment created.
/// </summary>
[JsonProperty(PropertyName = "id")]
public int? Id { get; set; }
public long? Id { get; set; }

/// <summary>
/// Create a new monetary account attachment. Create a POST request with a payload that contains the binary
/// representation of the file, without any JSON wrapping. Make sure you define the MIME type (i.e. image/jpeg)
/// in the Content-Type header. You are required to provide a description of the attachment using the
/// X-Bunq-Attachment-Description header.
/// </summary>
public static BunqResponse<int> Create(byte[] requestBytes, int? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
public static BunqResponse<long> Create(byte[] requestBytes, long? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AttachmentMonetaryAccountContentApiObject : BunqModel
/// <summary>
/// Get the raw content of a specific attachment.
/// </summary>
public static BunqResponse<byte[]> List(int attachmentId, int? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
public static BunqResponse<byte[]> List(long attachmentId, long? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
4 changes: 2 additions & 2 deletions BunqSdk/Model/Generated/Endpoint/AttachmentUserApiObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class AttachmentUserApiObject : BunqModel
/// The id of the attachment.
/// </summary>
[JsonProperty(PropertyName = "id")]
public int? Id { get; set; }
public long? Id { get; set; }
/// <summary>
/// The timestamp of the attachment's creation.
/// </summary>
Expand All @@ -50,7 +50,7 @@ public class AttachmentUserApiObject : BunqModel
/// <summary>
/// Get a specific attachment. The header of the response contains the content-type of the attachment.
/// </summary>
public static BunqResponse<AttachmentUserApiObject> Get(int attachmentUserId, IDictionary<string, string> customHeaders = null)
public static BunqResponse<AttachmentUserApiObject> Get(long attachmentUserId, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AttachmentUserContentApiObject : BunqModel
/// <summary>
/// Get the raw content of a specific attachment.
/// </summary>
public static BunqResponse<byte[]> List(int attachmentId, IDictionary<string, string> customHeaders = null)
public static BunqResponse<byte[]> List(long attachmentId, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class BankSwitchServiceNetherlandsIncomingPaymentApiObject : BunqModel

/// <summary>
/// </summary>
public static BunqResponse<BankSwitchServiceNetherlandsIncomingPaymentApiObject> Get(int bankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
public static BunqResponse<BankSwitchServiceNetherlandsIncomingPaymentApiObject> Get(long bankSwitchServiceNetherlandsIncomingPaymentId, long? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class BillingContractSubscriptionApiObject : BunqModel
/// The id of the billing contract.
/// </summary>
[JsonProperty(PropertyName = "id")]
public int? Id { get; set; }
public long? Id { get; set; }
/// <summary>
/// The timestamp when the billing contract was made.
/// </summary>
Expand All @@ -64,7 +64,7 @@ public class BillingContractSubscriptionApiObject : BunqModel
/// The version of the billing contract.
/// </summary>
[JsonProperty(PropertyName = "contract_version")]
public int? ContractVersion { get; set; }
public long? ContractVersion { get; set; }
/// <summary>
/// The subscription type the user will have after a subscription downgrade. Will be null if downgrading is not
/// possible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public class BirdeeInvestmentPortfolioApiObject : BunqModel
/// Maximum number of strategy changes in a year.
/// </summary>
[JsonProperty(PropertyName = "number_of_strategy_change_annual_maximum")]
public int? NumberOfStrategyChangeAnnualMaximum { get; set; }
public long? NumberOfStrategyChangeAnnualMaximum { get; set; }
/// <summary>
/// Maximum number of strategy changes used.
/// </summary>
[JsonProperty(PropertyName = "number_of_strategy_change_annual_used")]
public int? NumberOfStrategyChangeAnnualUsed { get; set; }
public long? NumberOfStrategyChangeAnnualUsed { get; set; }
/// <summary>
/// The external identifier of the portfolio.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class BunqMeFundraiserProfileUserApiObject : BunqModel
/// Id of the monetary account on which you want to receive bunq.me payments.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_id")]
public int? MonetaryAccountId { get; set; }
public long? MonetaryAccountId { get; set; }
/// <summary>
/// The color chosen for the bunq.me fundraiser profile in hexadecimal format.
/// </summary>
Expand Down Expand Up @@ -76,7 +76,7 @@ public class BunqMeFundraiserProfileUserApiObject : BunqModel
/// Id of the user owning the profile.
/// </summary>
[JsonProperty(PropertyName = "owner_user_id")]
public int? OwnerUserId { get; set; }
public long? OwnerUserId { get; set; }
/// <summary>
/// The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that created the
/// bunq.me fundraiser profile.
Expand All @@ -96,7 +96,7 @@ public class BunqMeFundraiserProfileUserApiObject : BunqModel

/// <summary>
/// </summary>
public static BunqResponse<BunqMeFundraiserProfileUserApiObject> Get(int bunqMeFundraiserProfileUserId, IDictionary<string, string> customHeaders = null)
public static BunqResponse<BunqMeFundraiserProfileUserApiObject> Get(long bunqMeFundraiserProfileUserId, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class BunqMeFundraiserResultApiObject : BunqModel
/// The id of the bunq.me.
/// </summary>
[JsonProperty(PropertyName = "id")]
public int? Id { get; set; }
public long? Id { get; set; }
/// <summary>
/// The timestamp when the bunq.me was created.
/// </summary>
Expand All @@ -52,7 +52,7 @@ public class BunqMeFundraiserResultApiObject : BunqModel

/// <summary>
/// </summary>
public static BunqResponse<BunqMeFundraiserResultApiObject> Get(int bunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
public static BunqResponse<BunqMeFundraiserResultApiObject> Get(long bunqMeFundraiserResultId, long? monetaryAccountId= null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand Down
Loading