fix: align enums key casing if used in compound
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
2896e06d 1import type {
2896e06d
JB
2 EmptyObject,
3 JsonObject,
4 OCPP16ChargePointErrorCode,
5 OCPP16ChargePointStatus,
6 OCPP16ChargingProfile,
0ac97927 7 OCPP16ChargingProfilePurposeType,
41189456 8 OCPP16ChargingRateUnitType,
2896e06d
JB
9 OCPP16DiagnosticsStatus,
10 OCPP16StandardParametersKey,
6dad8e21 11 OCPP16VendorParametersKey,
2896e06d 12} from '../../internal';
5bd15d76 13
c0560973 14export enum OCPP16RequestCommand {
d9f60ba1
JB
15 BOOT_NOTIFICATION = 'BootNotification',
16 HEARTBEAT = 'Heartbeat',
17 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 18 AUTHORIZE = 'Authorize',
d9f60ba1
JB
19 START_TRANSACTION = 'StartTransaction',
20 STOP_TRANSACTION = 'StopTransaction',
47e22477 21 METER_VALUES = 'MeterValues',
e7aeea18 22 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
d4c84337 23 FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification',
91a7d3ea 24 DATA_TRANSFER = 'DataTransfer',
d9f60ba1
JB
25}
26
953d6b02
JB
27export enum OCPP16IncomingRequestCommand {
28 RESET = 'Reset',
29 CLEAR_CACHE = 'ClearCache',
30 CHANGE_AVAILABILITY = 'ChangeAvailability',
31 UNLOCK_CONNECTOR = 'UnlockConnector',
32 GET_CONFIGURATION = 'GetConfiguration',
33 CHANGE_CONFIGURATION = 'ChangeConfiguration',
41189456 34 GET_COMPOSITE_SCHEDULE = 'GetCompositeSchedule',
953d6b02
JB
35 SET_CHARGING_PROFILE = 'SetChargingProfile',
36 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
37 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
38 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
39 GET_DIAGNOSTICS = 'GetDiagnostics',
40 TRIGGER_MESSAGE = 'TriggerMessage',
41 DATA_TRANSFER = 'DataTransfer',
42 UPDATE_FIRMWARE = 'UpdateFirmware',
43}
44
ef6fa3fb 45export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 46
e3822d6f 47export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 48 chargePointVendor: string;
f738a0e9
JB
49 chargePointModel: string;
50 chargePointSerialNumber?: string;
fec4d204 51 chargeBoxSerialNumber?: string;
f738a0e9
JB
52 firmwareVersion?: string;
53 iccid?: string;
54 imsi?: string;
f738a0e9 55 meterType?: string;
fec4d204 56 meterSerialNumber?: string;
f738a0e9
JB
57}
58
e3822d6f 59export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 60 connectorId: number;
c0560973 61 errorCode: OCPP16ChargePointErrorCode;
c0560973 62 status: OCPP16ChargePointStatus;
a9ed42b2 63 info?: string;
c38f0ced 64 timestamp?: Date;
f738a0e9
JB
65 vendorId?: string;
66 vendorErrorCode?: string;
67}
68
e3018bc4
JB
69export type OCPP16ClearCacheRequest = EmptyObject;
70
6dad8e21
JB
71type OCPP16ConfigurationKey = string | OCPP16StandardParametersKey | OCPP16VendorParametersKey;
72
e3822d6f 73export interface ChangeConfigurationRequest extends JsonObject {
6dad8e21 74 key: OCPP16ConfigurationKey;
f738a0e9
JB
75 value: string;
76}
77
e3822d6f 78export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
79 connectorId: number;
80 idTag: string;
c0560973 81 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
82}
83
e3822d6f 84export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
85 transactionId: number;
86}
87
e3822d6f 88export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
89 connectorId: number;
90}
91
e3822d6f 92export interface GetConfigurationRequest extends JsonObject {
6dad8e21 93 key?: OCPP16ConfigurationKey[];
f738a0e9
JB
94}
95
0ac97927 96enum ResetType {
f738a0e9 97 HARD = 'Hard',
e7aeea18 98 SOFT = 'Soft',
f738a0e9
JB
99}
100
e3822d6f 101export interface ResetRequest extends JsonObject {
f738a0e9 102 type: ResetType;
63b48f77 103}
8c476a1f 104
41189456
JB
105export interface OCPP16GetCompositeScheduleRequest extends JsonObject {
106 connectorId: number;
107 duration: number;
108 chargingRateUnit?: OCPP16ChargingRateUnitType;
109}
110
e3822d6f 111export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 112 connectorId: number;
c0560973 113 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 114}
4dff73b0 115
c0560973 116export enum OCPP16AvailabilityType {
0d6f335f
JB
117 Inoperative = 'Inoperative',
118 Operative = 'Operative',
4dff73b0
JB
119}
120
e3822d6f 121export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 122 connectorId: number;
c0560973 123 type: OCPP16AvailabilityType;
4dff73b0 124}
edf4bd64 125
e3822d6f 126export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
127 id?: number;
128 connectorId?: number;
0ac97927 129 chargingProfilePurpose?: OCPP16ChargingProfilePurposeType;
edf4bd64
JB
130 stackLevel?: number;
131}
47e22477 132
b03df580
JB
133export interface OCPP16UpdateFirmwareRequest extends JsonObject {
134 location: string;
135 retrieveDate: Date;
136 retries?: number;
137 retryInterval?: number;
138}
139
d4c84337
JB
140export enum OCPP16FirmwareStatus {
141 Downloaded = 'Downloaded',
142 DownloadFailed = 'DownloadFailed',
143 Downloading = 'Downloading',
144 Idle = 'Idle',
145 InstallationFailed = 'InstallationFailed',
146 Installing = 'Installing',
147 Installed = 'Installed',
148}
149
150export type OCPP16FirmwareStatusNotificationRequest = {
151 status: OCPP16FirmwareStatus;
c9a4f9ea 152} & JsonObject;
d4c84337 153
e3822d6f 154export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
155 location: string;
156 retries?: number;
157 retryInterval?: number;
158 startTime?: Date;
159 stopTime?: Date;
160}
161
c9a4f9ea 162export interface OCPP16DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 163 status: OCPP16DiagnosticsStatus;
47e22477 164}
802cfa13 165
c60ed4b8 166export enum OCPP16MessageTrigger {
802cfa13
JB
167 BootNotification = 'BootNotification',
168 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
169 FirmwareStatusNotification = 'FirmwareStatusNotification',
170 Heartbeat = 'Heartbeat',
171 MeterValues = 'MeterValues',
e7aeea18 172 StatusNotification = 'StatusNotification',
802cfa13
JB
173}
174
e3822d6f 175export interface OCPP16TriggerMessageRequest extends JsonObject {
c60ed4b8 176 requestedMessage: OCPP16MessageTrigger;
e7aeea18 177 connectorId?: number;
802cfa13 178}
91a7d3ea 179
77b95a89
JB
180export enum OCPP16DataTransferVendorId {}
181
91a7d3ea
JB
182export interface OCPP16DataTransferRequest extends JsonObject {
183 vendorId: string;
184 messageId?: string;
185 data?: string;
186}