Skip to content

Commit

Permalink
Merge branch 'release/1.18.13.60'
Browse files Browse the repository at this point in the history
  • Loading branch information
bunq-bot committed Dec 3, 2021
2 parents 23a1a67 + a2469e6 commit b5658d7
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<AttachmentContent> get(String attachmentContentUuid, Map<String, String> params, Map<String, String> 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<AttachmentContent> get() {
return get(null, null, null);
}

public static BunqResponse<AttachmentContent> get(String attachmentContentUuid) {
return get(attachmentContentUuid, null, null);
}

public static BunqResponse<AttachmentContent> get(String attachmentContentUuid, Map<String, String> params) {
return get(attachmentContentUuid, params, null);
}

/**
*/
public boolean isAllFieldNull() {
return true;
}

/**
*/
public static AttachmentContent fromJsonReader(JsonReader reader) {
return fromJsonReader(AttachmentContent.class, reader);
}

}
22 changes: 22 additions & 0 deletions src/main/java/com/bunq/sdk/model/generated/object/Attachment.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<AttachmentUrl> urls;

/**
* The description of the attachment.
*/
Expand All @@ -51,6 +58,17 @@ public void setContentType(String contentType) {
this.contentType = contentType;
}

/**
* The URLs where the file can be downloaded.
*/
public List<AttachmentUrl> getUrls() {
return this.urls;
}

public void setUrls(List<AttachmentUrl> urls) {
this.urls = urls;
}

/**
*/
public boolean isAllFieldNull() {
Expand All @@ -62,6 +80,10 @@ public boolean isAllFieldNull() {
return false;
}

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

return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit b5658d7

Please sign in to comment.