From 99f8c759b936a80ff341a5e71926cecb64a79d24 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Wed, 13 Mar 2024 19:24:13 +0300 Subject: [PATCH] fix(#96-add-support-quit-meeting-request): rename from quit to leave --- .../app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt | 2 +- .../sdk/engine/ktor/requests/meetings/MeetingsEngine.kt | 8 ++++---- .../{QuitMeetingRequest.kt => LeaveMeetingRequest.kt} | 2 +- .../meetacy/sdk/meetings/AuthorizedMeetingRepository.kt | 4 ++-- .../app/meetacy/sdk/meetings/AuthorizedMeetingsApi.kt | 4 ++-- .../kotlin/app/meetacy/sdk/meetings/MeetingRepository.kt | 4 ++-- .../kotlin/app/meetacy/sdk/meetings/MeetingsApi.kt | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) rename api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/{QuitMeetingRequest.kt => LeaveMeetingRequest.kt} (84%) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt index 1639d0b..30e93b3 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/KtorMeetacyEngine.kt @@ -139,7 +139,7 @@ public class KtorMeetacyEngine( is ListMeetingsMapRequest -> meetings.listMeetingsMap(request) as T is CreateMeetingRequest -> meetings.createMeeting(request) as T is ParticipateMeetingRequest -> meetings.participateMeeting(request) as T - is QuitMeetingRequest -> meetings.quitMeeting(request) as T + is LeaveMeetingRequest -> meetings.leaveMeeting(request) as T is GetMeetingRequest -> meetings.getMeeting(request) as T is EditMeetingRequest -> meetings.editMeeting(request) as T is ListMeetingParticipantsRequest -> meetings.listMeetingParticipants(request) as T diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index ee65c3e..57e0556 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -232,12 +232,12 @@ internal class MeetingsEngine( } @Serializable - private data class QuitMeetingBody(val meetingId: MeetingIdSerializable) + private data class LeaveMeetingBody(val meetingId: MeetingIdSerializable) - private fun QuitMeetingRequest.toBody() = QuitMeetingBody(meetingId.serializable()) + private fun LeaveMeetingRequest.toBody() = LeaveMeetingBody(meetingId.serializable()) - suspend fun quitMeeting(request: QuitMeetingRequest) { - val url = baseUrl / "quit" + suspend fun leaveMeeting(request: LeaveMeetingRequest) { + val url = baseUrl / "leave" val body = request.toBody() httpClient.post(url.string) { apiVersion(request.apiVersion) diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/QuitMeetingRequest.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/LeaveMeetingRequest.kt similarity index 84% rename from api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/QuitMeetingRequest.kt rename to api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/LeaveMeetingRequest.kt index a6b6437..2bf6588 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/QuitMeetingRequest.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/engine/requests/LeaveMeetingRequest.kt @@ -3,7 +3,7 @@ package app.meetacy.sdk.engine.requests import app.meetacy.sdk.types.auth.Token import app.meetacy.sdk.types.meeting.MeetingId -public data class QuitMeetingRequest( +public data class LeaveMeetingRequest( val token: Token, val meetingId: MeetingId ) : SimpleMeetacyRequest diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingRepository.kt index 2abe309..1240844 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingRepository.kt @@ -75,7 +75,7 @@ public class AuthorizedMeetingRepository( api.meetings.participate(data.id) } - public suspend fun quit() { - api.meetings.quit(data.id) + public suspend fun leave() { + api.meetings.leave(data.id) } } diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingsApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingsApi.kt index 885a03a..297360d 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingsApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/AuthorizedMeetingsApi.kt @@ -93,8 +93,8 @@ public class AuthorizedMeetingsApi( base.participate(api.token, meetingId) } - public suspend fun quit(meetingId: MeetingId) { - base.quit(api.token, meetingId) + public suspend fun leave(meetingId: MeetingId) { + base.leave(api.token, meetingId) } public suspend fun get(meetingId: MeetingId): AuthorizedMeetingRepository { diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingRepository.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingRepository.kt index 5c4d19f..2da4e1c 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingRepository.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingRepository.kt @@ -77,8 +77,8 @@ public class MeetingRepository( api.meetings.participate(token, id) } - public suspend fun quit(token: Token) { - api.meetings.quit(token, id) + public suspend fun leave(token: Token) { + api.meetings.leave(token, id) } public suspend fun updated( diff --git a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingsApi.kt b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingsApi.kt index 0a6f6e8..d4844fa 100644 --- a/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingsApi.kt +++ b/api/src/commonMain/kotlin/app/meetacy/sdk/meetings/MeetingsApi.kt @@ -100,8 +100,8 @@ public class MeetingsApi(private val api: MeetacyApi) { api.engine.execute(ParticipateMeetingRequest(token, meetingId)) } - public suspend fun quit(token: Token, meetingId: MeetingId) { - api.engine.execute(QuitMeetingRequest(token, meetingId)) + public suspend fun leave(token: Token, meetingId: MeetingId) { + api.engine.execute(LeaveMeetingRequest(token, meetingId)) } public suspend fun get(token: Token, meetingId: MeetingId): MeetingRepository {