diff --git a/CHANGELOG.md b/CHANGELOG.md index ebf54039..5c8a154e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Change Log ========== +Version 2.0.3 *(2021-08-10)* +---------------------------- +- Improved support for user survey data by adding an `analyticsId` property to `SurveyQuestion`, `SurveyResponseChoice`, and `UserSegmentSurvey`. This property replaces any `id` properties the class originally had. +- Ensured that `SurveyResponseChoice` has a guid-based `resourceId` field that is tied to its `Entity.identifier`. +- Renamed the `SurveyQuestion.emojiTitle` property to `titleEmoji`. +- Added a `resourceKey` property to `SurveyResponseChoice`. + Version 2.0.2 *(2021-08-06)* ---------------------------- - Changed the `Play.source` property to the correct type, from `List` to `VideoSourceFile`. diff --git a/api-core/src/main/java/com/vimeo/networking2/ApiConstants.kt b/api-core/src/main/java/com/vimeo/networking2/ApiConstants.kt index 869da8ad..0b1fb7b0 100644 --- a/api-core/src/main/java/com/vimeo/networking2/ApiConstants.kt +++ b/api-core/src/main/java/com/vimeo/networking2/ApiConstants.kt @@ -34,7 +34,7 @@ object ApiConstants { const val SSL_PUBLIC_KEY = "sha256/5kJvNEMw0KjrCAu7eXY5HZdvyCS13BbA0VJG1RSP91w=" - const val SDK_VERSION = "2.0.2" + const val SDK_VERSION = "2.0.3" const val NONE = -1 diff --git a/models/src/main/java/com/vimeo/networking2/SurveyQuestion.kt b/models/src/main/java/com/vimeo/networking2/SurveyQuestion.kt index 2d0b0089..1e884f5e 100644 --- a/models/src/main/java/com/vimeo/networking2/SurveyQuestion.kt +++ b/models/src/main/java/com/vimeo/networking2/SurveyQuestion.kt @@ -10,8 +10,9 @@ import com.vimeo.networking2.enums.asEnum * A representation of a user-facing survey question. Questions are expected to be presented to a user with * a series of multiple-choice responses to select as an answer. * + * @param analyticsId The id that should be used when logging this [SurveyQuestion]. * @param resourceKey A globally unique identifier. - * @param emojiTitle A unicode emoji character in “surrogate pair” representation (e.g. \uD83D\uDC4B). + * @param titleEmoji A unicode emoji character in “surrogate pair” representation (e.g. \uD83D\uDC4B). * @param question The survey question that the user should be asked. This string will be localized. * @param rawType The type of the survey question. See [SurveyQuestion.type]. * @param responseChoices A list of [SurveyResponseChoices][SurveyResponseChoice] to present to a user as valid @@ -21,11 +22,14 @@ import com.vimeo.networking2.enums.asEnum @JsonClass(generateAdapter = true) data class SurveyQuestion( + @Json(name = "analytics_id") + val analyticsId: String? = null, + @Json(name = "resource_key") val resourceKey: String? = null, - @Json(name = "emoji_title") - val emojiTitle: String? = null, + @Json(name = "title_emoji") + val titleEmoji: String? = null, @Json(name = "title") val question: String? = null, diff --git a/models/src/main/java/com/vimeo/networking2/SurveyResponseChoice.kt b/models/src/main/java/com/vimeo/networking2/SurveyResponseChoice.kt index 37cbfc1f..73030cfe 100644 --- a/models/src/main/java/com/vimeo/networking2/SurveyResponseChoice.kt +++ b/models/src/main/java/com/vimeo/networking2/SurveyResponseChoice.kt @@ -7,18 +7,22 @@ import com.vimeo.networking2.common.Entity /** * A survey response choice associated with a [SurveyQuestion]. * - * @param id A unique identifier for the response choice within the context of a [SurveyQuestion]. + * @param analyticsId The id that should be used when logging this [SurveyResponseChoice]. + * @param resourceKey A unique identifier for the response choice within the context of a [SurveyQuestion]. * @param title A user-facing display title that represents the choice. This will be localized by the API. */ @JsonClass(generateAdapter = true) data class SurveyResponseChoice( - @Json(name = "id") - val id: String? = null, + @Json(name = "analytics_id") + val analyticsId: String? = null, + + @Json(name = "resource_key") + val resourceKey: String? = null, @Json(name = "title") val title: String? = null ) : Entity { - override val identifier: String? = id + override val identifier: String? = resourceKey } diff --git a/models/src/main/java/com/vimeo/networking2/UserSegmentSurvey.kt b/models/src/main/java/com/vimeo/networking2/UserSegmentSurvey.kt index f940807f..2e1f4b43 100644 --- a/models/src/main/java/com/vimeo/networking2/UserSegmentSurvey.kt +++ b/models/src/main/java/com/vimeo/networking2/UserSegmentSurvey.kt @@ -10,7 +10,7 @@ import com.vimeo.networking2.common.Entity * @param resourceKey A globally unique identifier. * @param uri A uri for the survey. * @param title A named title. - * @param id A named identifier. + * @param analyticsId The id that should be used when logging this [UserSegmentSurvey]. * @param questions A list of [SurveyQuestions][SurveyQuestion] to display to the end user. */ @JsonClass(generateAdapter = true) @@ -25,8 +25,8 @@ data class UserSegmentSurvey( @Json(name = "title") val title: String? = null, - @Json(name = "id") - val id: String? = null, + @Json(name = "analytics_id") + val analyticsId: String? = null, @Json(name = "questions") val questions: List? = null