A String rather than an enum: other values can appear, and an enum would turn them into + * null instead of passing them through. + */ + String type; + + ItemResourceStatus status; +} diff --git a/src/main/java/ai/pluggy/client/response/ItemResourceStatus.java b/src/main/java/ai/pluggy/client/response/ItemResourceStatus.java new file mode 100644 index 0000000..79bd463 --- /dev/null +++ b/src/main/java/ai/pluggy/client/response/ItemResourceStatus.java @@ -0,0 +1,32 @@ +package ai.pluggy.client.response; + +import com.google.gson.annotations.SerializedName; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * What the financial institution reports about one resource of an item's Open Finance consent. + * + *
{@code PENDING_AUTHORISATION} keeps Open Finance's British spelling: the user still has to
+ * approve the resource at their bank. A value added server-side after this SDK release
+ * deserializes as {@code null}.
+ */
+@AllArgsConstructor
+public enum ItemResourceStatus {
+
+ @SerializedName("AVAILABLE")
+ AVAILABLE("AVAILABLE"),
+
+ @SerializedName("UNAVAILABLE")
+ UNAVAILABLE("UNAVAILABLE"),
+
+ @SerializedName("TEMPORARILY_UNAVAILABLE")
+ TEMPORARILY_UNAVAILABLE("TEMPORARILY_UNAVAILABLE"),
+
+ @SerializedName("PENDING_AUTHORISATION")
+ PENDING_AUTHORISATION("PENDING_AUTHORISATION");
+
+ @Getter
+ private String value;
+}
diff --git a/src/main/java/ai/pluggy/client/response/ItemResourcesResponse.java b/src/main/java/ai/pluggy/client/response/ItemResourcesResponse.java
new file mode 100644
index 0000000..2b9c539
--- /dev/null
+++ b/src/main/java/ai/pluggy/client/response/ItemResourcesResponse.java
@@ -0,0 +1,4 @@
+package ai.pluggy.client.response;
+
+public class ItemResourcesResponse extends PageResponse