[PM-19849] Move PushApi and PushTokenRequest to network module (#4979)

This commit is contained in:
Patrick Honkonen
2025-04-03 17:18:12 -04:00
committed by GitHub
parent 5017e935d7
commit 85109a2e4b
7 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
package com.bitwarden.network.api
import com.bitwarden.network.model.NetworkResult
import com.bitwarden.network.model.PushTokenRequest
import retrofit2.http.Body
import retrofit2.http.PUT
import retrofit2.http.Path
/**
* Defines API calls for push tokens.
*/
interface PushApi {
@PUT("/devices/identifier/{appId}/token")
suspend fun putDeviceToken(
@Path("appId") appId: String,
@Body body: PushTokenRequest,
): NetworkResult<Unit>
}

View File

@@ -0,0 +1,12 @@
package com.bitwarden.network.model
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Request body needed to PUT a GCM [pushToken] to Bitwarden's server.
*/
@Serializable
data class PushTokenRequest(
@SerialName("pushToken") val pushToken: String,
)