Skip to content

Commit 22e8941

Browse files
authored
Merge pull request #162 from andrederoos/replace_item_id_from_int_to_long
include conversion of int to long in the PaginationConverter and fix the incorrect generated MonetaryAccount objects
2 parents 42568a0 + 604f71f commit 22e8941

13 files changed

+65
-46
lines changed

BunqSdk/BunqSdk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageId>Bunq.Sdk</PackageId>
99
</PropertyGroup>
1010
<PropertyGroup>
11-
<VersionPrefix>1.14.18</VersionPrefix>
11+
<VersionPrefix>1.28.2</VersionPrefix>
1212
</PropertyGroup>
1313
<PropertyGroup>
1414
<RootNamespace>Bunq.Sdk</RootNamespace>

BunqSdk/Json/PaginationConverter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ private static T GetValueOrNull<T>(IDictionary<string, T> dictionary, string key
5151
return dictionary.ContainsKey(key) ? dictionary[key] : default(T);
5252
}
5353

54-
private static IDictionary<string, int?> ParsePaginationBody(JObject responseJson)
54+
private static IDictionary<string, long?> ParsePaginationBody(JObject responseJson)
5555
{
56-
var paginationBody = new Dictionary<string, int?>();
56+
var paginationBody = new Dictionary<string, long?>();
5757
UpdatePaginationBodyFromResponseField(
5858
paginationBody,
5959
Pagination.PARAM_OLDER_ID,
@@ -79,7 +79,7 @@ private static T GetValueOrNull<T>(IDictionary<string, T> dictionary, string key
7979
return paginationBody;
8080
}
8181

82-
private static void UpdatePaginationBodyFromResponseField(IDictionary<string, int?> paginationBody,
82+
private static void UpdatePaginationBodyFromResponseField(IDictionary<string, long?> paginationBody,
8383
string idField, JObject responseJson, string responseField, string responseParam)
8484
{
8585
var responseToken = responseJson[responseField];
@@ -90,12 +90,12 @@ private static void UpdatePaginationBodyFromResponseField(IDictionary<string, in
9090
{
9191
if (responseParam.Equals(param.Key))
9292
{
93-
paginationBody[idField] = int.Parse(param.Value);
93+
paginationBody[idField] = long.Parse(param.Value);
9494
}
9595
else if (Pagination.PARAM_COUNT.Equals(param.Key) &&
9696
!paginationBody.ContainsKey(Pagination.PARAM_COUNT))
9797
{
98-
paginationBody[Pagination.PARAM_COUNT] = int.Parse(param.Value);
98+
paginationBody[Pagination.PARAM_COUNT] = long.Parse(param.Value);
9999
}
100100
}
101101
}

BunqSdk/Model/Generated/Endpoint/FeatureAnnouncementApiObject.cs

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,71 @@
1-
using Bunq.Sdk.Context;
2-
using Bunq.Sdk.Http;
3-
using Bunq.Sdk.Json;
41
using Bunq.Sdk.Model.Core;
52
using Bunq.Sdk.Model.Generated.Object;
63
using Newtonsoft.Json;
74
using System.Collections.Generic;
8-
using System.Text;
9-
using System;
105

116
namespace Bunq.Sdk.Model.Generated.Endpoint
127
{
138
/// <summary>
14-
/// view for updating the feature display.
9+
/// view for creating the feature announcement.
1510
/// </summary>
1611
public class FeatureAnnouncementApiObject : BunqModel
1712
{
1813
/// <summary>
19-
/// Endpoint constants.
14+
/// Field constants.
2015
/// </summary>
21-
protected const string ENDPOINT_URL_READ = "user/{0}/feature-announcement/{1}";
16+
public const string FIELD_AVATAR_UUID = "avatar_uuid";
17+
public const string FIELD_TITLE = "title";
18+
public const string FIELD_SUB_TITLE = "sub_title";
19+
public const string FIELD_STATUS = "status";
20+
public const string FIELD_FEATURE_ACCESS_ID = "feature_access_id";
21+
public const string FIELD_CONTENT_TYPE = "content_type";
2222

23-
/// <summary>
24-
/// Object type.
25-
/// </summary>
26-
private const string OBJECT_TYPE_GET = "FeatureAnnouncement";
2723

2824
/// <summary>
29-
/// The Avatar of the event overview.
25+
/// The avatar uuid.
3026
/// </summary>
31-
[JsonProperty(PropertyName = "avatar")]
32-
public AvatarObject Avatar { get; set; }
27+
[JsonProperty(PropertyName = "avatar_uuid")]
28+
public string AvatarUuid { get; set; }
3329
/// <summary>
34-
/// The event overview title of the feature display
30+
/// The event title of the feature announcement.
3531
/// </summary>
3632
[JsonProperty(PropertyName = "title")]
37-
public string Title { get; set; }
33+
public List<string> Title { get; set; }
3834
/// <summary>
39-
/// The event overview subtitle of the feature display
35+
/// The event sub title of the feature announcement.
4036
/// </summary>
4137
[JsonProperty(PropertyName = "sub_title")]
42-
public string SubTitle { get; set; }
38+
public List<string> SubTitle { get; set; }
39+
/// <summary>
40+
/// The status of the feature announcement.
41+
/// </summary>
42+
[JsonProperty(PropertyName = "status")]
43+
public string Status { get; set; }
4344
/// <summary>
44-
/// The type of the feature announcement so apps can override with their own stuff if desired
45+
/// The feature access id that controls the feature announcement.
46+
/// </summary>
47+
[JsonProperty(PropertyName = "feature_access_id")]
48+
public string FeatureAccessId { get; set; }
49+
/// <summary>
50+
/// The content type of the feature announcement.
51+
/// </summary>
52+
[JsonProperty(PropertyName = "content_type")]
53+
public string ContentType { get; set; }
54+
/// <summary>
55+
/// The Avatar of the event overview.
56+
/// </summary>
57+
[JsonProperty(PropertyName = "avatar")]
58+
public AvatarObject Avatar { get; set; }
59+
/// <summary>
60+
/// The type of the feature announcement.
4561
/// </summary>
4662
[JsonProperty(PropertyName = "type")]
4763
public string Type { get; set; }
48-
4964
/// <summary>
65+
/// The event sub title of the feature announcement.
5066
/// </summary>
51-
public static BunqResponse<FeatureAnnouncementApiObject> Get(long featureAnnouncementId, IDictionary<string, string> customHeaders = null)
52-
{
53-
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
54-
55-
var apiClient = new ApiClient(GetApiContext());
56-
var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), featureAnnouncementId), new Dictionary<string, string>(), customHeaders);
57-
58-
return FromJson<FeatureAnnouncementApiObject>(responseRaw, OBJECT_TYPE_GET);
59-
}
67+
[JsonProperty(PropertyName = "all_feature_announcement_content")]
68+
public List<string> AllFeatureAnnouncementContent { get; set; }
6069

6170

6271
/// <summary>
@@ -83,6 +92,16 @@ public override bool IsAllFieldNull()
8392
return false;
8493
}
8594

95+
if (this.Status != null)
96+
{
97+
return false;
98+
}
99+
100+
if (this.AllFeatureAnnouncementContent != null)
101+
{
102+
return false;
103+
}
104+
86105
return true;
87106
}
88107

BunqSdk/Model/Generated/Endpoint/MonetaryAccountApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class MonetaryAccountApiObject : BunqModel
4848
/// The profiles of the account.
4949
/// </summary>
5050
[JsonProperty(PropertyName = "monetary_account_profile")]
51-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
51+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
5252
/// <summary>
5353
/// The settings of the MonetaryAccount.
5454
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountBankApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public class MonetaryAccountBankApiObject : BunqModel
165165
/// The profiles of the account.
166166
/// </summary>
167167
[JsonProperty(PropertyName = "monetary_account_profile")]
168-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
168+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
169169
/// <summary>
170170
/// The ids of the AutoSave.
171171
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountCardApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public class MonetaryAccountCardApiObject : BunqModel
105105
/// The profiles of the account.
106106
/// </summary>
107107
[JsonProperty(PropertyName = "monetary_account_profile")]
108-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
108+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
109109
/// <summary>
110110
/// The settings of the MonetaryAccount.
111111
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountExternalApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public class MonetaryAccountExternalApiObject : BunqModel
161161
/// The profiles of the account.
162162
/// </summary>
163163
[JsonProperty(PropertyName = "monetary_account_profile")]
164-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
164+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
165165
/// <summary>
166166
/// The ids of the AutoSave.
167167
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountExternalSavingsApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public class MonetaryAccountExternalSavingsApiObject : BunqModel
162162
/// The profiles of the account.
163163
/// </summary>
164164
[JsonProperty(PropertyName = "monetary_account_profile")]
165-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
165+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
166166
/// <summary>
167167
/// The ids of the AutoSave.
168168
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountInvestmentApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public class MonetaryAccountInvestmentApiObject : BunqModel
157157
/// The profiles of the account.
158158
/// </summary>
159159
[JsonProperty(PropertyName = "monetary_account_profile")]
160-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
160+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
161161
/// <summary>
162162
/// The ids of the AutoSave.
163163
/// </summary>

BunqSdk/Model/Generated/Endpoint/MonetaryAccountJointApiObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public class MonetaryAccountJointApiObject : BunqModel
157157
/// The profiles of the account.
158158
/// </summary>
159159
[JsonProperty(PropertyName = "monetary_account_profile")]
160-
public List<MonetaryAccountProfileApiObject> MonetaryAccountProfile { get; set; }
160+
public MonetaryAccountProfileApiObject MonetaryAccountProfile { get; set; }
161161
/// <summary>
162162
/// The ids of the AutoSave.
163163
/// </summary>

0 commit comments

Comments
 (0)