Skip to content

Commit

Permalink
Add link property to Section.Representation. (#38)
Browse files Browse the repository at this point in the history
## 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
}
```
  • Loading branch information
Loic-Dumas authored May 9, 2024
1 parent 55c6600 commit e6b9c0a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
)
}

0 comments on commit e6b9c0a

Please sign in to comment.