From e6b9c0a3e69ff361dca6bdcc76b77f0f09840d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Dumas?= Date: Thu, 9 May 2024 09:27:26 +0200 Subject: [PATCH] Add link property to Section.Representation. (#38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add link property to `Section.Representation` ## Changes Made Create object `Link`. Add it to `Section.Representation.Properties` **Section example** ``` { "id": "6fc354ec-eefa-4450-ae63-461770db0391", "isPublished": false, "vendor": "RTS", "sectionType": "MediaSection", "hasPersonalizedContent": false, "representation": { "name": "Swimlane", "properties": { "title": "Highlight Valère Basilica", "description": "Une belle petite description du film", "hasDetailPage": false, "link": { "targetType": "MICRO_PAGE", "target": "48fe9180-5b2b-4d76-8ea6-c3033a92fd09" } } }, "isGlobal": false } ``` --- buildSrc/src/main/kotlin/Config.kt | 2 +- .../dataProvider/integrationlayer/data/remote/Link.kt | 9 +++++++++ .../integrationlayer/data/remote/Representation.kt | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Link.kt diff --git a/buildSrc/src/main/kotlin/Config.kt b/buildSrc/src/main/kotlin/Config.kt index 7345ec5..bc58a5c 100644 --- a/buildSrc/src/main/kotlin/Config.kt +++ b/buildSrc/src/main/kotlin/Config.kt @@ -5,7 +5,7 @@ object Config { const val major = 0 const val minor = 9 - const val patch = 0 + const val patch = 1 const val versionName = "$major.$minor.$patch" const val maven_group = "ch.srg.data.provider" diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Link.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Link.kt new file mode 100644 index 0000000..98dd67a --- /dev/null +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Link.kt @@ -0,0 +1,9 @@ +package ch.srg.dataProvider.integrationlayer.data.remote + +import kotlinx.serialization.Serializable + +@Serializable +data class Link( + val targetType: String, + val target: String? = null, +) diff --git a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt index 9b2f513..4514531 100644 --- a/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt +++ b/data/src/main/java/ch/srg/dataProvider/integrationlayer/data/remote/Representation.kt @@ -37,6 +37,9 @@ data class Representation( val imageFocalPoint: FocalPoint? get() = properties?.imageFocalPoint + val link: Link? + get() = properties?.link + @Serializable data class Properties( val title: String? = null, @@ -45,6 +48,7 @@ data class Representation( val hasDetailPage: Boolean? = null, val pickRandomElement: Boolean? = null, val imageUrl: ImageUrl? = null, - val imageFocalPoint: FocalPoint? = null + val imageFocalPoint: FocalPoint? = null, + val link: Link? = null, ) }