Fix regression on PushRulesApi

This commit is contained in:
Benoit Marty 2019-09-20 12:15:07 +02:00 committed by Benoit Marty
parent 03f8120b7d
commit 1197d4021d
2 changed files with 5 additions and 6 deletions

View file

@ -15,7 +15,6 @@
*/
package im.vector.matrix.android.internal.session.pushers
import im.vector.matrix.android.api.pushrules.RuleKind
import im.vector.matrix.android.api.pushrules.rest.GetPushRulesResponse
import im.vector.matrix.android.api.pushrules.rest.PushRule
import im.vector.matrix.android.internal.network.NetworkConstants
@ -38,7 +37,7 @@ internal interface PushRulesApi {
* @param enable the new enable status
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}/enabled")
fun updateEnableRuleStatus(@Path("kind") kind: RuleKind,
fun updateEnableRuleStatus(@Path("kind") kind: String,
@Path("ruleId") ruleId: String,
@Body enable: Boolean?)
: Call<Unit>
@ -52,7 +51,7 @@ internal interface PushRulesApi {
* @param actions the actions
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}/actions")
fun updateRuleActions(@Path("kind") kind: RuleKind,
fun updateRuleActions(@Path("kind") kind: String,
@Path("ruleId") ruleId: String,
@Body actions: Any)
: Call<Unit>
@ -65,7 +64,7 @@ internal interface PushRulesApi {
* @param ruleId the ruleId
*/
@DELETE(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}")
fun deleteRule(@Path("kind") kind: RuleKind,
fun deleteRule(@Path("kind") kind: String,
@Path("ruleId") ruleId: String)
: Call<Unit>
@ -77,7 +76,7 @@ internal interface PushRulesApi {
* @param rule the rule to add.
*/
@PUT(NetworkConstants.URI_API_PREFIX_PATH_R0 + "pushrules/global/{kind}/{ruleId}")
fun addRule(@Path("kind") kind: RuleKind,
fun addRule(@Path("kind") kind: String,
@Path("ruleId") ruleId: String,
@Body rule: PushRule)
: Call<Unit>

View file

@ -33,7 +33,7 @@ internal class DefaultUpdatePushRuleEnableStatusTask @Inject constructor(private
override suspend fun execute(params: UpdatePushRuleEnableStatusTask.Params) {
return executeRequest {
apiCall = pushRulesApi.updateEnableRuleStatus(params.kind, params.pushRule.ruleId, params.enabled)
apiCall = pushRulesApi.updateEnableRuleStatus(params.kind.value, params.pushRule.ruleId, params.enabled)
}
}
}