Skip to content

Commit bc89a04

Browse files
authored
Add api_versions property to Instance entity. (#484)
This property will be available starting with Mastodon v4.3.0 as information about the API version offered by a Mastodon server. See #483.
1 parent 795fdf0 commit bc89a04

File tree

1 file changed

+19
-0
lines changed
  • bigbone/src/main/kotlin/social/bigbone/api/entity

1 file changed

+19
-0
lines changed

bigbone/src/main/kotlin/social/bigbone/api/entity/Instance.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ data class Instance(
6969
@SerialName("registrations")
7070
val registrations: Registrations = Registrations(),
7171

72+
/**
73+
* Information about which version of the API is implemented by this server.
74+
*/
75+
@SerialName("api_versions")
76+
val apiVersions: ApiVersions = ApiVersions(),
77+
7278
/**
7379
* Hints related to contacting a representative of the website.
7480
*/
@@ -353,6 +359,19 @@ data class Instance(
353359
val message: String? = null
354360
)
355361

362+
/**
363+
* Information about which version of the API is implemented by this server.
364+
*/
365+
@Serializable
366+
data class ApiVersions(
367+
/**
368+
* API version number that this server implements. Starting from Mastodon v4.3.0,
369+
* API changes will come with a version number, which clients can check against this value.
370+
*/
371+
@SerialName("mastodon")
372+
val mastodon: Int = 0,
373+
)
374+
356375
/**
357376
* Hints related to contacting a representative of the website.
358377
*/

0 commit comments

Comments
 (0)