diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentContent.java new file mode 100644 index 00000000..0b5decc5 --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentContent.java @@ -0,0 +1,67 @@ +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.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.lang.model.type.NullType; + +/** + * Fetch the raw content of an attachment. + */ +public class AttachmentContent extends BunqModel { + + /** + * Endpoint constants. + */ + protected static final String ENDPOINT_URL_READ = "attachment-content/%s"; + + /** + * Object type. + */ + protected static final String OBJECT_TYPE_GET = "AttachmentContent"; + + /** + */ + public static BunqResponse get(String attachmentContentUuid, Map params, Map customHeaders) { + ApiClient apiClient = new ApiClient(getApiContext()); + BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, attachmentContentUuid), params, customHeaders); + + return fromJson(AttachmentContent.class, responseRaw, OBJECT_TYPE_GET); + } + + public static BunqResponse get() { + return get(null, null, null); + } + + public static BunqResponse get(String attachmentContentUuid) { + return get(attachmentContentUuid, null, null); + } + + public static BunqResponse get(String attachmentContentUuid, Map params) { + return get(attachmentContentUuid, params, null); + } + + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static AttachmentContent fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentContent.class, reader); + } + +} diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java b/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java index 05237d33..59a3080d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java @@ -29,6 +29,13 @@ public class Attachment extends BunqModel { @SerializedName("content_type") private String contentType; + /** + * The URLs where the file can be downloaded. + */ + @Expose + @SerializedName("urls") + private List urls; + /** * The description of the attachment. */ @@ -51,6 +58,17 @@ public void setContentType(String contentType) { this.contentType = contentType; } + /** + * The URLs where the file can be downloaded. + */ + public List getUrls() { + return this.urls; + } + + public void setUrls(List urls) { + this.urls = urls; + } + /** */ public boolean isAllFieldNull() { @@ -62,6 +80,10 @@ public boolean isAllFieldNull() { return false; } + if (this.urls != null) { + return false; + } + return true; } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentUrl.java b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentUrl.java new file mode 100644 index 00000000..6f058445 --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentUrl.java @@ -0,0 +1,74 @@ +package com.bunq.sdk.model.generated.object; + +import com.bunq.sdk.model.core.BunqModel; +import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + */ +public class AttachmentUrl extends BunqModel { + + /** + * The file type of attachment. + */ + @Expose + @SerializedName("type") + private String type; + + /** + * The URL where the attachment can be downloaded. + */ + @Expose + @SerializedName("url") + private String url; + + /** + * The file type of attachment. + */ + public String getType() { + return this.type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * The URL where the attachment can be downloaded. + */ + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + */ + public boolean isAllFieldNull() { + if (this.type != null) { + return false; + } + + if (this.url != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentUrl fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentUrl.class, reader); + } + +}