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