Skip to content

Commit

Permalink
returning objects now
Browse files Browse the repository at this point in the history
  • Loading branch information
iankang committed Oct 28, 2021
1 parent 6aa0c91 commit 729330d
Show file tree
Hide file tree
Showing 26 changed files with 362 additions and 79 deletions.
27 changes: 24 additions & 3 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/main/java/com/mixsteroids/mixjar/main.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.mixsteroids.mixjar

fun main(){
val mixCloudServiceImpl = MixCloud()
val item = mixCloudServiceImpl.getShow("spartacus","party-time",1)
println(item)
// val mixCloudServiceImpl = MixCloud()
// val item1 = mixCloudServiceImpl.getShow("spartacus","party-time",1)
// val item = mixCloudServiceImpl.getUser("DjChief254")
// println("actualItem: ${item?.username}")
// println("getShow: $item1")
// mixCloudServiceImpl.getUser("DjChief254")
// mixCloudServiceImpl.getUserCloudCast("DjChief254",2)
// mixCloudServiceImpl.getCity("nairobi");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ data class CityAndTagLatestResponse (

@SerializedName("data") val data : List<CityAndTagLatestResponseData>,
@SerializedName("paging") val paging : CityAndTagLatestResponsePaging
)
){
constructor(cityAndTagLatestResponse: CityAndTagLatestResponse):this(
cityAndTagLatestResponse.data,
cityAndTagLatestResponse.paging
)
}

data class CityAndTagLatestResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ data class CityAndTagPopularResponse (

@SerializedName("data") val data : List<CityAndTagPopularResponseData>,
@SerializedName("paging") val paging : CityAndTagPopularResponsePaging
)
){
constructor(cityAndTagPopularResponse: CityAndTagPopularResponse):this(
cityAndTagPopularResponse.data,
cityAndTagPopularResponse.paging
)
}
data class CityAndTagPopularResponseData (

@SerializedName("key") val key : String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ data class CityLatestResponse (

@SerializedName("data") val data : List<CityLatestResponseData>,
@SerializedName("paging") val paging : CityLatestResponsePaging
)
){
constructor(cityLatestResponse: CityLatestResponse):this(
cityLatestResponse.data,
cityLatestResponse.paging
)
}

data class CityLatestResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ data class CityPopularResponse (

@SerializedName("data") val data : List<CityPopularResponseData>,
@SerializedName("paging") val paging : CityPopularResponsePaging
)
){
constructor(cityPopularResponse: CityPopularResponse):this(
cityPopularResponse.data,
cityPopularResponse.paging
)
}

data class CityPopularResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ data class LatestTagResponse (

@SerializedName("data") val data : List<LatestTagResponseData>,
@SerializedName("paging") val paging : LatestTagResponsePaging
)
){
constructor(latestTagResponse: LatestTagResponse):this(
latestTagResponse.data,
latestTagResponse.paging
)
}

data class LatestTagResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ data class PopularTagResponse (

@SerializedName("data") val data : List<PopularTagResponseData>,
@SerializedName("paging") val paging : PopularTagResponsePaging
)
){
constructor(popularTagResponse: PopularTagResponse):this(
popularTagResponse.data,
popularTagResponse.paging
)
}

data class PopularTagResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class ShowCommentsResponse (
@SerializedName("data") val data : List<ShowCommentsResponseData>,
@SerializedName("paging") val paging : ShowCommentsResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(showCommentsResponse: ShowCommentsResponse):this(
showCommentsResponse.data,
showCommentsResponse.paging,
showCommentsResponse.name
)
}

data class ShowCommentsResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ data class ShowFavoritesResponse (

@SerializedName("data") val data : List<ShowFavoritesResponseData>,
@SerializedName("paging") val paging : ShowFavoritesResponsePaging
)
){
constructor(showFavoritesResponse: ShowFavoritesResponse):
this(showFavoritesResponse.data,showFavoritesResponse.paging)
}

data class ShowFavoritesResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ data class ShowListenersResponse (
@SerializedName("data") val data : List<ShowListenersResponseData>,
@SerializedName("paging") val paging : ShowListenersResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(showListenersResponse: ShowListenersResponse):
this(
showListenersResponse.data,
showListenersResponse.paging,
showListenersResponse.name
)
}

data class ShowListenersResponseData (

Expand Down
26 changes: 25 additions & 1 deletion src/main/java/com/mixsteroids/mixjar/models/ShowResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,31 @@ data class ShowResponse (
@SerializedName("picture_primary_color") val picture_primary_color : Int,
@SerializedName("type") val type : String,
@SerializedName("metadata") val metadata : ShowResponseMetadata
)
){
constructor(showResponse: ShowResponse):
this(
showResponse.key,
showResponse.url,
showResponse.name,
showResponse.tags,
showResponse.created_time,
showResponse.updated_time,
showResponse.play_count,
showResponse.favorite_count,
showResponse.comment_count,
showResponse.listener_count,
showResponse.repost_count,
showResponse.pictures,
showResponse.slug,
showResponse.user,
showResponse.audio_length,
showResponse.description,
showResponse.sections,
showResponse.picture_primary_color,
showResponse.type,
showResponse.metadata
)
}

data class ShowResponseConnections (
@SerializedName("favorites") val favorites : String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class ShowSimilarResponse (
@SerializedName("data") val data : List<ShowSimilarResponseData>,
@SerializedName("paging") val paging : ShowSimilarResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(showSimilarResponse: ShowSimilarResponse):this(
showSimilarResponse.data,
showSimilarResponse.paging,
showSimilarResponse.name,
)
}

data class ShowSimilarResponseData (

Expand Down
30 changes: 27 additions & 3 deletions src/main/java/com/mixsteroids/mixjar/models/TagResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,47 @@ data class TagResponse (
@SerializedName("name") val name : String,
@SerializedName("type") val type : String,
@SerializedName("metadata") val metadata : Metadata
)
){
constructor(tagResponse: TagResponse):this(
tagResponse.key,
tagResponse.url,
tagResponse.name,
tagResponse.type,
tagResponse.metadata
)
}
data class CityResponse (

@SerializedName("key") val key : String,
@SerializedName("url") val url : String,
@SerializedName("name") val name : String,
@SerializedName("type") val type : String,
@SerializedName("metadata") val metadata : Metadata
)
){
constructor(cityResponse: CityResponse):this(
cityResponse.key,
cityResponse.url,
cityResponse.name,
cityResponse.type,
cityResponse.metadata
)
}
data class TagAndCityResponse (

@SerializedName("key") val key : String,
@SerializedName("url") val url : String,
@SerializedName("name") val name : String,
@SerializedName("type") val type : String,
@SerializedName("metadata") val metadata : Metadata
)
){
constructor(tagAndCityResponse: TagAndCityResponse):this(
tagAndCityResponse.key,
tagAndCityResponse.url,
tagAndCityResponse.name,
tagAndCityResponse.type,
tagAndCityResponse.metadata
)
}


data class Metadata (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ data class UserCloudCastResponse (
@SerializedName("data") val data : List<UserCloudCastResponseData>,
@SerializedName("paging") val paging : UserCloudCastResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(userCloudCastResponse: UserCloudCastResponse):this(
userCloudCastResponse.data,
userCloudCastResponse.paging,
userCloudCastResponse.name
)
}

data class UserCloudCastResponseUser (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class UserCommentsResponse (
@SerializedName("data") val data : List<UserCommentsResponseData>,
@SerializedName("paging") val paging : UserCommentsResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(userCommentsResponse: UserCommentsResponse):this(
userCommentsResponse.data,
userCommentsResponse.paging,
userCommentsResponse.name
)
}

data class UserCommentsResponseUser (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class UserFavoritesResponse (
@SerializedName("data") val data : List<UserFavoritesResponseData>,
@SerializedName("paging") val paging : UserFavoritesResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(userFavoritesResponse: UserFavoritesResponse):this(
userFavoritesResponse.data,
userFavoritesResponse.paging,
userFavoritesResponse.name
)
}

data class UserFavoritesResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ data class UserFeedResponse (
@SerializedName("paging") var paging : UserFeedPaging,
@SerializedName("name") var name : String

)
){
constructor(userFeedResponse: UserFeedResponse):
this(userFeedResponse.data,
userFeedResponse.paging,
userFeedResponse.name)
}

data class UserFeedPictures (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class UserFollowersResponse (
@SerializedName("data") val data : List<UserFollowersData>,
@SerializedName("paging") val paging : UserFollowersPaging,
@SerializedName("name") val name : String
)
){
constructor(userFollowersResponse: UserFollowersResponse):this(
userFollowersResponse.data,
userFollowersResponse.paging,
userFollowersResponse.name
)
}

data class UserFollowersData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ data class UserFollowingResponse (

@SerializedName("data") val data : List<UserFollowingResponseData>,
@SerializedName("paging") val paging : UserFollowingResponsePaging
)
){
constructor(userFollowingResponse: UserFollowingResponse):this(
userFollowingResponse.data,
userFollowingResponse.paging
)
}

data class UserFollowingResponseData (

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ data class UserListensResponse (
@SerializedName("data") val data : List<UserListensResponseData>,
@SerializedName("paging") val paging : UserListensResponsePaging,
@SerializedName("name") val name : String
)
){
constructor(userListensResponse: UserListensResponse):this(
userListensResponse.data,
userListensResponse.paging,
userListensResponse.name
)
}

data class UserListensResponseData (

Expand Down
Loading

0 comments on commit 729330d

Please sign in to comment.