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