Updated on 2026-08-14
This commit is contained in:
parent
0f8519007b
commit
428f1076f0
11 changed files with 248 additions and 185 deletions
|
|
@ -52,16 +52,16 @@ interface TangemTechApi {
|
|||
@Body userTokens: UserTokensResponse,
|
||||
): ApiResponse<Unit>
|
||||
|
||||
@GET("/v1/wallets/{wallet_id}/notification-preferences")
|
||||
@GET("/api/v1/notification-preferences/{wallet_id}")
|
||||
suspend fun getPushNotificationPreferences(
|
||||
@Path("wallet_id") walletId: String,
|
||||
): ApiResponse<PushNotificationPreferencesResponse>
|
||||
|
||||
@PUT("/v1/wallets/{wallet_id}/notification-preferences")
|
||||
@PUT("/api/v1/notification-preferences/{wallet_id}")
|
||||
suspend fun updatePushNotificationPreferences(
|
||||
@Path("wallet_id") walletId: String,
|
||||
@Body body: PushNotificationPreferencesBody,
|
||||
): ApiResponse<Unit>
|
||||
): ApiResponse<PushNotificationPreferencesResponse>
|
||||
|
||||
// region Referral
|
||||
/** Returns referral status by [walletId] */
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferenceState(
|
||||
@Json(name = "isEnabled") val isEnabled: Boolean,
|
||||
@Json(name = "isVisible") val isVisible: Boolean,
|
||||
)
|
||||
|
|
@ -5,10 +5,10 @@ import com.squareup.moshi.JsonClass
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferencesBody(
|
||||
@Json(name = "transactionAlerts")
|
||||
val areTransactionAlertsEnabled: Boolean,
|
||||
@Json(name = "offersUpdates")
|
||||
val areOffersUpdatesEnabled: Boolean,
|
||||
@Json(name = "priceAlerts")
|
||||
@Json(name = "transactionEventsEnabled")
|
||||
val areTransactionEventsEnabled: Boolean,
|
||||
@Json(name = "offerUpdatesEnabled")
|
||||
val areOfferUpdatesEnabled: Boolean,
|
||||
@Json(name = "priceAlertsEnabled")
|
||||
val arePriceAlertsEnabled: Boolean,
|
||||
)
|
||||
|
|
@ -5,7 +5,7 @@ import com.squareup.moshi.JsonClass
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferencesResponse(
|
||||
@Json(name = "transactionAlerts") val transactionAlerts: PushNotificationPreferenceState,
|
||||
@Json(name = "offersUpdates") val offersUpdates: PushNotificationPreferenceState,
|
||||
@Json(name = "priceAlerts") val priceAlerts: PushNotificationPreferenceState,
|
||||
@Json(name = "transactionEventsEnabled") val areTransactionEventsEnabled: Boolean,
|
||||
@Json(name = "offerUpdatesEnabled") val areOfferUpdatesEnabled: Boolean,
|
||||
@Json(name = "priceAlertsEnabled") val arePriceAlertsEnabled: Boolean,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue