JetBrains/teamcity-rest-client

PinInfo lacking crucial information

theAkito opened this issue · 0 comments

private class PinInfoImpl(bean: PinInfoBean, instance: TeamCityInstanceImpl) : PinInfo {
override val user = UserImpl(bean.user!!, false, instance)
override val dateTime: ZonedDateTime = ZonedDateTime.parse(bean.timestamp!!, teamCityServiceDateFormat)
override val time: Date = Date.from(dateTime.toInstant())
}

The most important information I need to get from a build is the PinInfo's comment text.

I've run a couple of manual curl requests in the shell to get a feeling for the API. For example, I am getting such a response, when I am requesting the pinInfo of a specific build:

[
  {
    "comment": {
      "text": "Current",
      "timestamp": "20210219T095524+0000",
      "user": {
        "href": "/app/rest/users/id:1",
        "id": 1,
        "name": "Akito",
        "username": "Akito"
      }
    },
    "status": true
  }
]
(Don't worry about the array wrapping.)

I need to use the value of comment.text, which is possible when working through raw curl requests.

However, as is seen above in the this REST client's code snippet, the PinInfo implementation is extremely meagre. It lacks most of the information.

Now, I am wondering, if that is related to breaking changes in the API. The server's current version is 2020.2.2 (build 85899). Did older versions not have all the information, as is seen in the JSON snippet, or is the implementation lacking in this REST client?

Is there a way to get that info nicely through this REST client or do I have to manually parse the JSON in my Kotlin app, to get the information needed?