-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #483 from vimeo/subfolders
Support for subfolders
- Loading branch information
Showing
12 changed files
with
158 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
models/src/main/java/com/vimeo/networking2/AddSubfolderInteraction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import com.vimeo.networking2.common.Interaction | ||
|
||
/** | ||
* The interaction for adding a subfolder to a parent folder. | ||
* | ||
* @param canAddSubfolders Whether the folder can contain a subfolder. | ||
* @param contentType The content type. | ||
* @param subfolderDepthLimitReached Whether the user has reached the maximum subfolder depth. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class AddSubfolderInteraction( | ||
|
||
@Json(name = "can_add_subfolders") | ||
val canAddSubfolders: Boolean? = null, | ||
|
||
@Json(name = "content_type") | ||
val contentType: String? = null, | ||
|
||
@Json(name = "subfolder_depth_limit_reached") | ||
val subfolderDepthLimitReached: Boolean? = null, | ||
|
||
@Json(name = "options") | ||
override val options: List<String>? = null, | ||
|
||
@Json(name = "uri") | ||
override val uri: String? = null | ||
) : Interaction |
18 changes: 18 additions & 0 deletions
18
models/src/main/java/com/vimeo/networking2/DefaultConnection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import com.vimeo.networking2.common.Connection | ||
|
||
/** | ||
* The default implementation of a connection that does not add any other properties. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class DefaultConnection( | ||
|
||
@Json(name = "options") | ||
override val options: List<String>? = null, | ||
|
||
@Json(name = "uri") | ||
override val uri: String? = null | ||
) : Connection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
models/src/main/java/com/vimeo/networking2/FolderAncestorConnection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* The connection to a parent folder in the ancestor hierarchy of a folder. | ||
* | ||
* @param uri The URI of the parent folder. | ||
* @param name The name of the parent folder. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class FolderAncestorConnection( | ||
|
||
@Json(name = "uri") | ||
val uri: String? = null, | ||
|
||
@Json(name = "name") | ||
val name: String? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
models/src/main/java/com/vimeo/networking2/FolderInteractions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.vimeo.networking2 | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
/** | ||
* The interactions for a folder. | ||
* | ||
* @param addSubfolder The interaction used to add a subfolder as well as determine capability for adding subfolders. | ||
*/ | ||
@JsonClass(generateAdapter = true) | ||
data class FolderInteractions( | ||
|
||
@Json(name = "add_subfolder") | ||
val addSubfolder: AddSubfolderInteraction? = null | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.