Skip to content

Commit

Permalink
added config data api for parsing the mobile features
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-alfresco committed Sep 17, 2024
1 parent 8d635c2 commit 1c1541a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
Binary file added content/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion content/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
}
namespace 'com.alfresco.content'
defaultConfig {
versionName "0.3.4"
versionName "0.3.5"
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.alfresco.content.apis

import com.alfresco.content.models.MobileConfigData
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Url

@JvmSuppressWildcards
interface MobileConfigApi {

@Headers(
"Content-Type: application/json",
)
@GET
suspend fun getMobileConfig(@Url url: String): MobileConfigData
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.alfresco.content.models

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

/**
* @param featuresMobile
*/

@JsonClass(generateAdapter = true)
data class MobileConfigData(
@Json(name = "features_mobile") @field:Json(name = "features_mobile") var featuresMobile: Features? = null,
)

/**
* @param dynamicMenus
*/
@JsonClass(generateAdapter = true)
data class Features(
@Json(name = "menu") @field:Json(name = "menu") var dynamicMenus: List<DynamicMenu>? = null,
)

/**
* @param id
* @param name
* @param enabled
*/
@JsonClass(generateAdapter = true)
data class DynamicMenu(
@Json(name = "id") @field:Json(name = "id") var id: String? = null,
@Json(name = "name") @field:Json(name = "name") var name: String? = null,
@Json(name = "enabled") @field:Json(name = "enabled") var enabled: Boolean? = null,
)

0 comments on commit 1c1541a

Please sign in to comment.