Skip to content

Commit ede4195

Browse files
authored
Merge pull request #161 from denizy97/develop
Fix failing build - regenerate code using latest main branch, convert some remaining ints to longs
2 parents fe947bc + bd0e356 commit ede4195

File tree

6 files changed

+41
-178
lines changed

6 files changed

+41
-178
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.bunq.sdk'
2-
version '1.28.0.4'
2+
version '1.28.0.5'
33

44
apply plugin: 'java'
55
apply plugin: 'maven-publish'
@@ -48,7 +48,7 @@ publishing {
4848
from components.java
4949
groupId = 'com.bunq.sdk'
5050
artifactId = 'sdk_java'
51-
version = '1.28.0.4'
51+
version = '1.28.0.5'
5252
}
5353
}
5454
}

src/main/java/com/bunq/sdk/context/ApiContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class ApiContext implements java.io.Serializable {
4949
/**
5050
* Dummy ID to pass to Session endpoint.
5151
*/
52-
private static final int SESSION_ID_DUMMY = 0;
52+
private static final long SESSION_ID_DUMMY = 0;
5353

5454
/**
5555
* Minimum time to session expiry not requiring session reset.

src/main/java/com/bunq/sdk/context/SessionContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class SessionContext implements java.io.Serializable {
7575
this.userPaymentServiceProvider = sessionServer.getUserPaymentServiceProviderOrNull();
7676
}
7777

78-
private int getUserId(BunqModel user) {
78+
private long getUserId(BunqModel user) {
7979
if (user instanceof UserPersonApiObject) {
8080
return ((UserPersonApiObject) user).getId();
8181
} else if (user instanceof UserCompanyApiObject) {
@@ -97,7 +97,7 @@ private static Date calculateExpiryTime(SessionServer sessionServer) {
9797
return expiryTime;
9898
}
9999

100-
private static int getSessionTimeout(SessionServer sessionServer) {
100+
private static long getSessionTimeout(SessionServer sessionServer) {
101101
BunqModel user = sessionServer.getReferencedUser();
102102

103103
if (user instanceof UserApiKeyApiObject) {
@@ -109,7 +109,7 @@ private static int getSessionTimeout(SessionServer sessionServer) {
109109
}
110110
}
111111

112-
private static int getSessionTimeOutFromUser(BunqModel user) {
112+
private static long getSessionTimeOutFromUser(BunqModel user) {
113113
if (user instanceof UserCompanyApiObject) {
114114
return ((UserCompanyApiObject) user).getSessionTimeout();
115115
} else if (user instanceof UserPersonApiObject) {

src/main/java/com/bunq/sdk/model/generated/endpoint/FeatureAnnouncementApiObject.java

Lines changed: 35 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package com.bunq.sdk.model.generated.endpoint;
22

3+
import com.bunq.sdk.context.ApiContext;
4+
import com.bunq.sdk.http.ApiClient;
5+
import com.bunq.sdk.http.BunqResponse;
6+
import com.bunq.sdk.http.BunqResponseRaw;
37
import com.bunq.sdk.model.core.BunqModel;
48
import com.bunq.sdk.model.core.MonetaryAccountReference;
59
import com.bunq.sdk.model.generated.object.AvatarObject;
@@ -11,21 +15,22 @@
1115
import java.util.HashMap;
1216
import java.util.List;
1317
import java.util.Map;
18+
import javax.lang.model.type.NullType;
1419

1520
/**
16-
* view for creating the feature announcement.
21+
* view for updating the feature display.
1722
*/
1823
public class FeatureAnnouncementApiObject extends BunqModel {
1924

2025
/**
21-
* Field constants.
26+
* Endpoint constants.
2227
*/
23-
public static final String FIELD_AVATAR_UUID = "avatar_uuid";
24-
public static final String FIELD_TITLE = "title";
25-
public static final String FIELD_SUB_TITLE = "sub_title";
26-
public static final String FIELD_STATUS = "status";
27-
public static final String FIELD_FEATURE_ACCESS_ID = "feature_access_id";
28-
public static final String FIELD_CONTENT_TYPE = "content_type";
28+
protected static final String ENDPOINT_URL_READ = "user/%s/feature-announcement/%s";
29+
30+
/**
31+
* Object type.
32+
*/
33+
protected static final String OBJECT_TYPE_GET = "FeatureAnnouncement";
2934

3035
/**
3136
* The Avatar of the event overview.
@@ -35,113 +40,45 @@ public class FeatureAnnouncementApiObject extends BunqModel {
3540
private AvatarObject avatar;
3641

3742
/**
38-
* The event title of the feature announcement.
43+
* The event overview title of the feature display
3944
*/
4045
@Expose
4146
@SerializedName("title")
42-
private List<String> title;
47+
private String title;
4348

4449
/**
45-
* The event sub title of the feature announcement.
50+
* The event overview subtitle of the feature display
4651
*/
4752
@Expose
4853
@SerializedName("sub_title")
49-
private List<String> subTitle;
54+
private String subTitle;
5055

5156
/**
52-
* The type of the feature announcement.
57+
* The type of the feature announcement so apps can override with their own stuff if desired
5358
*/
5459
@Expose
5560
@SerializedName("type")
5661
private String type;
5762

5863
/**
59-
* The status of the feature announcement.
60-
*/
61-
@Expose
62-
@SerializedName("status")
63-
private String status;
64-
65-
/**
66-
* The event sub title of the feature announcement.
67-
*/
68-
@Expose
69-
@SerializedName("all_feature_announcement_content")
70-
private List<String> allFeatureAnnouncementContent;
71-
72-
/**
73-
* The avatar uuid.
74-
*/
75-
@Expose
76-
@SerializedName("avatar_uuid_field_for_request")
77-
private String avatarUuidFieldForRequest;
78-
79-
/**
80-
* The event title of the feature announcement.
81-
*/
82-
@Expose
83-
@SerializedName("title_field_for_request")
84-
private List<String> titleFieldForRequest;
85-
86-
/**
87-
* The event sub title of the feature announcement.
88-
*/
89-
@Expose
90-
@SerializedName("sub_title_field_for_request")
91-
private List<String> subTitleFieldForRequest;
92-
93-
/**
94-
* The status of the feature announcement.
95-
*/
96-
@Expose
97-
@SerializedName("status_field_for_request")
98-
private String statusFieldForRequest;
99-
100-
/**
101-
* The feature access id that controls the feature announcement.
102-
*/
103-
@Expose
104-
@SerializedName("feature_access_id_field_for_request")
105-
private String featureAccessIdFieldForRequest;
106-
107-
/**
108-
* The content type of the feature announcement.
10964
*/
110-
@Expose
111-
@SerializedName("content_type_field_for_request")
112-
private String contentTypeFieldForRequest;
113-
114-
public FeatureAnnouncementApiObject() {
115-
this(null, null, null, null, null, null);
116-
}
117-
118-
public FeatureAnnouncementApiObject(List<String> title) {
119-
this(title, null, null, null, null, null);
120-
}
121-
122-
public FeatureAnnouncementApiObject(List<String> title, List<String> subTitle) {
123-
this(title, subTitle, null, null, null, null);
124-
}
65+
public static BunqResponse<FeatureAnnouncementApiObject> get(Long featureAnnouncementId, Map<String, String> params, Map<String, String> customHeaders) {
66+
ApiClient apiClient = new ApiClient(getApiContext());
67+
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId(), featureAnnouncementId), params, customHeaders);
12568

126-
public FeatureAnnouncementApiObject(List<String> title, List<String> subTitle, String contentType) {
127-
this(title, subTitle, contentType, null, null, null);
69+
return fromJson(FeatureAnnouncementApiObject.class, responseRaw, OBJECT_TYPE_GET);
12870
}
12971

130-
public FeatureAnnouncementApiObject(List<String> title, List<String> subTitle, String contentType, String avatarUuid) {
131-
this(title, subTitle, contentType, avatarUuid, null, null);
72+
public static BunqResponse<FeatureAnnouncementApiObject> get() {
73+
return get(null, null, null);
13274
}
13375

134-
public FeatureAnnouncementApiObject(List<String> title, List<String> subTitle, String contentType, String avatarUuid, String status) {
135-
this(title, subTitle, contentType, avatarUuid, status, null);
76+
public static BunqResponse<FeatureAnnouncementApiObject> get(Long featureAnnouncementId) {
77+
return get(featureAnnouncementId, null, null);
13678
}
13779

138-
public FeatureAnnouncementApiObject(List<String> title, List<String> subTitle, String contentType, String avatarUuid, String status, String featureAccessId) {
139-
this.avatarUuidFieldForRequest = avatarUuid;
140-
this.titleFieldForRequest = title;
141-
this.subTitleFieldForRequest = subTitle;
142-
this.statusFieldForRequest = status;
143-
this.featureAccessIdFieldForRequest = featureAccessId;
144-
this.contentTypeFieldForRequest = contentType;
80+
public static BunqResponse<FeatureAnnouncementApiObject> get(Long featureAnnouncementId, Map<String, String> params) {
81+
return get(featureAnnouncementId, params, null);
14582
}
14683

14784
/**
@@ -156,29 +93,29 @@ public void setAvatar(AvatarObject avatar) {
15693
}
15794

15895
/**
159-
* The event title of the feature announcement.
96+
* The event overview title of the feature display
16097
*/
161-
public List<String> getTitle() {
98+
public String getTitle() {
16299
return this.title;
163100
}
164101

165-
public void setTitle(List<String> title) {
102+
public void setTitle(String title) {
166103
this.title = title;
167104
}
168105

169106
/**
170-
* The event sub title of the feature announcement.
107+
* The event overview subtitle of the feature display
171108
*/
172-
public List<String> getSubTitle() {
109+
public String getSubTitle() {
173110
return this.subTitle;
174111
}
175112

176-
public void setSubTitle(List<String> subTitle) {
113+
public void setSubTitle(String subTitle) {
177114
this.subTitle = subTitle;
178115
}
179116

180117
/**
181-
* The type of the feature announcement.
118+
* The type of the feature announcement so apps can override with their own stuff if desired
182119
*/
183120
public String getType() {
184121
return this.type;
@@ -188,28 +125,6 @@ public void setType(String type) {
188125
this.type = type;
189126
}
190127

191-
/**
192-
* The status of the feature announcement.
193-
*/
194-
public String getStatus() {
195-
return this.status;
196-
}
197-
198-
public void setStatus(String status) {
199-
this.status = status;
200-
}
201-
202-
/**
203-
* The event sub title of the feature announcement.
204-
*/
205-
public List<String> getAllFeatureAnnouncementContent() {
206-
return this.allFeatureAnnouncementContent;
207-
}
208-
209-
public void setAllFeatureAnnouncementContent(List<String> allFeatureAnnouncementContent) {
210-
this.allFeatureAnnouncementContent = allFeatureAnnouncementContent;
211-
}
212-
213128
/**
214129
*/
215130
public boolean isAllFieldNull() {
@@ -229,14 +144,6 @@ public boolean isAllFieldNull() {
229144
return false;
230145
}
231146

232-
if (this.status != null) {
233-
return false;
234-
}
235-
236-
if (this.allFeatureAnnouncementContent != null) {
237-
return false;
238-
}
239-
240147
return true;
241148
}
242149

src/main/java/com/bunq/sdk/model/generated/endpoint/NotificationFilterFailureApiObject.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ public class NotificationFilterFailureApiObject extends BunqModel {
8080
@SerializedName("response_code")
8181
private Long responseCode;
8282

83-
/**
84-
* This is the URL to which the callback will be made.
85-
*/
86-
@Expose
87-
@SerializedName("notification_target")
88-
private String notificationTarget;
89-
9083
/**
9184
* The IDs to retry.
9285
*/
@@ -210,17 +203,6 @@ public void setResponseCode(Long responseCode) {
210203
this.responseCode = responseCode;
211204
}
212205

213-
/**
214-
* This is the URL to which the callback will be made.
215-
*/
216-
public String getNotificationTarget() {
217-
return this.notificationTarget;
218-
}
219-
220-
public void setNotificationTarget(String notificationTarget) {
221-
this.notificationTarget = notificationTarget;
222-
}
223-
224206
/**
225207
*/
226208
public boolean isAllFieldNull() {
@@ -248,10 +230,6 @@ public boolean isAllFieldNull() {
248230
return false;
249231
}
250232

251-
if (this.notificationTarget != null) {
252-
return false;
253-
}
254-
255233
return true;
256234
}
257235

src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentAutoAllocateInstanceApiObject.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ public class PaymentAutoAllocateInstanceApiObject extends BunqModel {
9696
@SerializedName("all_ginmon_transaction_order")
9797
private List<GinmonTransactionApiObject> allGinmonTransactionOrder;
9898

99-
/**
100-
* All Kraken transactions executed with this instance.
101-
*/
102-
@Expose
103-
@SerializedName("all_kraken_transaction")
104-
private List<KrakenTransactionApiObject> allKrakenTransaction;
105-
10699
/**
107100
*/
108101
public static BunqResponse<List<PaymentAutoAllocateInstanceApiObject>> list(Long paymentAutoAllocateId, Long monetaryAccountId, Map<String, String> params, Map<String, String> customHeaders) {
@@ -256,17 +249,6 @@ public void setAllGinmonTransactionOrder(List<GinmonTransactionApiObject> allGin
256249
this.allGinmonTransactionOrder = allGinmonTransactionOrder;
257250
}
258251

259-
/**
260-
* All Kraken transactions executed with this instance.
261-
*/
262-
public List<KrakenTransactionApiObject> getAllKrakenTransaction() {
263-
return this.allKrakenTransaction;
264-
}
265-
266-
public void setAllKrakenTransaction(List<KrakenTransactionApiObject> allKrakenTransaction) {
267-
this.allKrakenTransaction = allKrakenTransaction;
268-
}
269-
270252
/**
271253
*/
272254
public boolean isAllFieldNull() {
@@ -306,10 +288,6 @@ public boolean isAllFieldNull() {
306288
return false;
307289
}
308290

309-
if (this.allKrakenTransaction != null) {
310-
return false;
311-
}
312-
313291
return true;
314292
}
315293

0 commit comments

Comments
 (0)