Use eslint extension for import sorting instead of unmaintained external ones
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
CommitLineData
c12b43d0 1import { EmptyObject } from '../../EmptyObject';
e3822d6f 2import { JsonObject } from '../../JsonType';
c0560973
JB
3import { OCPP16ChargePointErrorCode } from './ChargePointErrorCode';
4import { OCPP16ChargePointStatus } from './ChargePointStatus';
8114d10e 5import { ChargingProfilePurposeType, OCPP16ChargingProfile } from './ChargingProfile';
c0560973 6import { OCPP16StandardParametersKey } from './Configuration';
8114d10e 7import { OCPP16DiagnosticsStatus } from './DiagnosticsStatus';
5bd15d76 8
c0560973 9export enum OCPP16RequestCommand {
d9f60ba1
JB
10 BOOT_NOTIFICATION = 'BootNotification',
11 HEARTBEAT = 'Heartbeat',
12 STATUS_NOTIFICATION = 'StatusNotification',
ef6076c1 13 AUTHORIZE = 'Authorize',
d9f60ba1
JB
14 START_TRANSACTION = 'StartTransaction',
15 STOP_TRANSACTION = 'StopTransaction',
47e22477 16 METER_VALUES = 'MeterValues',
e7aeea18 17 DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
d9f60ba1
JB
18}
19
c0560973 20export enum OCPP16IncomingRequestCommand {
d9f60ba1
JB
21 RESET = 'Reset',
22 CLEAR_CACHE = 'ClearCache',
4dff73b0 23 CHANGE_AVAILABILITY = 'ChangeAvailability',
d9f60ba1
JB
24 UNLOCK_CONNECTOR = 'UnlockConnector',
25 GET_CONFIGURATION = 'GetConfiguration',
26 CHANGE_CONFIGURATION = 'ChangeConfiguration',
27 SET_CHARGING_PROFILE = 'SetChargingProfile',
edf4bd64 28 CLEAR_CHARGING_PROFILE = 'ClearChargingProfile',
d9f60ba1 29 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
47e22477 30 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
802cfa13 31 GET_DIAGNOSTICS = 'GetDiagnostics',
e7aeea18 32 TRIGGER_MESSAGE = 'TriggerMessage',
d9f60ba1
JB
33}
34
ef6fa3fb 35export type OCPP16HeartbeatRequest = EmptyObject;
f738a0e9 36
e3822d6f 37export interface OCPP16BootNotificationRequest extends JsonObject {
fec4d204 38 chargePointVendor: string;
f738a0e9
JB
39 chargePointModel: string;
40 chargePointSerialNumber?: string;
fec4d204 41 chargeBoxSerialNumber?: string;
f738a0e9
JB
42 firmwareVersion?: string;
43 iccid?: string;
44 imsi?: string;
f738a0e9 45 meterType?: string;
fec4d204 46 meterSerialNumber?: string;
f738a0e9
JB
47}
48
e3822d6f 49export interface OCPP16StatusNotificationRequest extends JsonObject {
f738a0e9 50 connectorId: number;
c0560973 51 errorCode: OCPP16ChargePointErrorCode;
f738a0e9 52 info?: string;
c0560973 53 status: OCPP16ChargePointStatus;
f738a0e9
JB
54 timestamp?: string;
55 vendorId?: string;
56 vendorErrorCode?: string;
57}
58
e3822d6f 59export interface ChangeConfigurationRequest extends JsonObject {
c0560973 60 key: string | OCPP16StandardParametersKey;
f738a0e9
JB
61 value: string;
62}
63
e3822d6f 64export interface RemoteStartTransactionRequest extends JsonObject {
f738a0e9
JB
65 connectorId: number;
66 idTag: string;
c0560973 67 chargingProfile?: OCPP16ChargingProfile;
f738a0e9
JB
68}
69
e3822d6f 70export interface RemoteStopTransactionRequest extends JsonObject {
f738a0e9
JB
71 transactionId: number;
72}
73
e3822d6f 74export interface UnlockConnectorRequest extends JsonObject {
f738a0e9
JB
75 connectorId: number;
76}
77
e3822d6f 78export interface GetConfigurationRequest extends JsonObject {
c0560973 79 key?: string | OCPP16StandardParametersKey[];
f738a0e9
JB
80}
81
82export enum ResetType {
83 HARD = 'Hard',
e7aeea18 84 SOFT = 'Soft',
f738a0e9
JB
85}
86
e3822d6f 87export interface ResetRequest extends JsonObject {
f738a0e9 88 type: ResetType;
63b48f77 89}
8c476a1f 90
e3822d6f 91export interface SetChargingProfileRequest extends JsonObject {
8c476a1f 92 connectorId: number;
c0560973 93 csChargingProfiles: OCPP16ChargingProfile;
8c476a1f 94}
4dff73b0 95
c0560973 96export enum OCPP16AvailabilityType {
4dff73b0 97 INOPERATIVE = 'Inoperative',
e7aeea18 98 OPERATIVE = 'Operative',
4dff73b0
JB
99}
100
e3822d6f 101export interface ChangeAvailabilityRequest extends JsonObject {
4dff73b0 102 connectorId: number;
c0560973 103 type: OCPP16AvailabilityType;
4dff73b0 104}
edf4bd64 105
e3822d6f 106export interface ClearChargingProfileRequest extends JsonObject {
edf4bd64
JB
107 id?: number;
108 connectorId?: number;
109 chargingProfilePurpose?: ChargingProfilePurposeType;
110 stackLevel?: number;
111}
47e22477 112
e3822d6f 113export interface GetDiagnosticsRequest extends JsonObject {
47e22477
JB
114 location: string;
115 retries?: number;
116 retryInterval?: number;
117 startTime?: Date;
118 stopTime?: Date;
119}
120
e3822d6f 121export interface DiagnosticsStatusNotificationRequest extends JsonObject {
e7aeea18 122 status: OCPP16DiagnosticsStatus;
47e22477 123}
802cfa13
JB
124
125export enum MessageTrigger {
126 BootNotification = 'BootNotification',
127 DiagnosticsStatusNotification = 'DiagnosticsStatusNotification',
128 FirmwareStatusNotification = 'FirmwareStatusNotification',
129 Heartbeat = 'Heartbeat',
130 MeterValues = 'MeterValues',
e7aeea18 131 StatusNotification = 'StatusNotification',
802cfa13
JB
132}
133
e3822d6f 134export interface OCPP16TriggerMessageRequest extends JsonObject {
802cfa13 135 requestedMessage: MessageTrigger;
e7aeea18 136 connectorId?: number;
802cfa13 137}