diff --git a/build.gradle b/build.gradle index 90850772..e5d36a3c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ group 'com.bunq.sdk' -version '1.28.0.4' +version '1.28.0.5' apply plugin: 'java' apply plugin: 'maven-publish' @@ -48,7 +48,7 @@ publishing { from components.java groupId = 'com.bunq.sdk' artifactId = 'sdk_java' - version = '1.28.0.4' + version = '1.28.0.5' } } } diff --git a/src/main/java/com/bunq/sdk/context/ApiContext.java b/src/main/java/com/bunq/sdk/context/ApiContext.java index 622bd3c5..fb07fcdb 100644 --- a/src/main/java/com/bunq/sdk/context/ApiContext.java +++ b/src/main/java/com/bunq/sdk/context/ApiContext.java @@ -49,7 +49,7 @@ public class ApiContext implements java.io.Serializable { /** * Dummy ID to pass to Session endpoint. */ - private static final int SESSION_ID_DUMMY = 0; + private static final long SESSION_ID_DUMMY = 0; /** * Minimum time to session expiry not requiring session reset. diff --git a/src/main/java/com/bunq/sdk/context/SessionContext.java b/src/main/java/com/bunq/sdk/context/SessionContext.java index 66aeacc4..13d707f2 100644 --- a/src/main/java/com/bunq/sdk/context/SessionContext.java +++ b/src/main/java/com/bunq/sdk/context/SessionContext.java @@ -75,7 +75,7 @@ public class SessionContext implements java.io.Serializable { this.userPaymentServiceProvider = sessionServer.getUserPaymentServiceProviderOrNull(); } - private int getUserId(BunqModel user) { + private long getUserId(BunqModel user) { if (user instanceof UserPersonApiObject) { return ((UserPersonApiObject) user).getId(); } else if (user instanceof UserCompanyApiObject) { @@ -97,7 +97,7 @@ private static Date calculateExpiryTime(SessionServer sessionServer) { return expiryTime; } - private static int getSessionTimeout(SessionServer sessionServer) { + private static long getSessionTimeout(SessionServer sessionServer) { BunqModel user = sessionServer.getReferencedUser(); if (user instanceof UserApiKeyApiObject) { @@ -109,7 +109,7 @@ private static int getSessionTimeout(SessionServer sessionServer) { } } - private static int getSessionTimeOutFromUser(BunqModel user) { + private static long getSessionTimeOutFromUser(BunqModel user) { if (user instanceof UserCompanyApiObject) { return ((UserCompanyApiObject) user).getSessionTimeout(); } else if (user instanceof UserPersonApiObject) { diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/FeatureAnnouncementApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/FeatureAnnouncementApiObject.java index 2a12802b..4f283a53 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/FeatureAnnouncementApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/FeatureAnnouncementApiObject.java @@ -1,5 +1,9 @@ package com.bunq.sdk.model.generated.endpoint; +import com.bunq.sdk.context.ApiContext; +import com.bunq.sdk.http.ApiClient; +import com.bunq.sdk.http.BunqResponse; +import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.AvatarObject; @@ -11,21 +15,22 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.lang.model.type.NullType; /** - * view for creating the feature announcement. + * view for updating the feature display. */ public class FeatureAnnouncementApiObject extends BunqModel { /** - * Field constants. + * Endpoint constants. */ - public static final String FIELD_AVATAR_UUID = "avatar_uuid"; - public static final String FIELD_TITLE = "title"; - public static final String FIELD_SUB_TITLE = "sub_title"; - public static final String FIELD_STATUS = "status"; - public static final String FIELD_FEATURE_ACCESS_ID = "feature_access_id"; - public static final String FIELD_CONTENT_TYPE = "content_type"; + protected static final String ENDPOINT_URL_READ = "user/%s/feature-announcement/%s"; + + /** + * Object type. + */ + protected static final String OBJECT_TYPE_GET = "FeatureAnnouncement"; /** * The Avatar of the event overview. @@ -35,113 +40,45 @@ public class FeatureAnnouncementApiObject extends BunqModel { private AvatarObject avatar; /** - * The event title of the feature announcement. + * The event overview title of the feature display */ @Expose @SerializedName("title") - private List title; + private String title; /** - * The event sub title of the feature announcement. + * The event overview subtitle of the feature display */ @Expose @SerializedName("sub_title") - private List subTitle; + private String subTitle; /** - * The type of the feature announcement. + * The type of the feature announcement so apps can override with their own stuff if desired */ @Expose @SerializedName("type") private String type; /** - * The status of the feature announcement. - */ - @Expose - @SerializedName("status") - private String status; - - /** - * The event sub title of the feature announcement. - */ - @Expose - @SerializedName("all_feature_announcement_content") - private List allFeatureAnnouncementContent; - - /** - * The avatar uuid. - */ - @Expose - @SerializedName("avatar_uuid_field_for_request") - private String avatarUuidFieldForRequest; - - /** - * The event title of the feature announcement. - */ - @Expose - @SerializedName("title_field_for_request") - private List titleFieldForRequest; - - /** - * The event sub title of the feature announcement. - */ - @Expose - @SerializedName("sub_title_field_for_request") - private List subTitleFieldForRequest; - - /** - * The status of the feature announcement. - */ - @Expose - @SerializedName("status_field_for_request") - private String statusFieldForRequest; - - /** - * The feature access id that controls the feature announcement. - */ - @Expose - @SerializedName("feature_access_id_field_for_request") - private String featureAccessIdFieldForRequest; - - /** - * The content type of the feature announcement. */ - @Expose - @SerializedName("content_type_field_for_request") - private String contentTypeFieldForRequest; - - public FeatureAnnouncementApiObject() { - this(null, null, null, null, null, null); - } - - public FeatureAnnouncementApiObject(List title) { - this(title, null, null, null, null, null); - } - - public FeatureAnnouncementApiObject(List title, List subTitle) { - this(title, subTitle, null, null, null, null); - } + public static BunqResponse get(Long featureAnnouncementId, Map params, Map customHeaders) { + ApiClient apiClient = new ApiClient(getApiContext()); + BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId(), featureAnnouncementId), params, customHeaders); - public FeatureAnnouncementApiObject(List title, List subTitle, String contentType) { - this(title, subTitle, contentType, null, null, null); + return fromJson(FeatureAnnouncementApiObject.class, responseRaw, OBJECT_TYPE_GET); } - public FeatureAnnouncementApiObject(List title, List subTitle, String contentType, String avatarUuid) { - this(title, subTitle, contentType, avatarUuid, null, null); + public static BunqResponse get() { + return get(null, null, null); } - public FeatureAnnouncementApiObject(List title, List subTitle, String contentType, String avatarUuid, String status) { - this(title, subTitle, contentType, avatarUuid, status, null); + public static BunqResponse get(Long featureAnnouncementId) { + return get(featureAnnouncementId, null, null); } - public FeatureAnnouncementApiObject(List title, List subTitle, String contentType, String avatarUuid, String status, String featureAccessId) { - this.avatarUuidFieldForRequest = avatarUuid; - this.titleFieldForRequest = title; - this.subTitleFieldForRequest = subTitle; - this.statusFieldForRequest = status; - this.featureAccessIdFieldForRequest = featureAccessId; - this.contentTypeFieldForRequest = contentType; + public static BunqResponse get(Long featureAnnouncementId, Map params) { + return get(featureAnnouncementId, params, null); } /** @@ -156,29 +93,29 @@ public void setAvatar(AvatarObject avatar) { } /** - * The event title of the feature announcement. + * The event overview title of the feature display */ - public List getTitle() { + public String getTitle() { return this.title; } - public void setTitle(List title) { + public void setTitle(String title) { this.title = title; } /** - * The event sub title of the feature announcement. + * The event overview subtitle of the feature display */ - public List getSubTitle() { + public String getSubTitle() { return this.subTitle; } - public void setSubTitle(List subTitle) { + public void setSubTitle(String subTitle) { this.subTitle = subTitle; } /** - * The type of the feature announcement. + * The type of the feature announcement so apps can override with their own stuff if desired */ public String getType() { return this.type; @@ -188,28 +125,6 @@ public void setType(String type) { this.type = type; } - /** - * The status of the feature announcement. - */ - public String getStatus() { - return this.status; - } - - public void setStatus(String status) { - this.status = status; - } - - /** - * The event sub title of the feature announcement. - */ - public List getAllFeatureAnnouncementContent() { - return this.allFeatureAnnouncementContent; - } - - public void setAllFeatureAnnouncementContent(List allFeatureAnnouncementContent) { - this.allFeatureAnnouncementContent = allFeatureAnnouncementContent; - } - /** */ public boolean isAllFieldNull() { @@ -229,14 +144,6 @@ public boolean isAllFieldNull() { return false; } - if (this.status != null) { - return false; - } - - if (this.allFeatureAnnouncementContent != null) { - return false; - } - return true; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/NotificationFilterFailureApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/NotificationFilterFailureApiObject.java index 06d5fc38..0f52b061 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/NotificationFilterFailureApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/NotificationFilterFailureApiObject.java @@ -80,13 +80,6 @@ public class NotificationFilterFailureApiObject extends BunqModel { @SerializedName("response_code") private Long responseCode; - /** - * This is the URL to which the callback will be made. - */ - @Expose - @SerializedName("notification_target") - private String notificationTarget; - /** * The IDs to retry. */ @@ -210,17 +203,6 @@ public void setResponseCode(Long responseCode) { this.responseCode = responseCode; } - /** - * This is the URL to which the callback will be made. - */ - public String getNotificationTarget() { - return this.notificationTarget; - } - - public void setNotificationTarget(String notificationTarget) { - this.notificationTarget = notificationTarget; - } - /** */ public boolean isAllFieldNull() { @@ -248,10 +230,6 @@ public boolean isAllFieldNull() { return false; } - if (this.notificationTarget != null) { - return false; - } - return true; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentAutoAllocateInstanceApiObject.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentAutoAllocateInstanceApiObject.java index aa491719..f5b15d76 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentAutoAllocateInstanceApiObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentAutoAllocateInstanceApiObject.java @@ -96,13 +96,6 @@ public class PaymentAutoAllocateInstanceApiObject extends BunqModel { @SerializedName("all_ginmon_transaction_order") private List allGinmonTransactionOrder; - /** - * All Kraken transactions executed with this instance. - */ - @Expose - @SerializedName("all_kraken_transaction") - private List allKrakenTransaction; - /** */ public static BunqResponse> list(Long paymentAutoAllocateId, Long monetaryAccountId, Map params, Map customHeaders) { @@ -256,17 +249,6 @@ public void setAllGinmonTransactionOrder(List allGin this.allGinmonTransactionOrder = allGinmonTransactionOrder; } - /** - * All Kraken transactions executed with this instance. - */ - public List getAllKrakenTransaction() { - return this.allKrakenTransaction; - } - - public void setAllKrakenTransaction(List allKrakenTransaction) { - this.allKrakenTransaction = allKrakenTransaction; - } - /** */ public boolean isAllFieldNull() { @@ -306,10 +288,6 @@ public boolean isAllFieldNull() { return false; } - if (this.allKrakenTransaction != null) { - return false; - } - return true; }