Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerated code to add corerct object types. (bunq/sdk_java#47) #70

Merged
merged 2 commits into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class AttachmentConversationContent extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "AttachmentConversationContent";
private static final String OBJECT_TYPE_GET = "AttachmentConversationContent";

public static BunqResponse<byte[]> list(ApiContext apiContext, Integer userId, Integer chatConversationId, Integer attachmentId) {
return list(apiContext, userId, chatConversationId, attachmentId, new HashMap<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public class AttachmentMonetaryAccount extends BunqModel {
*/
private static final String ENDPOINT_URL_CREATE = "user/%s/monetary-account/%s/attachment";

/**
* Object type.
*/
private static final String OBJECT_TYPE = "AttachmentMonetaryAccount";

/**
* The attachment.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class AttachmentPublic extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "AttachmentPublic";
private static final String OBJECT_TYPE_POST = "Uuid";
private static final String OBJECT_TYPE_GET = "AttachmentPublic";

/**
* The UUID of the attachment.
Expand Down Expand Up @@ -91,7 +92,7 @@ public static BunqResponse<AttachmentPublic> get(ApiContext apiContext, String a
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, attachmentPublicUuid), new HashMap<>(), customHeaders);

return fromJson(AttachmentPublic.class, responseRaw, OBJECT_TYPE);
return fromJson(AttachmentPublic.class, responseRaw, OBJECT_TYPE_GET);
}

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

public static BunqResponse<byte[]> list(ApiContext apiContext, String attachmentPublicUuid) {
return list(apiContext, attachmentPublicUuid, new HashMap<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class AttachmentTab extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "AttachmentTab";
private static final String OBJECT_TYPE_GET = "AttachmentTab";

/**
* The id of the attachment.
Expand Down Expand Up @@ -93,7 +93,7 @@ public static BunqResponse<AttachmentTab> get(ApiContext apiContext, Integer use
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, userId, monetaryAccountId, attachmentTabId), new HashMap<>(), customHeaders);

return fromJson(AttachmentTab.class, responseRaw, OBJECT_TYPE);
return fromJson(AttachmentTab.class, responseRaw, OBJECT_TYPE_GET);
}

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

public static BunqResponse<byte[]> list(ApiContext apiContext, Integer userId, Integer monetaryAccountId, Integer attachmentTabId) {
return list(apiContext, userId, monetaryAccountId, attachmentTabId, new HashMap<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public class Avatar extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "Avatar";
private static final String OBJECT_TYPE_POST = "Uuid";
private static final String OBJECT_TYPE_GET = "Avatar";

/**
* The UUID of the created avatar.
Expand Down Expand Up @@ -80,7 +81,7 @@ public static BunqResponse<Avatar> get(ApiContext apiContext, String avatarUuid,
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, avatarUuid), new HashMap<>(), customHeaders);

return fromJson(Avatar.class, responseRaw, OBJECT_TYPE);
return fromJson(Avatar.class, responseRaw, OBJECT_TYPE_GET);
}

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

/**
* The id of the billing contract.
Expand Down Expand Up @@ -87,18 +87,18 @@ public class BillingContractSubscription extends BunqModel {
@SerializedName("subscription_type")
private String subscriptionType;

public static BunqResponse<BillingContractSubscription> create(ApiContext apiContext, Map<String, Object> requestMap, Integer userId) {
public static BunqResponse<Integer> create(ApiContext apiContext, Map<String, Object> requestMap, Integer userId) {
return create(apiContext, requestMap, userId, new HashMap<>());
}

/**
*/
public static BunqResponse<BillingContractSubscription> create(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Map<String, String> customHeaders) {
public static BunqResponse<Integer> create(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Map<String, String> customHeaders) {
ApiClient apiClient = new ApiClient(apiContext);
byte[] requestBytes = gson.toJson(requestMap).getBytes();
BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, userId), requestBytes, customHeaders);

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

public static BunqResponse<List<BillingContractSubscription>> list(ApiContext apiContext, Integer userId) {
Expand All @@ -116,7 +116,7 @@ public static BunqResponse<List<BillingContractSubscription>> list(ApiContext ap
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_LISTING, userId), params, customHeaders);

return fromJsonList(BillingContractSubscription.class, responseRaw, OBJECT_TYPE);
return fromJsonList(BillingContractSubscription.class, responseRaw, OBJECT_TYPE_GET);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public class BunqMeFundraiserProfile extends BunqModel {
*/
public static final String FIELD_POINTER = "pointer";

/**
* Object type.
*/
private static final String OBJECT_TYPE = "BunqMeFundraiserProfileModel";

/**
* The color chosen for the bunq.me fundraiser profile in hexadecimal format.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
*/
public class BunqMeFundraiserResult extends BunqModel {

/**
* Object type.
*/
private static final String OBJECT_TYPE = "BunqMeFundraiserResult";

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

/**
* The id of the created bunq.me.
Expand Down Expand Up @@ -119,18 +119,18 @@ public static BunqResponse<Integer> create(ApiContext apiContext, Map<String, Ob
return processForId(responseRaw);
}

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

/**
*/
public static BunqResponse<BunqMeTab> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer bunqMeTabId, Map<String, String> customHeaders) {
public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer monetaryAccountId, Integer bunqMeTabId, 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, bunqMeTabId), requestBytes, customHeaders);

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

public static BunqResponse<List<BunqMeTab>> list(ApiContext apiContext, Integer userId, Integer monetaryAccountId) {
Expand All @@ -147,7 +147,7 @@ public static BunqResponse<List<BunqMeTab>> list(ApiContext apiContext, Integer
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_LISTING, userId, monetaryAccountId), params, customHeaders);

return fromJsonList(BunqMeTab.class, responseRaw, OBJECT_TYPE);
return fromJsonList(BunqMeTab.class, responseRaw, OBJECT_TYPE_GET);
}

public static BunqResponse<BunqMeTab> get(ApiContext apiContext, Integer userId, Integer monetaryAccountId, Integer bunqMeTabId) {
Expand All @@ -160,7 +160,7 @@ public static BunqResponse<BunqMeTab> get(ApiContext apiContext, Integer userId,
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, userId, monetaryAccountId, bunqMeTabId), new HashMap<>(), customHeaders);

return fromJson(BunqMeTab.class, responseRaw, OBJECT_TYPE);
return fromJson(BunqMeTab.class, responseRaw, OBJECT_TYPE_GET);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public class BunqMeTabEntry extends BunqModel {
public static final String FIELD_DESCRIPTION = "description";
public static final String FIELD_REDIRECT_URL = "redirect_url";

/**
* Object type.
*/
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 @@ -17,18 +17,20 @@
*/
public class BunqMeTabResultInquiry extends BunqModel {

/**
* Object type.
*/
private static final String OBJECT_TYPE = "BunqMeTabResultInquiry";

/**
* The payment made for the Tab.
*/
@Expose
@SerializedName("payment")
private Payment payment;

/**
* The Id of the bunq.me tab that this BunqMeTabResultInquiry belongs to.
*/
@Expose
@SerializedName("bunq_me_tab_id")
private Integer bunqMeTabId;

/**
* The payment made for the Tab.
*/
Expand All @@ -40,13 +42,28 @@ public void setPayment(Payment payment) {
this.payment = payment;
}

/**
* The Id of the bunq.me tab that this BunqMeTabResultInquiry belongs to.
*/
public Integer getBunqMeTabId() {
return this.bunqMeTabId;
}

public void setBunqMeTabId(Integer bunqMeTabId) {
this.bunqMeTabId = bunqMeTabId;
}

/**
*/
public boolean isAllFieldNull() {
if (this.payment != null) {
return false;
}

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

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
*/
public class BunqMeTabResultResponse extends BunqModel {

/**
* Object type.
*/
private static final String OBJECT_TYPE = "BunqMeTabResultResponse";

/**
* The payment made for the bunq.me tab.
*/
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/bunq/sdk/model/generated/endpoint/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class Card extends BunqModel {
/**
* Object type.
*/
private static final String OBJECT_TYPE = "CardDebit";
private static final String OBJECT_TYPE_GET = "CardDebit";

/**
* The id of the card.
Expand Down Expand Up @@ -203,7 +203,7 @@ public class Card extends BunqModel {
@SerializedName("country")
private String country;

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

Expand All @@ -212,13 +212,13 @@ public static BunqResponse<Card> update(ApiContext apiContext, Map<String, Objec
* the monetary account connected to the card. When the card has been received, it can be also
* activated through this endpoint.
*/
public static BunqResponse<Card> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer cardId, Map<String, String> customHeaders) {
public static BunqResponse<Integer> update(ApiContext apiContext, Map<String, Object> requestMap, Integer userId, Integer cardId, Map<String, String> customHeaders) {
ApiClient apiClient = new ApiClient(apiContext);
byte[] requestBytes = gson.toJson(requestMap).getBytes();
requestBytes = SecurityUtils.encrypt(apiContext, requestBytes, customHeaders);
BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, userId, cardId), requestBytes, customHeaders);

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

public static BunqResponse<Card> get(ApiContext apiContext, Integer userId, Integer cardId) {
Expand All @@ -232,7 +232,7 @@ public static BunqResponse<Card> get(ApiContext apiContext, Integer userId, Inte
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, userId, cardId), new HashMap<>(), customHeaders);

return fromJson(Card.class, responseRaw, OBJECT_TYPE);
return fromJson(Card.class, responseRaw, OBJECT_TYPE_GET);
}

public static BunqResponse<List<Card>> list(ApiContext apiContext, Integer userId) {
Expand All @@ -250,7 +250,7 @@ public static BunqResponse<List<Card>> list(ApiContext apiContext, Integer userI
ApiClient apiClient = new ApiClient(apiContext);
BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_LISTING, userId), params, customHeaders);

return fromJsonList(Card.class, responseRaw, OBJECT_TYPE);
return fromJsonList(Card.class, responseRaw, OBJECT_TYPE_GET);
}

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

/**
* The id of the card.
Expand Down Expand Up @@ -204,7 +204,7 @@ public static BunqResponse<CardDebit> create(ApiContext apiContext, Map<String,
requestBytes = SecurityUtils.encrypt(apiContext, requestBytes, customHeaders);
BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, userId), requestBytes, customHeaders);

return fromJson(CardDebit.class, responseRaw, OBJECT_TYPE);
return fromJson(CardDebit.class, responseRaw, OBJECT_TYPE_POST);
}

/**
Expand Down
Loading