mirror of
https://github.com/bitwarden/android.git
synced 2026-04-28 11:58:40 -05:00
[PM-19849] Move PushApi and PushTokenRequest to network module (#4979)
This commit is contained in:
18
network/src/main/kotlin/com/bitwarden/network/api/PushApi.kt
Normal file
18
network/src/main/kotlin/com/bitwarden/network/api/PushApi.kt
Normal 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>
|
||||
}
|
||||
@@ -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,
|
||||
)
|
||||
Reference in New Issue
Block a user