Skip to content

Commit

Permalink
fix: adapt comments and function names
Browse files Browse the repository at this point in the history
  • Loading branch information
berka3 committed Aug 14, 2024
1 parent 63a3de8 commit 3992f09
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.time.LocalDateTime
import java.util.*

/**
* Sets the default validity duration (in days) for all smartphones in a partition.
* Sets the default validity duration (in days) for all smartphones in a partition asynchronously.
*
* @param validityDuration The validity duration to set in days (Min: 1, Max: 1095).
* @param requestConfig The request configuration (optional).
Expand All @@ -30,7 +30,7 @@ suspend fun XesarConnect.setDefaultSmartphoneValidityDurationAsync(
}

/**
* Sets the phone number on a smartphone access media.
* Sets the phone number on a smartphone access media asynchronously.
*
* @param phoneNumber The phone number to set. Phone numbers starting with a '+' and max. 50
* characters are allowed.
Expand Down Expand Up @@ -61,7 +61,7 @@ suspend fun XesarConnect.setPhoneNumberOnSmartphoneAsync(
}

/**
* Adds a smartphone media to an installation.
* Adds a smartphone media to an installation asynchronously.
*
* The AddSmartphoneToInstallationMapi command is designed specifically for adding smartphone
* identification mediums, while the AddMediumToInstallationMapi command is dedicated to adding
Expand Down Expand Up @@ -124,7 +124,7 @@ suspend fun XesarConnect.addSmartphoneToInstallationAsync(
}

/**
* Manually requests a new registration code for a smartphone media.
* Manually requests a new registration code for a smartphone media asynchronously.
*
* @param id The id of the smartphone media.
* @param requestConfig The request configuration (optional).
Expand All @@ -142,7 +142,7 @@ suspend fun XesarConnect.requestNewRegistrationCodeAsync(
}

/**
* Sets the message language on a smartphone media.
* Sets the message language on a smartphone media asynchronously.
*
* @param id The id of the smartphone media.
* @param messageLanguage The message language to set.
Expand All @@ -163,12 +163,12 @@ suspend fun XesarConnect.setMessageLanguageOnSmartphoneAsync(
}

/**
* Unregisters a smartphone media.
* Unregisters a smartphone media asynchronously.
*
* @param smartphoneMediaId The id of the smartphone media.
* @param requestConfig The request configuration (optional).
*/
suspend fun XesarConnect.unregisterSmartphone(
suspend fun XesarConnect.unregisterSmartphoneAsync(
smartphoneMediaId: UUID,
requestConfig: XesarConnect.RequestConfig = buildRequestConfig()
): SingleEventResult<SmartphoneUnregistered> {
Expand All @@ -181,7 +181,7 @@ suspend fun XesarConnect.unregisterSmartphone(
}

/**
* Resends a smartphone authorizations request.
* Resends a smartphone authorizations request asynchronously.
*
* @param smartphoneMediaId The id of the smartphone media.
* @param requestConfig The request configuration (optional).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import com.open200.xesar.connect.utils.UUIDSerializer
import java.util.*
import kotlinx.serialization.Serializable

/** Represents a command POJO to set the phone number on a smartphone media. */
/**
* Represents a command POJO to set the phone number on a smartphone media.
*
* @param commandId The id of the command.
* @param id The id of the smartphone media.
* @param phoneNumber The phone number to set.
* @param token The token of the command.
*/
@Serializable
data class SetPhoneNumberOnSmartphoneMapi(
override val commandId: @Serializable(with = UUIDSerializer::class) UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import com.open200.xesar.connect.utils.UUIDSerializer
import java.util.*
import kotlinx.serialization.Serializable

/** Represents an event POJO as a response of a command when a phone number was changed. */
/**
* Represents an event POJO as a response of a command when a phone number was changed.
*
* @param id The id of the smartphone media.
* @param phoneNumber The phone number that was set.
*/
@Serializable
data class PhoneNumberChanged(
val id: @Serializable(with = UUIDSerializer::class) UUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.open200.xesar.connect.it.command
import com.open200.xesar.connect.Topics
import com.open200.xesar.connect.XesarConnect
import com.open200.xesar.connect.XesarMqttClient
import com.open200.xesar.connect.extension.unregisterSmartphone
import com.open200.xesar.connect.extension.unregisterSmartphoneAsync
import com.open200.xesar.connect.it.MosquittoContainer
import com.open200.xesar.connect.messages.event.ApiEvent
import com.open200.xesar.connect.messages.event.SmartphoneUnregistered
Expand Down Expand Up @@ -66,7 +66,7 @@ class UnregisterSmartphoneTest :
val api = XesarConnect.connectAndLoginAsync(config).await()
api.subscribeAsync(Topics(Topics.Event.SMARTPHONE_UNREGISTERED)).await()
val result =
api.unregisterSmartphone(
api.unregisterSmartphoneAsync(
UUID.fromString("43edc7cf-80ab-4486-86db-41cda2c7a2cd"))
.await()

Expand Down

0 comments on commit 3992f09

Please sign in to comment.