Skip to content

Commit

Permalink
Add api_versions property to Instance entity. (#484)
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 #483.
  • Loading branch information
bocops authored Oct 2, 2024
1 parent 795fdf0 commit bc89a04
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 bc89a04

Please sign in to comment.