Skip to content

include conversion of int to long in the PaginationConverter and fix the incorrect generated MonetaryAccount objects #162

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 1 commit into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion BunqSdk/BunqSdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageId>Bunq.Sdk</PackageId>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.14.18</VersionPrefix>
<VersionPrefix>1.28.2</VersionPrefix>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Bunq.Sdk</RootNamespace>
Expand Down
10 changes: 5 additions & 5 deletions BunqSdk/Json/PaginationConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ private static T GetValueOrNull<T>(IDictionary<string, T> dictionary, string key
return dictionary.ContainsKey(key) ? dictionary[key] : default(T);
}

private static IDictionary<string, int?> ParsePaginationBody(JObject responseJson)
private static IDictionary<string, long?> ParsePaginationBody(JObject responseJson)
{
var paginationBody = new Dictionary<string, int?>();
var paginationBody = new Dictionary<string, long?>();
UpdatePaginationBodyFromResponseField(
paginationBody,
Pagination.PARAM_OLDER_ID,
Expand All @@ -79,7 +79,7 @@ private static T GetValueOrNull<T>(IDictionary<string, T> dictionary, string key
return paginationBody;
}

private static void UpdatePaginationBodyFromResponseField(IDictionary<string, int?> paginationBody,
private static void UpdatePaginationBodyFromResponseField(IDictionary<string, long?> paginationBody,
string idField, JObject responseJson, string responseField, string responseParam)
{
var responseToken = responseJson[responseField];
Expand All @@ -90,12 +90,12 @@ private static void UpdatePaginationBodyFromResponseField(IDictionary<string, in
{
if (responseParam.Equals(param.Key))
{
paginationBody[idField] = int.Parse(param.Value);
paginationBody[idField] = long.Parse(param.Value);
}
else if (Pagination.PARAM_COUNT.Equals(param.Key) &&
!paginationBody.ContainsKey(Pagination.PARAM_COUNT))
{
paginationBody[Pagination.PARAM_COUNT] = int.Parse(param.Value);
paginationBody[Pagination.PARAM_COUNT] = long.Parse(param.Value);
}
}
}
Expand Down
79 changes: 49 additions & 30 deletions BunqSdk/Model/Generated/Endpoint/FeatureAnnouncementApiObject.cs
Original file line number Diff line number Diff line change
@@ -1,62 +1,71 @@
using Bunq.Sdk.Context;
using Bunq.Sdk.Http;
using Bunq.Sdk.Json;
using Bunq.Sdk.Model.Core;
using Bunq.Sdk.Model.Generated.Object;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Text;
using System;

namespace Bunq.Sdk.Model.Generated.Endpoint
{
/// <summary>
/// view for updating the feature display.
/// view for creating the feature announcement.
/// </summary>
public class FeatureAnnouncementApiObject : BunqModel
{
/// <summary>
/// Endpoint constants.
/// Field constants.
/// </summary>
protected const string ENDPOINT_URL_READ = "user/{0}/feature-announcement/{1}";
public const string FIELD_AVATAR_UUID = "avatar_uuid";
public const string FIELD_TITLE = "title";
public const string FIELD_SUB_TITLE = "sub_title";
public const string FIELD_STATUS = "status";
public const string FIELD_FEATURE_ACCESS_ID = "feature_access_id";
public const string FIELD_CONTENT_TYPE = "content_type";

/// <summary>
/// Object type.
/// </summary>
private const string OBJECT_TYPE_GET = "FeatureAnnouncement";

/// <summary>
/// The Avatar of the event overview.
/// The avatar uuid.
/// </summary>
[JsonProperty(PropertyName = "avatar")]
public AvatarObject Avatar { get; set; }
[JsonProperty(PropertyName = "avatar_uuid")]
public string AvatarUuid { get; set; }
/// <summary>
/// The event overview title of the feature display
/// The event title of the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "title")]
public string Title { get; set; }
public List<string> Title { get; set; }
/// <summary>
/// The event overview subtitle of the feature display
/// The event sub title of the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "sub_title")]
public string SubTitle { get; set; }
public List<string> SubTitle { get; set; }
/// <summary>
/// The status of the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "status")]
public string Status { get; set; }
/// <summary>
/// The type of the feature announcement so apps can override with their own stuff if desired
/// The feature access id that controls the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "feature_access_id")]
public string FeatureAccessId { get; set; }
/// <summary>
/// The content type of the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "content_type")]
public string ContentType { get; set; }
/// <summary>
/// The Avatar of the event overview.
/// </summary>
[JsonProperty(PropertyName = "avatar")]
public AvatarObject Avatar { get; set; }
/// <summary>
/// The type of the feature announcement.
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }

/// <summary>
/// The event sub title of the feature announcement.
/// </summary>
public static BunqResponse<FeatureAnnouncementApiObject> Get(long featureAnnouncementId, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

var apiClient = new ApiClient(GetApiContext());
var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), featureAnnouncementId), new Dictionary<string, string>(), customHeaders);

return FromJson<FeatureAnnouncementApiObject>(responseRaw, OBJECT_TYPE_GET);
}
[JsonProperty(PropertyName = "all_feature_announcement_content")]
public List<string> AllFeatureAnnouncementContent { get; set; }


/// <summary>
Expand All @@ -83,6 +92,16 @@ public override bool IsAllFieldNull()
return false;
}

if (this.Status != null)
{
return false;
}

if (this.AllFeatureAnnouncementContent != null)
{
return false;
}

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class MonetaryAccountApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The settings of the MonetaryAccount.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public class MonetaryAccountBankApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The ids of the AutoSave.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public class MonetaryAccountCardApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The settings of the MonetaryAccount.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public class MonetaryAccountExternalApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The ids of the AutoSave.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public class MonetaryAccountExternalSavingsApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The ids of the AutoSave.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class MonetaryAccountInvestmentApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The ids of the AutoSave.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public class MonetaryAccountJointApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The ids of the AutoSave.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public class MonetaryAccountLightApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The budgets of the MonetaryAccount.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public class MonetaryAccountSavingsApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The progress in percentages for the Savings Goal set for this MonetaryAccountSavings.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class MonetaryAccountSwitchServiceApiObject : BunqModel
/// The profiles of the account.
/// </summary>
[JsonProperty(PropertyName = "monetary_account_profile")]
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
/// <summary>
/// The settings of the MonetaryAccount.
/// </summary>
Expand Down
Loading