// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
//
// SPDX-License-Identifier: Apache-2.0

/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

/**
 * Request_ Body
 * urn:x-enexis:ecdm:uid:2:234744
 *
 */
import {
  LocationEnumType,
  MeasurandEnumType,
  PhaseEnumType,
  ReadingContextEnumType,
} from '../enums/index.js';
import type { OcppRequest } from '../../../internal-types.js';

export interface MeterValuesRequest extends OcppRequest {
  customData?: CustomDataType | null;
  /**
   * Request_ Body. EVSEID. Numeric_ Identifier
   * urn:x-enexis:ecdm:uid:1:571101
   * This contains a number (&gt;0) designating an EVSE of the Charging Station. ‘0’ (zero) is used to designate the main power meter.
   *
   */
  evseId: number;
  /**
   * @minItems 1
   */
  meterValue: [MeterValueType, ...MeterValueType[]];
}
/**
 * Represents OCPP CustomData.
 * Allows vendor-specific extension properties.
 */
export interface CustomDataType {
  vendorId: string;
  [k: string]: unknown;
}
/**
 * Meter_ Value
 * urn:x-oca:ocpp:uid:2:233265
 * Collection of one or more sampled values in MeterValuesRequest and TransactionEvent. All sampled values in a MeterValue are sampled at the same point in time.
 *
 */
export interface MeterValueType {
  customData?: CustomDataType | null;
  /**
   * @minItems 1
   */
  sampledValue: [SampledValueType, ...SampledValueType[]];
  /**
   * Meter_ Value. Timestamp. Date_ Time
   * urn:x-oca:ocpp:uid:1:569259
   * Timestamp for measured value(s).
   *
   */
  timestamp: string;
}
/**
 * Sampled_ Value
 * urn:x-oca:ocpp:uid:2:233266
 * Single sampled value in MeterValues. Each value can be accompanied by optional fields.
 *
 * To save on mobile data usage, default values of all of the optional fields are such that. The value without any additional fields will be interpreted, as a register reading of active import energy in Wh (Watt-hour) units.
 *
 */
export interface SampledValueType {
  customData?: CustomDataType | null;
  /**
   * Sampled_ Value. Value. Measure
   * urn:x-oca:ocpp:uid:1:569260
   * Indicates the measured value.
   *
   *
   */
  value: number;
  context?: ReadingContextEnumType | null;
  measurand?: MeasurandEnumType | null;
  phase?: PhaseEnumType | null;
  location?: LocationEnumType | null;
  signedMeterValue?: SignedMeterValueType | null;
  unitOfMeasure?: UnitOfMeasureType | null;
}
/**
 * Represent a signed version of the meter value.
 *
 */
export interface SignedMeterValueType {
  customData?: CustomDataType | null;
  /**
   * Base64 encoded, contains the signed data which might contain more then just the meter value. It can contain information like timestamps, reference to a customer etc.
   *
   */
  signedMeterData: string;
  /**
   * Method used to create the digital signature.
   *
   */
  signingMethod: string;
  /**
   * Method used to encode the meter values before applying the digital signature algorithm.
   *
   */
  encodingMethod: string;
  /**
   * Base64 encoded, sending depends on configuration variable _PublicKeyWithSignedMeterValue_.
   *
   */
  publicKey: string;
}
/**
 * Represents a UnitOfMeasure with a multiplier
 *
 */
export interface UnitOfMeasureType {
  customData?: CustomDataType | null;
  /**
   * Unit of the value. Default = "Wh" if the (default) measurand is an "Energy" type.
   * This field SHALL use a value from the list Standardized Units of Measurements in Part 2 Appendices.
   * If an applicable unit is available in that list, otherwise a "custom" unit might be used.
   *
   */
  unit?: string | null;
  /**
   * Multiplier, this value represents the exponent to base 10. I.e. multiplier 3 means 10 raised to the 3rd power. Default is 0.
   *
   */
  multiplier?: number | null;
}
