Skip to content

Commit

Permalink
Merge tag '1.10.3' into develop
Browse files Browse the repository at this point in the history
Release 1.10.3
  • Loading branch information
Konstantin Yakushev committed May 22, 2019
2 parents 868f995 + a3cc7bd commit 4c48114
Show file tree
Hide file tree
Showing 13 changed files with 513 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .idea/.idea.BunqSdk/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BunqSdk/BunqSdk.csproj
Expand Up @@ -8,7 +8,7 @@
<PackageId>Bunq.Sdk</PackageId>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.10.2.0</VersionPrefix>
<VersionPrefix>1.10.3.0</VersionPrefix>
</PropertyGroup>
<PropertyGroup>
<RootNamespace>Bunq.Sdk</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Http/ApiClient.cs
Expand Up @@ -64,7 +64,7 @@ public class ApiClient
/// Values for the default headers
/// </summary>
private const string CACHE_CONTROL_NONE = "no-cache";
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.10.2";
private const string USER_AGENT_BUNQ = "bunq-sdk-csharp/1.10.3";
private const string LANGUAGE_EN_US = "en_US";
private const string REGION_NL_NL = "nl_NL";
private const string GEOLOCATION_ZERO = "0 0 0 0 NL";
Expand Down
17 changes: 16 additions & 1 deletion BunqSdk/Model/Generated/Endpoint/Card.cs
Expand Up @@ -37,6 +37,7 @@ public class Card : BunqModel
public const string FIELD_COUNTRY_PERMISSION = "country_permission";
public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment";
public const string FIELD_PRIMARY_ACCOUNT_NUMBERS_VIRTUAL = "primary_account_numbers_virtual";
public const string FIELD_PRIMARY_ACCOUNT_NUMBERS = "primary_account_numbers";
public const string FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback";

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

/// <summary>
/// Array of PANs and their attributes.
/// </summary>
[JsonProperty(PropertyName = "primary_account_numbers")]
public List<CardPrimaryAccountNumber> PrimaryAccountNumbers { get; set; }

/// <summary>
/// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if
/// not supplied.
Expand Down Expand Up @@ -213,13 +220,15 @@ public class Card : BunqModel
/// <param name="countryPermission">The countries for which to grant (temporary) permissions to use the card.</param>
/// <param name="pinCodeAssignment">Array of Types, PINs, account IDs assigned to the card.</param>
/// <param name="primaryAccountNumbersVirtual">Array of PANs, status, description and account id for online cards.</param>
/// <param name="primaryAccountNumbers">Array of PANs and their attributes.</param>
/// <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>
public static BunqResponse<Card> Update(int cardId, string pinCode = null, string activationCode = null,
string status = null, Amount cardLimit = null, Amount cardLimitAtm = null,
CardMagStripePermission magStripePermission = null, List<CardCountryPermission> countryPermission = null,
List<CardPinAssignment> pinCodeAssignment = null,
List<CardVirtualPrimaryAccountNumber> primaryAccountNumbersVirtual = null,
int? monetaryAccountIdFallback = null, IDictionary<string, string> customHeaders = null)
List<CardPrimaryAccountNumber> primaryAccountNumbers = null, int? monetaryAccountIdFallback = null,
IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

Expand All @@ -236,6 +245,7 @@ public class Card : BunqModel
{FIELD_COUNTRY_PERMISSION, countryPermission},
{FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment},
{FIELD_PRIMARY_ACCOUNT_NUMBERS_VIRTUAL, primaryAccountNumbersVirtual},
{FIELD_PRIMARY_ACCOUNT_NUMBERS, primaryAccountNumbers},
{FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback},
};

Expand Down Expand Up @@ -351,6 +361,11 @@ public override bool IsAllFieldNull()
return false;
}

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

if (this.CardLimit != null)
{
return false;
Expand Down
2 changes: 1 addition & 1 deletion BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs
Expand Up @@ -24,7 +24,7 @@ public class ExportStatementPayment : BunqModel
/// <summary>
/// Object type.
/// </summary>
private const string OBJECT_TYPE_GET = "Id";
private const string OBJECT_TYPE_GET = "ExportStatementPayment";

/// <summary>
/// The id of the single payment statement model.
Expand Down
99 changes: 99 additions & 0 deletions BunqSdk/Model/Generated/Endpoint/NotificationFilterPushUser.cs
@@ -0,0 +1,99 @@
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>
/// Manage the push notification filters for a user.
/// </summary>
public class NotificationFilterPushUser : BunqModel
{
/// <summary>
/// Endpoint constants.
/// </summary>
protected const string ENDPOINT_URL_CREATE = "user/{0}/notification-filter-push";

protected const string ENDPOINT_URL_LISTING = "user/{0}/notification-filter-push";

/// <summary>
/// Field constants.
/// </summary>
public const string FIELD_NOTIFICATION_FILTERS = "notification_filters";

/// <summary>
/// Object type.
/// </summary>
private const string OBJECT_TYPE_POST = "NotificationFilterPush";

private const string OBJECT_TYPE_GET = "NotificationFilterPush";

/// <summary>
/// The types of notifications that will result in a push notification for this user.
/// </summary>
[JsonProperty(PropertyName = "notification_filters")]
public List<NotificationFilterPush> NotificationFilters { get; set; }

/// <summary>
/// </summary>
/// <param name="notificationFilters">The types of notifications that will result in a push notification for this user.</param>
public static BunqResponse<NotificationFilterPushUser> Create(
List<NotificationFilterPush> notificationFilters = null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

var apiClient = new ApiClient(GetApiContext());

var requestMap = new Dictionary<string, object>
{
{FIELD_NOTIFICATION_FILTERS, notificationFilters},
};

var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap));
var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes,
customHeaders);

return FromJson<NotificationFilterPushUser>(responseRaw, OBJECT_TYPE_POST);
}

/// <summary>
/// </summary>
public static BunqResponse<List<NotificationFilterPushUser>> List(IDictionary<string, string> urlParams = null,
IDictionary<string, string> customHeaders = null)
{
if (urlParams == null) urlParams = new Dictionary<string, string>();
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

var apiClient = new ApiClient(GetApiContext());
var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams,
customHeaders);

return FromJsonList<NotificationFilterPushUser>(responseRaw, OBJECT_TYPE_GET);
}

/// <summary>
/// </summary>
public override bool IsAllFieldNull()
{
if (this.NotificationFilters != null)
{
return false;
}

return true;
}

/// <summary>
/// </summary>
public static NotificationFilterPushUser CreateFromJsonString(string json)
{
return BunqModel.CreateFromJsonString<NotificationFilterPushUser>(json);
}
}
}
@@ -0,0 +1,101 @@
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>
/// Manage the url notification filters for a user.
/// </summary>
public class NotificationFilterUrlMonetaryAccount : BunqModel
{
/// <summary>
/// Endpoint constants.
/// </summary>
protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/notification-filter-url";

protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/notification-filter-url";

/// <summary>
/// Field constants.
/// </summary>
public const string FIELD_NOTIFICATION_FILTERS = "notification_filters";

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

/// <summary>
/// The types of notifications that will result in a url notification for this monetary account.
/// </summary>
[JsonProperty(PropertyName = "notification_filters")]
public List<NotificationFilterUrl> NotificationFilters { get; set; }

/// <summary>
/// </summary>
/// <param name="notificationFilters">The types of notifications that will result in a url notification for this monetary account.</param>
public static BunqResponse<int> Create(int? monetaryAccountId = null,
List<NotificationFilterUrl> notificationFilters = null, IDictionary<string, string> customHeaders = null)
{
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

var apiClient = new ApiClient(GetApiContext());

var requestMap = new Dictionary<string, object>
{
{FIELD_NOTIFICATION_FILTERS, notificationFilters},
};

var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap));
var responseRaw =
apiClient.Post(
string.Format(ENDPOINT_URL_CREATE, DetermineUserId(),
DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders);

return ProcessForId(responseRaw);
}

/// <summary>
/// </summary>
public static BunqResponse<List<NotificationFilterUrlMonetaryAccount>> List(int? monetaryAccountId = null,
IDictionary<string, string> urlParams = null, IDictionary<string, string> customHeaders = null)
{
if (urlParams == null) urlParams = new Dictionary<string, string>();
if (customHeaders == null) customHeaders = new Dictionary<string, string>();

var apiClient = new ApiClient(GetApiContext());
var responseRaw =
apiClient.Get(
string.Format(ENDPOINT_URL_LISTING, DetermineUserId(),
DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders);

return FromJsonList<NotificationFilterUrlMonetaryAccount>(responseRaw, OBJECT_TYPE_GET);
}

/// <summary>
/// </summary>
public override bool IsAllFieldNull()
{
if (this.NotificationFilters != null)
{
return false;
}

return true;
}

/// <summary>
/// </summary>
public static NotificationFilterUrlMonetaryAccount CreateFromJsonString(string json)
{
return BunqModel.CreateFromJsonString<NotificationFilterUrlMonetaryAccount>(json);
}
}
}

0 comments on commit 4c48114

Please sign in to comment.