// 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.
 */

import {
  LocationEnumType,
  MeasurandEnumType,
  PhaseEnumType,
  ReadingContextEnumType,
} from '../enums/index.js';
import type { OcppRequest } from '../../../internal-types.js';

export interface MeterValuesRequest extends OcppRequest {
  /**
   * 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[]];
  customData?: CustomDataType | null;
}
/**
 * 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 {
  /**
   * @minItems 1
   */
  sampledValue: [SampledValueType, ...SampledValueType[]];
  /**
   * Timestamp for measured value(s).
   *
   */
  timestamp: string;
  customData?: CustomDataType | null;
}
/**
 * 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 {
  /**
   * Indicates the measured value.
   *
   *
   */
  value: number;
  measurand?: MeasurandEnumType | null;
  context?: ReadingContextEnumType | null;
  phase?: PhaseEnumType | null;
  location?: LocationEnumType | null;
  signedMeterValue?: SignedMeterValueType | null;
  unitOfMeasure?: UnitOfMeasureType | null;
  customData?: CustomDataType | null;
}
/**
 * Represent a signed version of the meter value.
 *
 */
export interface SignedMeterValueType {
  /**
   * Base64 encoded, contains the signed data from the meter in the format specified in _encodingMethod_, which might contain more then just the meter value. It can contain information like timestamps, reference to a customer etc.
   *
   */
  signedMeterData: string;
  /**
   * *(2.1)* Method used to create the digital signature. Optional, if already included in _signedMeterData_. Standard values for this are defined in Appendix as SigningMethodEnumStringType.
   *
   */
  signingMethod?: string | null;
  /**
   * Format used by the energy meter to encode the meter data. For example: OCMF or EDL.
   *
   */
  encodingMethod: string;
  /**
   * *(2.1)* Base64 encoded, sending depends on configuration variable _PublicKeyWithSignedMeterValue_.
   *
   */
  publicKey?: string | null;
  customData?: CustomDataType | null;
}
/**
 * This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.
 */
export interface CustomDataType {
  vendorId: string;
  [k: string]: unknown;
}
/**
 * Represents a UnitOfMeasure with a multiplier
 *
 */
export interface UnitOfMeasureType {
  /**
   * 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. +
   * The _multiplier_ only multiplies the value of the measurand. It does not specify a conversion between units, for example, kW and W.
   *
   */
  multiplier?: number | null;
  customData?: CustomDataType | null;
}
