Skip to content

Commit

Permalink
Add api_versions property to Instance entity.
Browse files Browse the repository at this point in the history
This property will be available starting with Mastodon v4.3.0 as information about the API version offered by a Mastodon server.

See andregasser#483.
  • Loading branch information
bocops committed Oct 1, 2024
1 parent d70843a commit 67aed37
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bigbone/src/main/kotlin/social/bigbone/api/entity/Instance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ data class Instance(
@SerialName("registrations")
val registrations: Registrations = Registrations(),

/**
* Information about which version of the API is implemented by this server.
*/
@SerialName("api_versions")
val apiVersions: ApiVersions = ApiVersions(),

/**
* Hints related to contacting a representative of the website.
*/
Expand Down Expand Up @@ -353,6 +359,19 @@ data class Instance(
val message: String? = null
)

/**
* Information about which version of the API is implemented by this server.
*/
@Serializable
data class ApiVersions(
/**
* API version number that this server implements. Starting from Mastodon v4.3.0,
* API changes will come with a version number, which clients can check against this value.
*/
@SerialName("mastodon")
val mastodon: Int = 0,
)

/**
* Hints related to contacting a representative of the website.
*/
Expand Down

0 comments on commit 67aed37

Please sign in to comment.