Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CXAN-368 Add name parameter to createNote API #623

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions request/src/main/java/com/vimeo/networking2/VimeoApiClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ interface VimeoApiClient {
* @param password The optional password will be needed to note on the [Video] if it is password protected.
* @param coordinates The coordinates on the video surface where this note relates to.
* @param timeCode The time code of the video this note relates to.
* @param name The optional guest name of the user who create note.
* @param callback The callback which will be notified of the request completion.
*
* @return A [VimeoRequest] object to cancel API requests.
Expand All @@ -903,6 +904,7 @@ interface VimeoApiClient {
password: String?,
coordinates: Coordinates,
timeCode: Double,
name: String?,
callback: VimeoCallback<Note>,
): VimeoRequest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,9 @@ internal class MutableVimeoApiClientDelegate(var actual: VimeoApiClient? = null)
password: String?,
coordinates: Coordinates,
timeCode: Double,
name: String?,
callback: VimeoCallback<Note>
): VimeoRequest = client.createNote(uri, text, password, coordinates, timeCode, callback)
): VimeoRequest = client.createNote(uri, text, password, coordinates, timeCode, name, callback)

override fun editNote(
uri: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,14 +1307,18 @@ internal class VimeoApiClientImpl(
password: String?,
coordinates: Coordinates,
timeCode: Double,
name: String?,
callback: VimeoCallback<Note>
): VimeoRequest {
val safeUri = uri.validate() ?: return localVimeoCallAdapter.enqueueInvalidUri(callback)
val body = mapOf(
val body = mutableMapOf(
ApiConstants.Parameters.PARAMETER_COMMENT_TEXT_BODY to text,
ApiConstants.Parameters.PARAMETER_COORDINATES to coordinates,
ApiConstants.Parameters.PARAMETER_TIME_CODE to timeCode,
)

name?.let { body[ApiConstants.Parameters.PARAMETER_USERS_NAME] = it }

return vimeoService.createNote(authHeader, safeUri, password, body).enqueue(callback)
}

Expand Down
Loading