Skip to content

Commit

Permalink
Rearranged code. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
OGKevin committed Nov 15, 2017
1 parent 07f8158 commit cd70ea3
Show file tree
Hide file tree
Showing 21 changed files with 28 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class BunqMeTabEntry extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "BunqMeTabEntry";
private static final String OBJECT_TYPE = "BunqMeTab";

/**
* The uuid of the bunq.me.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Card extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "Card";
private static final String OBJECT_TYPE = "CardDebit";

/**
* The id of the card.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class CardName extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "CardName";
private static final String OBJECT_TYPE = "CardUserNameArray";

/**
* All possible variations (of suitable length) of user's legal name for the debit card.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CashRegisterQrCode extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "CashRegisterQrCode";
private static final String OBJECT_TYPE = "TokenQrCashRegister";

/**
* The id of the created QR code. Use this id to get the RAW content of the QR code with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ChatConversationReference extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatConversationReference";
private static final String OBJECT_TYPE = "SupportConversationReference";

/**
* The id of this conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ChatConversationSupportExternal extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatConversationSupportExternal";
private static final String OBJECT_TYPE = "SupportConversationExternal";

/**
* The id of this conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ChatMessageAnnouncement extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatMessageAnnouncement";
private static final String OBJECT_TYPE = "ChatMessageUser";

/**
* The id of the message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ChatMessageAttachment extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatMessageAttachment";
private static final String OBJECT_TYPE = "Id";

/**
* The id of the newly created chat message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ChatMessageStatus extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatMessageStatus";
private static final String OBJECT_TYPE = "ChatMessageUser";

/**
* The id of the message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ChatMessageText extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ChatMessageText";
private static final String OBJECT_TYPE = "Id";

/**
* The id of the newly created chat message.
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/com/bunq/sdk/model/generated/endpoint/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ public class Device extends BunqModel {
*/
private static final String OBJECT_TYPE = "Device";

/**
*/
@Expose
@SerializedName("DevicePhone")
private DevicePhone devicePhone;

/**
*/
@Expose
Expand Down Expand Up @@ -82,16 +76,6 @@ public static BunqResponse<List<Device>> list(ApiContext apiContext, Map<String,
return fromJsonList(Device.class, responseRaw);
}

/**
*/
public DevicePhone getDevicePhone() {
return this.devicePhone;
}

public void setDevicePhone(DevicePhone devicePhone) {
this.devicePhone = devicePhone;
}

/**
*/
public DeviceServer getDeviceServer() {
Expand All @@ -105,10 +89,6 @@ public void setDeviceServer(DeviceServer deviceServer) {
/**
*/
public BunqModel getReferencedObject() {
if (this.devicePhone != null) {
return this.devicePhone;
}

if (this.deviceServer != null) {
return this.deviceServer;
}
Expand Down
156 changes: 0 additions & 156 deletions src/main/java/com/bunq/sdk/model/generated/endpoint/DevicePhone.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class InstallationServerPublicKey extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "InstallationServerPublicKey";
private static final String OBJECT_TYPE = "ServerPublicKey";

/**
* The server's public key for this Installation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class InvoiceByUser extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "InvoiceByUser";
private static final String OBJECT_TYPE = "Invoice";

/**
* The id of the invoice object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class PaymentChat extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "PaymentChat";
private static final String OBJECT_TYPE = "ChatConversationPayment";

/**
* The id of the chat conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class ScheduleInstance extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "ScheduleInstance";
private static final String OBJECT_TYPE = "ScheduledInstance";

/**
* The state of the scheduleInstance. (FINISHED_SUCCESSFULLY, RETRY, FAILED_USER_ERROR)
Expand Down Expand Up @@ -95,18 +95,18 @@ public static BunqResponse<ScheduleInstance> get(ApiContext apiContext, Integer
return fromJson(ScheduleInstance.class, responseRaw, OBJECT_TYPE);
}

public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer scheduleId, Integer scheduleInstanceId) {
public static BunqResponse<ScheduleInstance> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer scheduleId, Integer scheduleInstanceId) {
return update(apiContext, requestMap, userId, monetaryAccountId, scheduleId, scheduleInstanceId, new HashMap<>());
}

/**
*/
public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer scheduleId, Integer scheduleInstanceId, Map<String, String> customHeaders) {
public static BunqResponse<ScheduleInstance> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer scheduleId, Integer scheduleInstanceId, Map<String, String> customHeaders) {
ApiClient apiClient = new ApiClient(apiContext);
byte[] requestBytes = gson.toJson(requestMap).getBytes();
BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, userId, monetaryAccountId, scheduleId, scheduleInstanceId), requestBytes, customHeaders);

return processForId(responseRaw);
return fromJson(ScheduleInstance.class, responseRaw, OBJECT_TYPE);
}

public static BunqResponse<List<ScheduleInstance>> list(ApiContext apiContext, Integer userId, Integer monetaryAccountId, Integer scheduleId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SchedulePayment extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "SchedulePayment";
private static final String OBJECT_TYPE = "ScheduledPayment";

/**
* The payment details.
Expand Down Expand Up @@ -112,18 +112,18 @@ public static BunqResponse<List<SchedulePayment>> list(ApiContext apiContext, In
return fromJsonList(SchedulePayment.class, responseRaw, OBJECT_TYPE);
}

public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer schedulePaymentId) {
public static BunqResponse<SchedulePayment> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer schedulePaymentId) {
return update(apiContext, requestMap, userId, monetaryAccountId, schedulePaymentId, new HashMap<>());
}

/**
*/
public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer schedulePaymentId, Map<String, String> customHeaders) {
public static BunqResponse<SchedulePayment> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer schedulePaymentId, Map<String, String> customHeaders) {
ApiClient apiClient = new ApiClient(apiContext);
byte[] requestBytes = gson.toJson(requestMap).getBytes();
BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, userId, monetaryAccountId, schedulePaymentId), requestBytes, customHeaders);

return processForId(responseRaw);
return fromJson(SchedulePayment.class, responseRaw, OBJECT_TYPE);
}

/**
Expand Down
Loading

0 comments on commit cd70ea3

Please sign in to comment.