Skip to content

Commit a3cc7bd

Browse files
author
Konstantin Yakushev
committed
Merge branch 'release/1.10.3'
2 parents a25954e + 593c0ce commit a3cc7bd

13 files changed

+513
-6
lines changed

.idea/.idea.BunqSdk/.idea/contentModel.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BunqSdk/BunqSdk.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<PackageId>Bunq.Sdk</PackageId>
99
</PropertyGroup>
1010
<PropertyGroup>
11-
<VersionPrefix>1.10.2.0</VersionPrefix>
11+
<VersionPrefix>1.10.3.0</VersionPrefix>
1212
</PropertyGroup>
1313
<PropertyGroup>
1414
<RootNamespace>Bunq.Sdk</RootNamespace>

BunqSdk/Http/ApiClient.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class ApiClient
6464
/// Values for the default headers
6565
/// </summary>
6666
private const string CACHE_CONTROL_NONE = "no-cache";
67-
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.10.2";
67+
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.10.3";
6868
private const string LANGUAGE_EN_US = "en_US";
6969
private const string REGION_NL_NL = "nl_NL";
7070
private const string GEOLOCATION_ZERO = "0 0 0 0 NL";

BunqSdk/Model/Generated/Endpoint/Card.cs

+16-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class Card : BunqModel
3737
public const string FIELD_COUNTRY_PERMISSION = "country_permission";
3838
public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment";
3939
public const string FIELD_PRIMARY_ACCOUNT_NUMBERS_VIRTUAL = "primary_account_numbers_virtual";
40+
public const string FIELD_PRIMARY_ACCOUNT_NUMBERS = "primary_account_numbers";
4041
public const string FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback";
4142

4243
/// <summary>
@@ -101,6 +102,12 @@ public class Card : BunqModel
101102
[JsonProperty(PropertyName = "primary_account_numbers_virtual")]
102103
public List<CardVirtualPrimaryAccountNumber> PrimaryAccountNumbersVirtual { get; set; }
103104

105+
/// <summary>
106+
/// Array of PANs and their attributes.
107+
/// </summary>
108+
[JsonProperty(PropertyName = "primary_account_numbers")]
109+
public List<CardPrimaryAccountNumber> PrimaryAccountNumbers { get; set; }
110+
104111
/// <summary>
105112
/// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if
106113
/// not supplied.
@@ -213,13 +220,15 @@ public class Card : BunqModel
213220
/// <param name="countryPermission">The countries for which to grant (temporary) permissions to use the card.</param>
214221
/// <param name="pinCodeAssignment">Array of Types, PINs, account IDs assigned to the card.</param>
215222
/// <param name="primaryAccountNumbersVirtual">Array of PANs, status, description and account id for online cards.</param>
223+
/// <param name="primaryAccountNumbers">Array of PANs and their attributes.</param>
216224
/// <param name="monetaryAccountIdFallback">ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if not supplied.</param>
217225
public static BunqResponse<Card> Update(int cardId, string pinCode = null, string activationCode = null,
218226
string status = null, Amount cardLimit = null, Amount cardLimitAtm = null,
219227
CardMagStripePermission magStripePermission = null, List<CardCountryPermission> countryPermission = null,
220228
List<CardPinAssignment> pinCodeAssignment = null,
221229
List<CardVirtualPrimaryAccountNumber> primaryAccountNumbersVirtual = null,
222-
int? monetaryAccountIdFallback = null, IDictionary<string, string> customHeaders = null)
230+
List<CardPrimaryAccountNumber> primaryAccountNumbers = null, int? monetaryAccountIdFallback = null,
231+
IDictionary<string, string> customHeaders = null)
223232
{
224233
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
225234

@@ -236,6 +245,7 @@ public static BunqResponse<Card> Update(int cardId, string pinCode = null, strin
236245
{FIELD_COUNTRY_PERMISSION, countryPermission},
237246
{FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment},
238247
{FIELD_PRIMARY_ACCOUNT_NUMBERS_VIRTUAL, primaryAccountNumbersVirtual},
248+
{FIELD_PRIMARY_ACCOUNT_NUMBERS, primaryAccountNumbers},
239249
{FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback},
240250
};
241251

@@ -351,6 +361,11 @@ public override bool IsAllFieldNull()
351361
return false;
352362
}
353363

364+
if (this.PrimaryAccountNumbers != null)
365+
{
366+
return false;
367+
}
368+
354369
if (this.CardLimit != null)
355370
{
356371
return false;

BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ExportStatementPayment : BunqModel
2424
/// <summary>
2525
/// Object type.
2626
/// </summary>
27-
private const string OBJECT_TYPE_GET = "Id";
27+
private const string OBJECT_TYPE_GET = "ExportStatementPayment";
2828

2929
/// <summary>
3030
/// The id of the single payment statement model.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
using Bunq.Sdk.Context;
2+
using Bunq.Sdk.Http;
3+
using Bunq.Sdk.Json;
4+
using Bunq.Sdk.Model.Core;
5+
using Bunq.Sdk.Model.Generated.Object;
6+
using Newtonsoft.Json;
7+
using System.Collections.Generic;
8+
using System.Text;
9+
using System;
10+
11+
namespace Bunq.Sdk.Model.Generated.Endpoint
12+
{
13+
/// <summary>
14+
/// Manage the push notification filters for a user.
15+
/// </summary>
16+
public class NotificationFilterPushUser : BunqModel
17+
{
18+
/// <summary>
19+
/// Endpoint constants.
20+
/// </summary>
21+
protected const string ENDPOINT_URL_CREATE = "user/{0}/notification-filter-push";
22+
23+
protected const string ENDPOINT_URL_LISTING = "user/{0}/notification-filter-push";
24+
25+
/// <summary>
26+
/// Field constants.
27+
/// </summary>
28+
public const string FIELD_NOTIFICATION_FILTERS = "notification_filters";
29+
30+
/// <summary>
31+
/// Object type.
32+
/// </summary>
33+
private const string OBJECT_TYPE_POST = "NotificationFilterPush";
34+
35+
private const string OBJECT_TYPE_GET = "NotificationFilterPush";
36+
37+
/// <summary>
38+
/// The types of notifications that will result in a push notification for this user.
39+
/// </summary>
40+
[JsonProperty(PropertyName = "notification_filters")]
41+
public List<NotificationFilterPush> NotificationFilters { get; set; }
42+
43+
/// <summary>
44+
/// </summary>
45+
/// <param name="notificationFilters">The types of notifications that will result in a push notification for this user.</param>
46+
public static BunqResponse<NotificationFilterPushUser> Create(
47+
List<NotificationFilterPush> notificationFilters = null, IDictionary<string, string> customHeaders = null)
48+
{
49+
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
50+
51+
var apiClient = new ApiClient(GetApiContext());
52+
53+
var requestMap = new Dictionary<string, object>
54+
{
55+
{FIELD_NOTIFICATION_FILTERS, notificationFilters},
56+
};
57+
58+
var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap));
59+
var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes,
60+
customHeaders);
61+
62+
return FromJson<NotificationFilterPushUser>(responseRaw, OBJECT_TYPE_POST);
63+
}
64+
65+
/// <summary>
66+
/// </summary>
67+
public static BunqResponse<List<NotificationFilterPushUser>> List(IDictionary<string, string> urlParams = null,
68+
IDictionary<string, string> customHeaders = null)
69+
{
70+
if (urlParams == null) urlParams = new Dictionary<string, string>();
71+
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
72+
73+
var apiClient = new ApiClient(GetApiContext());
74+
var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams,
75+
customHeaders);
76+
77+
return FromJsonList<NotificationFilterPushUser>(responseRaw, OBJECT_TYPE_GET);
78+
}
79+
80+
/// <summary>
81+
/// </summary>
82+
public override bool IsAllFieldNull()
83+
{
84+
if (this.NotificationFilters != null)
85+
{
86+
return false;
87+
}
88+
89+
return true;
90+
}
91+
92+
/// <summary>
93+
/// </summary>
94+
public static NotificationFilterPushUser CreateFromJsonString(string json)
95+
{
96+
return BunqModel.CreateFromJsonString<NotificationFilterPushUser>(json);
97+
}
98+
}
99+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
using Bunq.Sdk.Context;
2+
using Bunq.Sdk.Http;
3+
using Bunq.Sdk.Json;
4+
using Bunq.Sdk.Model.Core;
5+
using Bunq.Sdk.Model.Generated.Object;
6+
using Newtonsoft.Json;
7+
using System.Collections.Generic;
8+
using System.Text;
9+
using System;
10+
11+
namespace Bunq.Sdk.Model.Generated.Endpoint
12+
{
13+
/// <summary>
14+
/// Manage the url notification filters for a user.
15+
/// </summary>
16+
public class NotificationFilterUrlMonetaryAccount : BunqModel
17+
{
18+
/// <summary>
19+
/// Endpoint constants.
20+
/// </summary>
21+
protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/notification-filter-url";
22+
23+
protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/notification-filter-url";
24+
25+
/// <summary>
26+
/// Field constants.
27+
/// </summary>
28+
public const string FIELD_NOTIFICATION_FILTERS = "notification_filters";
29+
30+
/// <summary>
31+
/// Object type.
32+
/// </summary>
33+
private const string OBJECT_TYPE_GET = "NotificationFilterUrl";
34+
35+
/// <summary>
36+
/// The types of notifications that will result in a url notification for this monetary account.
37+
/// </summary>
38+
[JsonProperty(PropertyName = "notification_filters")]
39+
public List<NotificationFilterUrl> NotificationFilters { get; set; }
40+
41+
/// <summary>
42+
/// </summary>
43+
/// <param name="notificationFilters">The types of notifications that will result in a url notification for this monetary account.</param>
44+
public static BunqResponse<int> Create(int? monetaryAccountId = null,
45+
List<NotificationFilterUrl> notificationFilters = null, IDictionary<string, string> customHeaders = null)
46+
{
47+
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
48+
49+
var apiClient = new ApiClient(GetApiContext());
50+
51+
var requestMap = new Dictionary<string, object>
52+
{
53+
{FIELD_NOTIFICATION_FILTERS, notificationFilters},
54+
};
55+
56+
var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap));
57+
var responseRaw =
58+
apiClient.Post(
59+
string.Format(ENDPOINT_URL_CREATE, DetermineUserId(),
60+
DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders);
61+
62+
return ProcessForId(responseRaw);
63+
}
64+
65+
/// <summary>
66+
/// </summary>
67+
public static BunqResponse<List<NotificationFilterUrlMonetaryAccount>> List(int? monetaryAccountId = null,
68+
IDictionary<string, string> urlParams = null, IDictionary<string, string> customHeaders = null)
69+
{
70+
if (urlParams == null) urlParams = new Dictionary<string, string>();
71+
if (customHeaders == null) customHeaders = new Dictionary<string, string>();
72+
73+
var apiClient = new ApiClient(GetApiContext());
74+
var responseRaw =
75+
apiClient.Get(
76+
string.Format(ENDPOINT_URL_LISTING, DetermineUserId(),
77+
DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders);
78+
79+
return FromJsonList<NotificationFilterUrlMonetaryAccount>(responseRaw, OBJECT_TYPE_GET);
80+
}
81+
82+
/// <summary>
83+
/// </summary>
84+
public override bool IsAllFieldNull()
85+
{
86+
if (this.NotificationFilters != null)
87+
{
88+
return false;
89+
}
90+
91+
return true;
92+
}
93+
94+
/// <summary>
95+
/// </summary>
96+
public static NotificationFilterUrlMonetaryAccount CreateFromJsonString(string json)
97+
{
98+
return BunqModel.CreateFromJsonString<NotificationFilterUrlMonetaryAccount>(json);
99+
}
100+
}
101+
}

0 commit comments

Comments
 (0)