Skip to content

Commit

Permalink
Merge pull request #72 from KamlinneBebora-ly4sh/feat/add-request-res…
Browse files Browse the repository at this point in the history
…ponse-interface-in-messages

feat: add Request and Response interface
  • Loading branch information
lilgallon authored Jul 1, 2024
2 parents 80069df + db2445a commit f1bdc6d
Show file tree
Hide file tree
Showing 85 changed files with 206 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ abstract class SetChargingProfileMapper {
)
abstract fun coreToGenReq(setChargingProfileReq: SetChargingProfileReq): SetChargingProfileReqGen

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.izivia.ocpp.core16.model

interface Request
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.izivia.ocpp.core16.model

interface Response
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.izivia.ocpp.core16.model.authorize

import com.izivia.ocpp.core16.model.Request

data class AuthorizeReq(
val idTag: String
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.authorize

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.common.IdTagInfo

data class AuthorizeResp(
val idTagInfo: IdTagInfo
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.izivia.ocpp.core16.model.bootnotification

import com.izivia.ocpp.core16.model.Request

data class BootNotificationReq(
val chargePointModel: String,
val chargePointVendor: String,
Expand All @@ -10,4 +12,4 @@ data class BootNotificationReq(
val imsi: String? = null,
val meterSerialNumber: String? = null,
val meterType: String? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.izivia.ocpp.core16.model.bootnotification

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.bootnotification.enumeration.RegistrationStatus
import kotlinx.datetime.Instant

data class BootNotificationResp(
val currentTime: Instant,
val interval: Int,
val status: RegistrationStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.izivia.ocpp.core16.model.cancelreservation

import com.izivia.ocpp.core16.model.Request

data class CancelReservationReq(
val reservationId: Int
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.cancelreservation

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.cancelreservation.enumeration.CancelReservationStatus

data class CancelReservationResp(
val status: CancelReservationStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.izivia.ocpp.core16.model.certificatesigned

import com.izivia.ocpp.core16.model.Request

data class CertificateSignedReq(
val certificateChain: String
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.certificatesigned

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.certificatesigned.enumeration.DeleteCertificateStatusEnumType

data class CertificateSignedResp(
val status: DeleteCertificateStatusEnumType
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.izivia.ocpp.core16.model.changeavailability

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.changeavailability.enumeration.AvailabilityType

data class ChangeAvailabilityReq(
val connectorId: Int,
val type: AvailabilityType
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.changeavailability

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.changeavailability.enumeration.AvailabilityStatus

data class ChangeAvailabilityResp(
val status: AvailabilityStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.izivia.ocpp.core16.model.changeconfiguration

import com.izivia.ocpp.core16.model.Request

data class ChangeConfigurationReq(
val key: String,
val value: String
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.changeconfiguration

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.changeconfiguration.enumeration.ConfigurationStatus

data class ChangeConfigurationResp(
val status: ConfigurationStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.izivia.ocpp.core16.model.clearcache

class ClearCacheReq
import com.izivia.ocpp.core16.model.Request

class ClearCacheReq : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.clearcache

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.clearcache.enumeration.ClearCacheStatus

data class ClearCacheResp(
val status: ClearCacheStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.izivia.ocpp.core16.model.clearchargingprofile

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.common.enumeration.ChargingProfilePurposeType

data class ClearChargingProfileReq(
val id: Int? = null,
val connectorId: Int? = null,
val chargingProfilePurpose: ChargingProfilePurposeType? = null,
val stackLevel: Int? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.clearchargingprofile

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.clearchargingprofile.enumeration.ClearChargingProfileStatus

data class ClearChargingProfileResp(
val status: ClearChargingProfileStatus
)
) : Response
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.izivia.ocpp.core16.model.cancelreservation.CancelReservationReq
import com.izivia.ocpp.core16.model.cancelreservation.CancelReservationResp
import com.izivia.ocpp.core16.model.certificatesigned.CertificateSignedReq
import com.izivia.ocpp.core16.model.certificatesigned.CertificateSignedResp
import com.izivia.ocpp.core16.model.certificatesigned.DeleteCertificateResp
import com.izivia.ocpp.core16.model.deletecertificate.DeleteCertificateResp
import com.izivia.ocpp.core16.model.changeavailability.ChangeAvailabilityReq
import com.izivia.ocpp.core16.model.changeavailability.ChangeAvailabilityResp
import com.izivia.ocpp.core16.model.changeconfiguration.ChangeConfigurationReq
Expand All @@ -24,8 +24,8 @@ import com.izivia.ocpp.core16.model.diagnosticsstatusnotification.DiagnosticsSta
import com.izivia.ocpp.core16.model.diagnosticsstatusnotification.DiagnosticsStatusNotificationResp
import com.izivia.ocpp.core16.model.firmwarestatusnotification.FirmwareStatusNotificationReq
import com.izivia.ocpp.core16.model.firmwarestatusnotification.FirmwareStatusNotificationResp
import com.izivia.ocpp.core16.model.firmwarestatusnotification.SignedFirmwareStatusNotificationReq
import com.izivia.ocpp.core16.model.firmwarestatusnotification.SignedFirmwareStatusNotificationResp
import com.izivia.ocpp.core16.model.signedfirmwarestatusnotification.SignedFirmwareStatusNotificationReq
import com.izivia.ocpp.core16.model.signedfirmwarestatusnotification.SignedFirmwareStatusNotificationResp
import com.izivia.ocpp.core16.model.getcompositeschedule.GetCompositeScheduleReq
import com.izivia.ocpp.core16.model.getcompositeschedule.GetCompositeScheduleResp
import com.izivia.ocpp.core16.model.getconfiguration.GetConfigurationReq
Expand Down Expand Up @@ -68,14 +68,14 @@ import com.izivia.ocpp.core16.model.statusnotification.StatusNotificationReq
import com.izivia.ocpp.core16.model.statusnotification.StatusNotificationResp
import com.izivia.ocpp.core16.model.stoptransaction.StopTransactionReq
import com.izivia.ocpp.core16.model.stoptransaction.StopTransactionResp
import com.izivia.ocpp.core16.model.triggermessage.ExtendedTriggerMessageReq
import com.izivia.ocpp.core16.model.triggermessage.ExtendedTriggerMessageResp
import com.izivia.ocpp.core16.model.extendedtriggermessage.ExtendedTriggerMessageReq
import com.izivia.ocpp.core16.model.extendedtriggermessage.ExtendedTriggerMessageResp
import com.izivia.ocpp.core16.model.triggermessage.TriggerMessageReq
import com.izivia.ocpp.core16.model.triggermessage.TriggerMessageResp
import com.izivia.ocpp.core16.model.unlockconnector.UnlockConnectorReq
import com.izivia.ocpp.core16.model.unlockconnector.UnlockConnectorResp
import com.izivia.ocpp.core16.model.updatefirmware.SignedUpdateFirmwareReq
import com.izivia.ocpp.core16.model.updatefirmware.SignedUpdateFirmwareResp
import com.izivia.ocpp.core16.model.signedupdatefirmware.SignedUpdateFirmwareReq
import com.izivia.ocpp.core16.model.signedupdatefirmware.SignedUpdateFirmwareResp
import com.izivia.ocpp.core16.model.updatefirmware.UpdateFirmwareReq
import com.izivia.ocpp.core16.model.updatefirmware.UpdateFirmwareResp
import com.izivia.ocpp.utils.IActions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.izivia.ocpp.core16.model.datatransfer

import com.izivia.ocpp.core16.model.Request

data class DataTransferReq(
val vendorId: String,
val messageId: String? = null,
val data: String? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.izivia.ocpp.core16.model.datatransfer

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.datatransfer.enumeration.DataTransferStatus

data class DataTransferResp(
val status: DataTransferStatus,
val data: String? = null
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.izivia.ocpp.core16.model.deletecertificate

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.deletecertificate.enumeration.HashAlgorithmEnumType

data class DeleteCertificateReq(
val certificateHashData: CertificateHashDataType
)
) : Request

data class CertificateHashDataType(
val hashAlgorithm: HashAlgorithmEnumType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.certificatesigned
package com.izivia.ocpp.core16.model.deletecertificate

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.certificatesigned.enumeration.DeleteCertificateStatusEnumType

data class DeleteCertificateResp(
val status: DeleteCertificateStatusEnumType
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.diagnosticsstatusnotification

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.diagnosticsstatusnotification.enumeration.DiagnosticsStatus

data class DiagnosticsStatusNotificationReq(
val status: DiagnosticsStatus
)
val status: DiagnosticsStatus
) : Request
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.izivia.ocpp.core16.model.diagnosticsstatusnotification

class DiagnosticsStatusNotificationResp
import com.izivia.ocpp.core16.model.Response

class DiagnosticsStatusNotificationResp : Response
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.izivia.ocpp.core16.model.triggermessage
package com.izivia.ocpp.core16.model.extendedtriggermessage

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.triggermessage.enumeration.MessageTrigger

data class ExtendedTriggerMessageReq(
val requestedMessage: MessageTrigger,
val connectorId: Int? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.triggermessage
package com.izivia.ocpp.core16.model.extendedtriggermessage

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.triggermessage.enumeration.TriggerMessageStatus

data class ExtendedTriggerMessageResp(
val status: TriggerMessageStatus
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.izivia.ocpp.core16.model.firmwarestatusnotification

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.firmwarestatusnotification.enumeration.FirmwareStatus

data class FirmwareStatusNotificationReq(
val status: FirmwareStatus
)
val status: FirmwareStatus
) : Request
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.izivia.ocpp.core16.model.firmwarestatusnotification

class FirmwareStatusNotificationResp
import com.izivia.ocpp.core16.model.Response

class FirmwareStatusNotificationResp : Response
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.izivia.ocpp.core16.model.getcompositeschedule

import com.izivia.ocpp.core16.model.Request
import com.izivia.ocpp.core16.model.common.enumeration.ChargingRateUnitType

data class GetCompositeScheduleReq(
val connectorId: Int,
val duration: Int,
val chargingRateUnit: ChargingRateUnitType? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.izivia.ocpp.core16.model.getcompositeschedule

import com.izivia.ocpp.core16.model.Response
import com.izivia.ocpp.core16.model.common.ChargingSchedule
import com.izivia.ocpp.core16.model.getcompositeschedule.enumeration.GetCompositeScheduleStatus
import kotlinx.datetime.Instant
Expand All @@ -9,4 +10,4 @@ data class GetCompositeScheduleResp(
val connectorId: Int? = null,
val scheduleStart: Instant? = null,
val chargingSchedule: ChargingSchedule? = null
)
) : Response
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.izivia.ocpp.core16.model.getconfiguration

import com.izivia.ocpp.core16.model.Request

data class GetConfigurationReq(
val key: List<String>? = null
)
) : Request
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.izivia.ocpp.core16.model.getconfiguration

import com.izivia.ocpp.core16.model.Response

data class GetConfigurationResp(
val configurationKey: List<KeyValue>? = null,
val unknownKey: List<String>? = null
)
) : Response
Loading

0 comments on commit f1bdc6d

Please sign in to comment.