Repository: seratch/notion-sdk-jvm (kotlin)

Issue:
Support unique id fields
`PageProperty` doesn't support a new [unique_id field](https://www.notion.so/help/unique-id) property type.
API doc: https://developers.notion.com/reference/page-property-values#unique-id

Pull request description:
Added unique_id database and page property type. Closes #141

Patch:
diff --git a/core/src/main/kotlin/notion/api/v1/model/common/PropertyType.kt b/core/src/main/kotlin/notion/api/v1/model/common/PropertyType.kt
index 3460be6..d57cb46 100644
--- a/core/src/main/kotlin/notion/api/v1/model/common/PropertyType.kt
+++ b/core/src/main/kotlin/notion/api/v1/model/common/PropertyType.kt
@@ -22,6 +22,7 @@ enum class PropertyType @JvmOverloads constructor(val value: String) {
   @SerializedName("created_by") CreatedBy("created_by"),
   @SerializedName("last_edited_time") LastEditedTime("last_edited_time"),
   @SerializedName("last_edited_by") LastEditedBy("last_edited_by"),
+  @SerializedName("unique_id") UniqueId("unique_id"),
   @SerializedName("property_item") PropertyItem("property_item");
 
   override fun toString(): String = value
diff --git a/core/src/main/kotlin/notion/api/v1/model/databases/DatabaseProperty.kt b/core/src/main/kotlin/notion/api/v1/model/databases/DatabaseProperty.kt
index 72f4baa..c4dc86b 100644
--- a/core/src/main/kotlin/notion/api/v1/model/databases/DatabaseProperty.kt
+++ b/core/src/main/kotlin/notion/api/v1/model/databases/DatabaseProperty.kt
@@ -31,8 +31,11 @@ constructor(
     val lastEditedBy: LastEditedBy? = null,
     val createdTime: CreatedTime? = null,
     val lastEditedTime: LastEditedTime? = null,
+    val uniqueId: UniqueId? = null,
 ) {
 
+  open class UniqueId @JvmOverloads constructor(var prefix: String?)
+
   open class RichText
   @JvmOverloads
   constructor(
diff --git a/core/src/main/kotlin/notion/api/v1/model/pages/PageProperty.kt b/core/src/main/kotlin/notion/api/v1/model/pages/PageProperty.kt
index d3f1ab5..254dd63 100644
--- a/core/src/main/kotlin/notion/api/v1/model/pages/PageProperty.kt
+++ b/core/src/main/kotlin/notion/api/v1/model/pages/PageProperty.kt
@@ -31,9 +31,13 @@ constructor(
     val lastEditedBy: User? = null,
     val createdTime: String? = null,
     val lastEditedTime: String? = null,
+    val uniqueId: UniqueId? = null,
     val hasMore: Boolean? = null, // for relation type ones
 ) {
 
+  open class UniqueId
+  @JvmOverloads
+  constructor(var number: Number? = null, var prefix: String? = null)
   data class RichText
   @JvmOverloads
   constructor(


Test patch:
diff --git a/core/src/test/kotlin/tests/model/DatabasesTest.kt b/core/src/test/kotlin/tests/model/DatabasesTest.kt
index c016c18..4fd1c64 100644
--- a/core/src/test/kotlin/tests/model/DatabasesTest.kt
+++ b/core/src/test/kotlin/tests/model/DatabasesTest.kt
@@ -185,6 +185,11 @@ class DatabasesTest {
           "id": "title",
           "type": "title",
           "title": {}
+        },
+        "ID": {
+          "id": "UQGz",
+          "type": "unique_id",
+          "unique_id": {"prefix": "TD"}
         }
       }
     }
diff --git a/core/src/test/kotlin/tests/model/PagesTest.kt b/core/src/test/kotlin/tests/model/PagesTest.kt
index 47a6d93..cbcdaf0 100644
--- a/core/src/test/kotlin/tests/model/PagesTest.kt
+++ b/core/src/test/kotlin/tests/model/PagesTest.kt
@@ -125,6 +125,11 @@ class PagesTest {
         ],
         "function": "show_original"
       }
+    },
+    "ID": {
+      "id": "UQGz",
+      "type": "unique_id",
+      "unique_id": {"prefix": "TD", "number": 18}
     }
   }
 }