#![allow(unused_imports, clippy::doc_markdown, clippy::struct_excessive_bools)]
#![allow(
clippy::too_many_lines,
clippy::too_many_arguments,
clippy::wildcard_imports
)]
#![allow(clippy::match_same_arms, clippy::fn_params_excessive_bools)]
use alloc::string::String;
use alloc::vec::Vec;
use serde::{Deserialize, Serialize};
use super::action::Action;
use super::enums::*;
use super::types::*;
use crate::message::{Confirmed, MessageKind, Origin, Request, Response, Sealed, Unconfirmed};
use crate::validate::{self, Validate, ValidationPath, Violations};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AuthorizeRequest {
#[serde(rename = "idToken")]
pub id_token: IdToken,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate: Option<String>,
#[serde(rename = "iso15118CertificateHashData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub iso15118_certificate_hash_data: Option<Vec<OCSPRequestData>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl AuthorizeRequest {
#[must_use]
pub fn new(id_token: IdToken) -> Self {
Self {
id_token,
certificate: None,
iso15118_certificate_hash_data: None,
custom_data: None,
}
}
#[must_use]
pub fn with_certificate(mut self, value: impl Into<String>) -> Self {
self.certificate = Some(value.into());
self
}
#[must_use]
pub fn with_iso15118_certificate_hash_data(mut self, value: Vec<OCSPRequestData>) -> Self {
self.iso15118_certificate_hash_data = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for AuthorizeRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("idToken");
Validate::validate_at(&self.id_token, path, out);
path.pop();
path.push_key("certificate");
if let Some(value) = &self.certificate {
validate::string(value.as_str(), None, Some(5500), path, out);
}
path.pop();
path.push_key("iso15118CertificateHashData");
if let Some(value) = &self.iso15118_certificate_hash_data {
validate::list_len(value.len(), Some(1), Some(4), path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for AuthorizeRequest {}
impl Request for AuthorizeRequest {
type Action = Action;
const ACTION: Action = Action::Authorize;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = AuthorizeResponse;
}
impl Confirmed for AuthorizeRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct AuthorizeResponse {
#[serde(rename = "idTokenInfo")]
pub id_token_info: IdTokenInfo,
#[serde(rename = "certificateStatus")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate_status: Option<AuthorizeCertificateStatus>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl AuthorizeResponse {
#[must_use]
pub fn new(id_token_info: IdTokenInfo) -> Self {
Self {
id_token_info,
certificate_status: None,
custom_data: None,
}
}
#[must_use]
pub fn with_certificate_status(mut self, value: AuthorizeCertificateStatus) -> Self {
self.certificate_status = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for AuthorizeResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("idTokenInfo");
Validate::validate_at(&self.id_token_info, path, out);
path.pop();
path.push_key("certificateStatus");
if let Some(value) = &self.certificate_status {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for AuthorizeResponse {}
impl Response for AuthorizeResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BootNotificationRequest {
#[serde(rename = "chargingStation")]
pub charging_station: ChargingStation,
pub reason: BootReason,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl BootNotificationRequest {
#[must_use]
pub fn new(charging_station: ChargingStation, reason: BootReason) -> Self {
Self {
charging_station,
reason,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for BootNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingStation");
Validate::validate_at(&self.charging_station, path, out);
path.pop();
path.push_key("reason");
Validate::validate_at(&self.reason, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for BootNotificationRequest {}
impl Request for BootNotificationRequest {
type Action = Action;
const ACTION: Action = Action::BootNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = BootNotificationResponse;
}
impl Confirmed for BootNotificationRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BootNotificationResponse {
#[serde(rename = "currentTime")]
pub current_time: crate::types::DateTime,
#[serde(deserialize_with = "crate::types::integer::one")]
pub interval: i32,
pub status: RegistrationStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl BootNotificationResponse {
#[must_use]
pub fn new(
current_time: impl Into<crate::types::DateTime>,
interval: i32,
status: RegistrationStatus,
) -> Self {
Self {
current_time: current_time.into(),
interval,
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for BootNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for BootNotificationResponse {}
impl Response for BootNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CancelReservationRequest {
#[serde(rename = "reservationId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub reservation_id: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CancelReservationRequest {
#[must_use]
pub fn new(reservation_id: i32) -> Self {
Self {
reservation_id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CancelReservationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CancelReservationRequest {}
impl Request for CancelReservationRequest {
type Action = Action;
const ACTION: Action = Action::CancelReservation;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = CancelReservationResponse;
}
impl Confirmed for CancelReservationRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CancelReservationResponse {
pub status: CancelReservationStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CancelReservationResponse {
#[must_use]
pub fn new(status: CancelReservationStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CancelReservationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CancelReservationResponse {}
impl Response for CancelReservationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CertificateSignedRequest {
#[serde(rename = "certificateChain")]
pub certificate_chain: String,
#[serde(rename = "certificateType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate_type: Option<CertificateSigningUse>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CertificateSignedRequest {
#[must_use]
pub fn new(certificate_chain: impl Into<String>) -> Self {
Self {
certificate_chain: certificate_chain.into(),
certificate_type: None,
custom_data: None,
}
}
#[must_use]
pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
self.certificate_type = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CertificateSignedRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("certificateChain");
validate::string(
self.certificate_chain.as_str(),
None,
Some(10000),
path,
out,
);
path.pop();
path.push_key("certificateType");
if let Some(value) = &self.certificate_type {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CertificateSignedRequest {}
impl Request for CertificateSignedRequest {
type Action = Action;
const ACTION: Action = Action::CertificateSigned;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = CertificateSignedResponse;
}
impl Confirmed for CertificateSignedRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CertificateSignedResponse {
pub status: CertificateSignedStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CertificateSignedResponse {
#[must_use]
pub fn new(status: CertificateSignedStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CertificateSignedResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CertificateSignedResponse {}
impl Response for CertificateSignedResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChangeAvailabilityRequest {
#[serde(rename = "operationalStatus")]
pub operational_status: OperationalStatus,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub evse: Option<EVSE>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ChangeAvailabilityRequest {
#[must_use]
pub fn new(operational_status: OperationalStatus) -> Self {
Self {
operational_status,
evse: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse(mut self, value: EVSE) -> Self {
self.evse = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ChangeAvailabilityRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("operationalStatus");
Validate::validate_at(&self.operational_status, path, out);
path.pop();
path.push_key("evse");
if let Some(value) = &self.evse {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ChangeAvailabilityRequest {}
impl Request for ChangeAvailabilityRequest {
type Action = Action;
const ACTION: Action = Action::ChangeAvailability;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ChangeAvailabilityResponse;
}
impl Confirmed for ChangeAvailabilityRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChangeAvailabilityResponse {
pub status: ChangeAvailabilityStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ChangeAvailabilityResponse {
#[must_use]
pub fn new(status: ChangeAvailabilityStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ChangeAvailabilityResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ChangeAvailabilityResponse {}
impl Response for ChangeAvailabilityResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearCacheRequest {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearCacheRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearCacheRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearCacheRequest {}
impl Request for ClearCacheRequest {
type Action = Action;
const ACTION: Action = Action::ClearCache;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ClearCacheResponse;
}
impl Confirmed for ClearCacheRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearCacheResponse {
pub status: ClearCacheStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearCacheResponse {
#[must_use]
pub fn new(status: ClearCacheStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearCacheResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearCacheResponse {}
impl Response for ClearCacheResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearChargingProfileRequest {
#[serde(rename = "chargingProfileId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub charging_profile_id: Option<i32>,
#[serde(rename = "chargingProfileCriteria")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub charging_profile_criteria: Option<ClearChargingProfile>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearChargingProfileRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_charging_profile_id(mut self, value: i32) -> Self {
self.charging_profile_id = Some(value);
self
}
#[must_use]
pub fn with_charging_profile_criteria(mut self, value: ClearChargingProfile) -> Self {
self.charging_profile_criteria = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearChargingProfileRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingProfileCriteria");
if let Some(value) = &self.charging_profile_criteria {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearChargingProfileRequest {}
impl Request for ClearChargingProfileRequest {
type Action = Action;
const ACTION: Action = Action::ClearChargingProfile;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ClearChargingProfileResponse;
}
impl Confirmed for ClearChargingProfileRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearChargingProfileResponse {
pub status: ClearChargingProfileStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearChargingProfileResponse {
#[must_use]
pub fn new(status: ClearChargingProfileStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearChargingProfileResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearChargingProfileResponse {}
impl Response for ClearChargingProfileResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearDisplayMessageRequest {
#[serde(deserialize_with = "crate::types::integer::one")]
pub id: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearDisplayMessageRequest {
#[must_use]
pub fn new(id: i32) -> Self {
Self {
id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearDisplayMessageRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearDisplayMessageRequest {}
impl Request for ClearDisplayMessageRequest {
type Action = Action;
const ACTION: Action = Action::ClearDisplayMessage;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ClearDisplayMessageResponse;
}
impl Confirmed for ClearDisplayMessageRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearDisplayMessageResponse {
pub status: ClearMessageStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearDisplayMessageResponse {
#[must_use]
pub fn new(status: ClearMessageStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearDisplayMessageResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearDisplayMessageResponse {}
impl Response for ClearDisplayMessageResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearVariableMonitoringRequest {
#[serde(deserialize_with = "crate::types::integer::list")]
pub id: Vec<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearVariableMonitoringRequest {
#[must_use]
pub fn new(id: Vec<i32>) -> Self {
Self {
id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearVariableMonitoringRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("id");
validate::list_len(self.id.len(), Some(1), None, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearVariableMonitoringRequest {}
impl Request for ClearVariableMonitoringRequest {
type Action = Action;
const ACTION: Action = Action::ClearVariableMonitoring;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ClearVariableMonitoringResponse;
}
impl Confirmed for ClearVariableMonitoringRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearVariableMonitoringResponse {
#[serde(rename = "clearMonitoringResult")]
pub clear_monitoring_result: Vec<ClearMonitoringResult>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearVariableMonitoringResponse {
#[must_use]
pub fn new(clear_monitoring_result: Vec<ClearMonitoringResult>) -> Self {
Self {
clear_monitoring_result,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearVariableMonitoringResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("clearMonitoringResult");
validate::list_len(self.clear_monitoring_result.len(), Some(1), None, path, out);
for (index, item) in self.clear_monitoring_result.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearVariableMonitoringResponse {}
impl Response for ClearVariableMonitoringResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClearedChargingLimitRequest {
#[serde(rename = "chargingLimitSource")]
pub charging_limit_source: ChargingLimitSource,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearedChargingLimitRequest {
#[must_use]
pub fn new(charging_limit_source: ChargingLimitSource) -> Self {
Self {
charging_limit_source,
evse_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearedChargingLimitRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingLimitSource");
Validate::validate_at(&self.charging_limit_source, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearedChargingLimitRequest {}
impl Request for ClearedChargingLimitRequest {
type Action = Action;
const ACTION: Action = Action::ClearedChargingLimit;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = ClearedChargingLimitResponse;
}
impl Confirmed for ClearedChargingLimitRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearedChargingLimitResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ClearedChargingLimitResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ClearedChargingLimitResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ClearedChargingLimitResponse {}
impl Response for ClearedChargingLimitResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CostUpdatedRequest {
#[serde(rename = "totalCost")]
pub total_cost: crate::types::Decimal,
#[serde(rename = "transactionId")]
pub transaction_id: String,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CostUpdatedRequest {
#[must_use]
pub fn new(
total_cost: impl Into<crate::types::Decimal>,
transaction_id: impl Into<String>,
) -> Self {
Self {
total_cost: total_cost.into(),
transaction_id: transaction_id.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CostUpdatedRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("transactionId");
validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CostUpdatedRequest {}
impl Request for CostUpdatedRequest {
type Action = Action;
const ACTION: Action = Action::CostUpdated;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = CostUpdatedResponse;
}
impl Confirmed for CostUpdatedRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct CostUpdatedResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CostUpdatedResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CostUpdatedResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CostUpdatedResponse {}
impl Response for CostUpdatedResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CustomerInformationRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
pub report: bool,
pub clear: bool,
#[serde(rename = "customerCertificate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub customer_certificate: Option<CertificateHashData>,
#[serde(rename = "idToken")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id_token: Option<IdToken>,
#[serde(rename = "customerIdentifier")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub customer_identifier: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CustomerInformationRequest {
#[must_use]
pub fn new(request_id: i32, report: bool, clear: bool) -> Self {
Self {
request_id,
report,
clear,
customer_certificate: None,
id_token: None,
customer_identifier: None,
custom_data: None,
}
}
#[must_use]
pub fn with_customer_certificate(mut self, value: CertificateHashData) -> Self {
self.customer_certificate = Some(value);
self
}
#[must_use]
pub fn with_id_token(mut self, value: IdToken) -> Self {
self.id_token = Some(value);
self
}
#[must_use]
pub fn with_customer_identifier(mut self, value: impl Into<String>) -> Self {
self.customer_identifier = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CustomerInformationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customerCertificate");
if let Some(value) = &self.customer_certificate {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("idToken");
if let Some(value) = &self.id_token {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customerIdentifier");
if let Some(value) = &self.customer_identifier {
validate::string(value.as_str(), None, Some(64), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CustomerInformationRequest {}
impl Request for CustomerInformationRequest {
type Action = Action;
const ACTION: Action = Action::CustomerInformation;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = CustomerInformationResponse;
}
impl Confirmed for CustomerInformationRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CustomerInformationResponse {
pub status: CustomerInformationStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl CustomerInformationResponse {
#[must_use]
pub fn new(status: CustomerInformationStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for CustomerInformationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for CustomerInformationResponse {}
impl Response for CustomerInformationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DataTransferRequest {
#[serde(rename = "vendorId")]
pub vendor_id: String,
#[serde(rename = "messageId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub data: Option<serde_json::Value>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl DataTransferRequest {
#[must_use]
pub fn new(vendor_id: impl Into<String>) -> Self {
Self {
vendor_id: vendor_id.into(),
message_id: None,
data: None,
custom_data: None,
}
}
#[must_use]
pub fn with_message_id(mut self, value: impl Into<String>) -> Self {
self.message_id = Some(value.into());
self
}
#[must_use]
pub fn with_data(mut self, value: serde_json::Value) -> Self {
self.data = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for DataTransferRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("vendorId");
validate::string(self.vendor_id.as_str(), None, Some(255), path, out);
path.pop();
path.push_key("messageId");
if let Some(value) = &self.message_id {
validate::string(value.as_str(), None, Some(50), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for DataTransferRequest {}
impl Request for DataTransferRequest {
type Action = Action;
const ACTION: Action = Action::DataTransfer;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Both;
type Response = DataTransferResponse;
}
impl Confirmed for DataTransferRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DataTransferResponse {
pub status: DataTransferStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub data: Option<serde_json::Value>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl DataTransferResponse {
#[must_use]
pub fn new(status: DataTransferStatus) -> Self {
Self {
status,
status_info: None,
data: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_data(mut self, value: serde_json::Value) -> Self {
self.data = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for DataTransferResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for DataTransferResponse {}
impl Response for DataTransferResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeleteCertificateRequest {
#[serde(rename = "certificateHashData")]
pub certificate_hash_data: CertificateHashData,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl DeleteCertificateRequest {
#[must_use]
pub fn new(certificate_hash_data: CertificateHashData) -> Self {
Self {
certificate_hash_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for DeleteCertificateRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("certificateHashData");
Validate::validate_at(&self.certificate_hash_data, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for DeleteCertificateRequest {}
impl Request for DeleteCertificateRequest {
type Action = Action;
const ACTION: Action = Action::DeleteCertificate;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = DeleteCertificateResponse;
}
impl Confirmed for DeleteCertificateRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeleteCertificateResponse {
pub status: DeleteCertificateStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl DeleteCertificateResponse {
#[must_use]
pub fn new(status: DeleteCertificateStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for DeleteCertificateResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for DeleteCertificateResponse {}
impl Response for DeleteCertificateResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirmwareStatusNotificationRequest {
pub status: FirmwareStatus,
#[serde(rename = "requestId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub request_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl FirmwareStatusNotificationRequest {
#[must_use]
pub fn new(status: FirmwareStatus) -> Self {
Self {
status,
request_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_request_id(mut self, value: i32) -> Self {
self.request_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for FirmwareStatusNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for FirmwareStatusNotificationRequest {}
impl Request for FirmwareStatusNotificationRequest {
type Action = Action;
const ACTION: Action = Action::FirmwareStatusNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = FirmwareStatusNotificationResponse;
}
impl Confirmed for FirmwareStatusNotificationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct FirmwareStatusNotificationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl FirmwareStatusNotificationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for FirmwareStatusNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for FirmwareStatusNotificationResponse {}
impl Response for FirmwareStatusNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Get15118EVCertificateRequest {
#[serde(rename = "iso15118SchemaVersion")]
pub iso15118_schema_version: String,
pub action: CertificateAction,
#[serde(rename = "exiRequest")]
pub exi_request: String,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl Get15118EVCertificateRequest {
#[must_use]
pub fn new(
iso15118_schema_version: impl Into<String>,
action: CertificateAction,
exi_request: impl Into<String>,
) -> Self {
Self {
iso15118_schema_version: iso15118_schema_version.into(),
action,
exi_request: exi_request.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for Get15118EVCertificateRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("iso15118SchemaVersion");
validate::string(
self.iso15118_schema_version.as_str(),
None,
Some(50),
path,
out,
);
path.pop();
path.push_key("action");
Validate::validate_at(&self.action, path, out);
path.pop();
path.push_key("exiRequest");
validate::string(self.exi_request.as_str(), None, Some(5600), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for Get15118EVCertificateRequest {}
impl Request for Get15118EVCertificateRequest {
type Action = Action;
const ACTION: Action = Action::Get15118EVCertificate;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = Get15118EVCertificateResponse;
}
impl Confirmed for Get15118EVCertificateRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Get15118EVCertificateResponse {
pub status: Iso15118EVCertificateStatus,
#[serde(rename = "exiResponse")]
pub exi_response: String,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl Get15118EVCertificateResponse {
#[must_use]
pub fn new(status: Iso15118EVCertificateStatus, exi_response: impl Into<String>) -> Self {
Self {
status,
exi_response: exi_response.into(),
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for Get15118EVCertificateResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("exiResponse");
validate::string(self.exi_response.as_str(), None, Some(5600), path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for Get15118EVCertificateResponse {}
impl Response for Get15118EVCertificateResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetBaseReportRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "reportBase")]
pub report_base: ReportBase,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetBaseReportRequest {
#[must_use]
pub fn new(request_id: i32, report_base: ReportBase) -> Self {
Self {
request_id,
report_base,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetBaseReportRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("reportBase");
Validate::validate_at(&self.report_base, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetBaseReportRequest {}
impl Request for GetBaseReportRequest {
type Action = Action;
const ACTION: Action = Action::GetBaseReport;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetBaseReportResponse;
}
impl Confirmed for GetBaseReportRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetBaseReportResponse {
pub status: GenericDeviceModelStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetBaseReportResponse {
#[must_use]
pub fn new(status: GenericDeviceModelStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetBaseReportResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetBaseReportResponse {}
impl Response for GetBaseReportResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetCertificateStatusRequest {
#[serde(rename = "ocspRequestData")]
pub ocsp_request_data: OCSPRequestData,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetCertificateStatusRequest {
#[must_use]
pub fn new(ocsp_request_data: OCSPRequestData) -> Self {
Self {
ocsp_request_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetCertificateStatusRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("ocspRequestData");
Validate::validate_at(&self.ocsp_request_data, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetCertificateStatusRequest {}
impl Request for GetCertificateStatusRequest {
type Action = Action;
const ACTION: Action = Action::GetCertificateStatus;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = GetCertificateStatusResponse;
}
impl Confirmed for GetCertificateStatusRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetCertificateStatusResponse {
pub status: GetCertificateStatusEnum,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "ocspResult")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ocsp_result: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetCertificateStatusResponse {
#[must_use]
pub fn new(status: GetCertificateStatusEnum) -> Self {
Self {
status,
status_info: None,
ocsp_result: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_ocsp_result(mut self, value: impl Into<String>) -> Self {
self.ocsp_result = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetCertificateStatusResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("ocspResult");
if let Some(value) = &self.ocsp_result {
validate::string(value.as_str(), None, Some(5500), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetCertificateStatusResponse {}
impl Response for GetCertificateStatusResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetChargingProfilesRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "chargingProfile")]
pub charging_profile: ChargingProfileCriterion,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetChargingProfilesRequest {
#[must_use]
pub fn new(request_id: i32, charging_profile: ChargingProfileCriterion) -> Self {
Self {
request_id,
charging_profile,
evse_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetChargingProfilesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingProfile");
Validate::validate_at(&self.charging_profile, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetChargingProfilesRequest {}
impl Request for GetChargingProfilesRequest {
type Action = Action;
const ACTION: Action = Action::GetChargingProfiles;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetChargingProfilesResponse;
}
impl Confirmed for GetChargingProfilesRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetChargingProfilesResponse {
pub status: GetChargingProfileStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetChargingProfilesResponse {
#[must_use]
pub fn new(status: GetChargingProfileStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetChargingProfilesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetChargingProfilesResponse {}
impl Response for GetChargingProfilesResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetCompositeScheduleRequest {
#[serde(deserialize_with = "crate::types::integer::one")]
pub duration: i32,
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "chargingRateUnit")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub charging_rate_unit: Option<ChargingRateUnit>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetCompositeScheduleRequest {
#[must_use]
pub fn new(duration: i32, evse_id: i32) -> Self {
Self {
duration,
evse_id,
charging_rate_unit: None,
custom_data: None,
}
}
#[must_use]
pub fn with_charging_rate_unit(mut self, value: ChargingRateUnit) -> Self {
self.charging_rate_unit = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetCompositeScheduleRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingRateUnit");
if let Some(value) = &self.charging_rate_unit {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetCompositeScheduleRequest {}
impl Request for GetCompositeScheduleRequest {
type Action = Action;
const ACTION: Action = Action::GetCompositeSchedule;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetCompositeScheduleResponse;
}
impl Confirmed for GetCompositeScheduleRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetCompositeScheduleResponse {
pub status: GenericStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub schedule: Option<CompositeSchedule>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetCompositeScheduleResponse {
#[must_use]
pub fn new(status: GenericStatus) -> Self {
Self {
status,
status_info: None,
schedule: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_schedule(mut self, value: CompositeSchedule) -> Self {
self.schedule = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetCompositeScheduleResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("schedule");
if let Some(value) = &self.schedule {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetCompositeScheduleResponse {}
impl Response for GetCompositeScheduleResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetDisplayMessagesRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option_list")]
pub id: Option<Vec<i32>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub priority: Option<MessagePriority>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub state: Option<MessageState>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetDisplayMessagesRequest {
#[must_use]
pub fn new(request_id: i32) -> Self {
Self {
request_id,
id: None,
priority: None,
state: None,
custom_data: None,
}
}
#[must_use]
pub fn with_id(mut self, value: Vec<i32>) -> Self {
self.id = Some(value);
self
}
#[must_use]
pub fn with_priority(mut self, value: MessagePriority) -> Self {
self.priority = Some(value);
self
}
#[must_use]
pub fn with_state(mut self, value: MessageState) -> Self {
self.state = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetDisplayMessagesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("id");
if let Some(value) = &self.id {
validate::list_len(value.len(), Some(1), None, path, out);
}
path.pop();
path.push_key("priority");
if let Some(value) = &self.priority {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("state");
if let Some(value) = &self.state {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetDisplayMessagesRequest {}
impl Request for GetDisplayMessagesRequest {
type Action = Action;
const ACTION: Action = Action::GetDisplayMessages;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetDisplayMessagesResponse;
}
impl Confirmed for GetDisplayMessagesRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetDisplayMessagesResponse {
pub status: GetDisplayMessagesStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetDisplayMessagesResponse {
#[must_use]
pub fn new(status: GetDisplayMessagesStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetDisplayMessagesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetDisplayMessagesResponse {}
impl Response for GetDisplayMessagesResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct GetInstalledCertificateIdsRequest {
#[serde(rename = "certificateType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate_type: Option<Vec<GetCertificateIdUse>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetInstalledCertificateIdsRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_certificate_type(mut self, value: Vec<GetCertificateIdUse>) -> Self {
self.certificate_type = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetInstalledCertificateIdsRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("certificateType");
if let Some(value) = &self.certificate_type {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetInstalledCertificateIdsRequest {}
impl Request for GetInstalledCertificateIdsRequest {
type Action = Action;
const ACTION: Action = Action::GetInstalledCertificateIds;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetInstalledCertificateIdsResponse;
}
impl Confirmed for GetInstalledCertificateIdsRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetInstalledCertificateIdsResponse {
pub status: GetInstalledCertificateStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "certificateHashDataChain")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate_hash_data_chain: Option<Vec<CertificateHashDataChain>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetInstalledCertificateIdsResponse {
#[must_use]
pub fn new(status: GetInstalledCertificateStatus) -> Self {
Self {
status,
status_info: None,
certificate_hash_data_chain: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_certificate_hash_data_chain(
mut self,
value: Vec<CertificateHashDataChain>,
) -> Self {
self.certificate_hash_data_chain = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetInstalledCertificateIdsResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("certificateHashDataChain");
if let Some(value) = &self.certificate_hash_data_chain {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetInstalledCertificateIdsResponse {}
impl Response for GetInstalledCertificateIdsResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct GetLocalListVersionRequest {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetLocalListVersionRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetLocalListVersionRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetLocalListVersionRequest {}
impl Request for GetLocalListVersionRequest {
type Action = Action;
const ACTION: Action = Action::GetLocalListVersion;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetLocalListVersionResponse;
}
impl Confirmed for GetLocalListVersionRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetLocalListVersionResponse {
#[serde(rename = "versionNumber")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub version_number: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetLocalListVersionResponse {
#[must_use]
pub fn new(version_number: i32) -> Self {
Self {
version_number,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetLocalListVersionResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetLocalListVersionResponse {}
impl Response for GetLocalListVersionResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetLogRequest {
pub log: LogParameters,
#[serde(rename = "logType")]
pub log_type: Log,
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retries: Option<i32>,
#[serde(rename = "retryInterval")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retry_interval: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetLogRequest {
#[must_use]
pub fn new(log: LogParameters, log_type: Log, request_id: i32) -> Self {
Self {
log,
log_type,
request_id,
retries: None,
retry_interval: None,
custom_data: None,
}
}
#[must_use]
pub fn with_retries(mut self, value: i32) -> Self {
self.retries = Some(value);
self
}
#[must_use]
pub fn with_retry_interval(mut self, value: i32) -> Self {
self.retry_interval = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetLogRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("log");
Validate::validate_at(&self.log, path, out);
path.pop();
path.push_key("logType");
Validate::validate_at(&self.log_type, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetLogRequest {}
impl Request for GetLogRequest {
type Action = Action;
const ACTION: Action = Action::GetLog;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetLogResponse;
}
impl Confirmed for GetLogRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetLogResponse {
pub status: LogStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub filename: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetLogResponse {
#[must_use]
pub fn new(status: LogStatus) -> Self {
Self {
status,
status_info: None,
filename: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_filename(mut self, value: impl Into<String>) -> Self {
self.filename = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetLogResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("filename");
if let Some(value) = &self.filename {
validate::string(value.as_str(), None, Some(255), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetLogResponse {}
impl Response for GetLogResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetMonitoringReportRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "componentVariable")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub component_variable: Option<Vec<ComponentVariable>>,
#[serde(rename = "monitoringCriteria")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub monitoring_criteria: Option<Vec<MonitoringCriterion>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetMonitoringReportRequest {
#[must_use]
pub fn new(request_id: i32) -> Self {
Self {
request_id,
component_variable: None,
monitoring_criteria: None,
custom_data: None,
}
}
#[must_use]
pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
self.component_variable = Some(value);
self
}
#[must_use]
pub fn with_monitoring_criteria(mut self, value: Vec<MonitoringCriterion>) -> Self {
self.monitoring_criteria = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetMonitoringReportRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("componentVariable");
if let Some(value) = &self.component_variable {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("monitoringCriteria");
if let Some(value) = &self.monitoring_criteria {
validate::list_len(value.len(), Some(1), Some(3), path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetMonitoringReportRequest {}
impl Request for GetMonitoringReportRequest {
type Action = Action;
const ACTION: Action = Action::GetMonitoringReport;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetMonitoringReportResponse;
}
impl Confirmed for GetMonitoringReportRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetMonitoringReportResponse {
pub status: GenericDeviceModelStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetMonitoringReportResponse {
#[must_use]
pub fn new(status: GenericDeviceModelStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetMonitoringReportResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetMonitoringReportResponse {}
impl Response for GetMonitoringReportResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetReportRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "componentVariable")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub component_variable: Option<Vec<ComponentVariable>>,
#[serde(rename = "componentCriteria")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub component_criteria: Option<Vec<ComponentCriterion>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetReportRequest {
#[must_use]
pub fn new(request_id: i32) -> Self {
Self {
request_id,
component_variable: None,
component_criteria: None,
custom_data: None,
}
}
#[must_use]
pub fn with_component_variable(mut self, value: Vec<ComponentVariable>) -> Self {
self.component_variable = Some(value);
self
}
#[must_use]
pub fn with_component_criteria(mut self, value: Vec<ComponentCriterion>) -> Self {
self.component_criteria = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetReportRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("componentVariable");
if let Some(value) = &self.component_variable {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("componentCriteria");
if let Some(value) = &self.component_criteria {
validate::list_len(value.len(), Some(1), Some(4), path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetReportRequest {}
impl Request for GetReportRequest {
type Action = Action;
const ACTION: Action = Action::GetReport;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetReportResponse;
}
impl Confirmed for GetReportRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetReportResponse {
pub status: GenericDeviceModelStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetReportResponse {
#[must_use]
pub fn new(status: GenericDeviceModelStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetReportResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetReportResponse {}
impl Response for GetReportResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct GetTransactionStatusRequest {
#[serde(rename = "transactionId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetTransactionStatusRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
self.transaction_id = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetTransactionStatusRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("transactionId");
if let Some(value) = &self.transaction_id {
validate::string(value.as_str(), None, Some(36), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetTransactionStatusRequest {}
impl Request for GetTransactionStatusRequest {
type Action = Action;
const ACTION: Action = Action::GetTransactionStatus;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetTransactionStatusResponse;
}
impl Confirmed for GetTransactionStatusRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetTransactionStatusResponse {
#[serde(rename = "messagesInQueue")]
pub messages_in_queue: bool,
#[serde(rename = "ongoingIndicator")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ongoing_indicator: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetTransactionStatusResponse {
#[must_use]
pub fn new(messages_in_queue: bool) -> Self {
Self {
messages_in_queue,
ongoing_indicator: None,
custom_data: None,
}
}
#[must_use]
pub fn with_ongoing_indicator(mut self, value: bool) -> Self {
self.ongoing_indicator = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetTransactionStatusResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetTransactionStatusResponse {}
impl Response for GetTransactionStatusResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetVariablesRequest {
#[serde(rename = "getVariableData")]
pub get_variable_data: Vec<GetVariableData>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetVariablesRequest {
#[must_use]
pub fn new(get_variable_data: Vec<GetVariableData>) -> Self {
Self {
get_variable_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetVariablesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("getVariableData");
validate::list_len(self.get_variable_data.len(), Some(1), None, path, out);
for (index, item) in self.get_variable_data.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetVariablesRequest {}
impl Request for GetVariablesRequest {
type Action = Action;
const ACTION: Action = Action::GetVariables;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = GetVariablesResponse;
}
impl Confirmed for GetVariablesRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetVariablesResponse {
#[serde(rename = "getVariableResult")]
pub get_variable_result: Vec<GetVariableResult>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl GetVariablesResponse {
#[must_use]
pub fn new(get_variable_result: Vec<GetVariableResult>) -> Self {
Self {
get_variable_result,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for GetVariablesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("getVariableResult");
validate::list_len(self.get_variable_result.len(), Some(1), None, path, out);
for (index, item) in self.get_variable_result.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for GetVariablesResponse {}
impl Response for GetVariablesResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct HeartbeatRequest {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl HeartbeatRequest {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for HeartbeatRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for HeartbeatRequest {}
impl Request for HeartbeatRequest {
type Action = Action;
const ACTION: Action = Action::Heartbeat;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = HeartbeatResponse;
}
impl Confirmed for HeartbeatRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct HeartbeatResponse {
#[serde(rename = "currentTime")]
pub current_time: crate::types::DateTime,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl HeartbeatResponse {
#[must_use]
pub fn new(current_time: impl Into<crate::types::DateTime>) -> Self {
Self {
current_time: current_time.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for HeartbeatResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for HeartbeatResponse {}
impl Response for HeartbeatResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InstallCertificateRequest {
#[serde(rename = "certificateType")]
pub certificate_type: InstallCertificateUse,
pub certificate: String,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl InstallCertificateRequest {
#[must_use]
pub fn new(certificate_type: InstallCertificateUse, certificate: impl Into<String>) -> Self {
Self {
certificate_type,
certificate: certificate.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for InstallCertificateRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("certificateType");
Validate::validate_at(&self.certificate_type, path, out);
path.pop();
path.push_key("certificate");
validate::string(self.certificate.as_str(), None, Some(5500), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for InstallCertificateRequest {}
impl Request for InstallCertificateRequest {
type Action = Action;
const ACTION: Action = Action::InstallCertificate;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = InstallCertificateResponse;
}
impl Confirmed for InstallCertificateRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InstallCertificateResponse {
pub status: InstallCertificateStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl InstallCertificateResponse {
#[must_use]
pub fn new(status: InstallCertificateStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for InstallCertificateResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for InstallCertificateResponse {}
impl Response for InstallCertificateResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogStatusNotificationRequest {
pub status: UploadLogStatus,
#[serde(rename = "requestId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub request_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl LogStatusNotificationRequest {
#[must_use]
pub fn new(status: UploadLogStatus) -> Self {
Self {
status,
request_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_request_id(mut self, value: i32) -> Self {
self.request_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for LogStatusNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for LogStatusNotificationRequest {}
impl Request for LogStatusNotificationRequest {
type Action = Action;
const ACTION: Action = Action::LogStatusNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = LogStatusNotificationResponse;
}
impl Confirmed for LogStatusNotificationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct LogStatusNotificationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl LogStatusNotificationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for LogStatusNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for LogStatusNotificationResponse {}
impl Response for LogStatusNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MeterValuesRequest {
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "meterValue")]
pub meter_value: Vec<MeterValue>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl MeterValuesRequest {
#[must_use]
pub fn new(evse_id: i32, meter_value: Vec<MeterValue>) -> Self {
Self {
evse_id,
meter_value,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for MeterValuesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("meterValue");
validate::list_len(self.meter_value.len(), Some(1), None, path, out);
for (index, item) in self.meter_value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for MeterValuesRequest {}
impl Request for MeterValuesRequest {
type Action = Action;
const ACTION: Action = Action::MeterValues;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = MeterValuesResponse;
}
impl Confirmed for MeterValuesRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct MeterValuesResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl MeterValuesResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for MeterValuesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for MeterValuesResponse {}
impl Response for MeterValuesResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyChargingLimitRequest {
#[serde(rename = "chargingLimit")]
pub charging_limit: ChargingLimit,
#[serde(rename = "chargingSchedule")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub charging_schedule: Option<Vec<ChargingSchedule>>,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyChargingLimitRequest {
#[must_use]
pub fn new(charging_limit: ChargingLimit) -> Self {
Self {
charging_limit,
charging_schedule: None,
evse_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_charging_schedule(mut self, value: Vec<ChargingSchedule>) -> Self {
self.charging_schedule = Some(value);
self
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyChargingLimitRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingLimit");
Validate::validate_at(&self.charging_limit, path, out);
path.pop();
path.push_key("chargingSchedule");
if let Some(value) = &self.charging_schedule {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyChargingLimitRequest {}
impl Request for NotifyChargingLimitRequest {
type Action = Action;
const ACTION: Action = Action::NotifyChargingLimit;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyChargingLimitResponse;
}
impl Confirmed for NotifyChargingLimitRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyChargingLimitResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyChargingLimitResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyChargingLimitResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyChargingLimitResponse {}
impl Response for NotifyChargingLimitResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyCustomerInformationRequest {
pub data: String,
#[serde(rename = "seqNo")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub seq_no: i32,
#[serde(rename = "generatedAt")]
pub generated_at: crate::types::DateTime,
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyCustomerInformationRequest {
#[must_use]
pub fn new(
data: impl Into<String>,
seq_no: i32,
generated_at: impl Into<crate::types::DateTime>,
request_id: i32,
) -> Self {
Self {
data: data.into(),
seq_no,
generated_at: generated_at.into(),
request_id,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyCustomerInformationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("data");
validate::string(self.data.as_str(), None, Some(512), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyCustomerInformationRequest {}
impl Request for NotifyCustomerInformationRequest {
type Action = Action;
const ACTION: Action = Action::NotifyCustomerInformation;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyCustomerInformationResponse;
}
impl Confirmed for NotifyCustomerInformationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyCustomerInformationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyCustomerInformationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyCustomerInformationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyCustomerInformationResponse {}
impl Response for NotifyCustomerInformationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyDisplayMessagesRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "messageInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub message_info: Option<Vec<MessageInfo>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyDisplayMessagesRequest {
#[must_use]
pub fn new(request_id: i32) -> Self {
Self {
request_id,
message_info: None,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_message_info(mut self, value: Vec<MessageInfo>) -> Self {
self.message_info = Some(value);
self
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyDisplayMessagesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("messageInfo");
if let Some(value) = &self.message_info {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyDisplayMessagesRequest {}
impl Request for NotifyDisplayMessagesRequest {
type Action = Action;
const ACTION: Action = Action::NotifyDisplayMessages;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyDisplayMessagesResponse;
}
impl Confirmed for NotifyDisplayMessagesRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyDisplayMessagesResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyDisplayMessagesResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyDisplayMessagesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyDisplayMessagesResponse {}
impl Response for NotifyDisplayMessagesResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyEVChargingNeedsRequest {
#[serde(rename = "chargingNeeds")]
pub charging_needs: ChargingNeeds,
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "maxScheduleTuples")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub max_schedule_tuples: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEVChargingNeedsRequest {
#[must_use]
pub fn new(charging_needs: ChargingNeeds, evse_id: i32) -> Self {
Self {
charging_needs,
evse_id,
max_schedule_tuples: None,
custom_data: None,
}
}
#[must_use]
pub fn with_max_schedule_tuples(mut self, value: i32) -> Self {
self.max_schedule_tuples = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEVChargingNeedsRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingNeeds");
Validate::validate_at(&self.charging_needs, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEVChargingNeedsRequest {}
impl Request for NotifyEVChargingNeedsRequest {
type Action = Action;
const ACTION: Action = Action::NotifyEVChargingNeeds;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyEVChargingNeedsResponse;
}
impl Confirmed for NotifyEVChargingNeedsRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyEVChargingNeedsResponse {
pub status: NotifyEVChargingNeedsStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEVChargingNeedsResponse {
#[must_use]
pub fn new(status: NotifyEVChargingNeedsStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEVChargingNeedsResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEVChargingNeedsResponse {}
impl Response for NotifyEVChargingNeedsResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyEVChargingScheduleRequest {
#[serde(rename = "timeBase")]
pub time_base: crate::types::DateTime,
#[serde(rename = "chargingSchedule")]
pub charging_schedule: ChargingSchedule,
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEVChargingScheduleRequest {
#[must_use]
pub fn new(
time_base: impl Into<crate::types::DateTime>,
charging_schedule: ChargingSchedule,
evse_id: i32,
) -> Self {
Self {
time_base: time_base.into(),
charging_schedule,
evse_id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEVChargingScheduleRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingSchedule");
Validate::validate_at(&self.charging_schedule, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEVChargingScheduleRequest {}
impl Request for NotifyEVChargingScheduleRequest {
type Action = Action;
const ACTION: Action = Action::NotifyEVChargingSchedule;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyEVChargingScheduleResponse;
}
impl Confirmed for NotifyEVChargingScheduleRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyEVChargingScheduleResponse {
pub status: GenericStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEVChargingScheduleResponse {
#[must_use]
pub fn new(status: GenericStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEVChargingScheduleResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEVChargingScheduleResponse {}
impl Response for NotifyEVChargingScheduleResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyEventRequest {
#[serde(rename = "generatedAt")]
pub generated_at: crate::types::DateTime,
#[serde(rename = "seqNo")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub seq_no: i32,
#[serde(rename = "eventData")]
pub event_data: Vec<EventData>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEventRequest {
#[must_use]
pub fn new(
generated_at: impl Into<crate::types::DateTime>,
seq_no: i32,
event_data: Vec<EventData>,
) -> Self {
Self {
generated_at: generated_at.into(),
seq_no,
event_data,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEventRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("eventData");
validate::list_len(self.event_data.len(), Some(1), None, path, out);
for (index, item) in self.event_data.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEventRequest {}
impl Request for NotifyEventRequest {
type Action = Action;
const ACTION: Action = Action::NotifyEvent;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyEventResponse;
}
impl Confirmed for NotifyEventRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyEventResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyEventResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyEventResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyEventResponse {}
impl Response for NotifyEventResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyMonitoringReportRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "seqNo")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub seq_no: i32,
#[serde(rename = "generatedAt")]
pub generated_at: crate::types::DateTime,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub monitor: Option<Vec<MonitoringData>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyMonitoringReportRequest {
#[must_use]
pub fn new(
request_id: i32,
seq_no: i32,
generated_at: impl Into<crate::types::DateTime>,
) -> Self {
Self {
request_id,
seq_no,
generated_at: generated_at.into(),
monitor: None,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_monitor(mut self, value: Vec<MonitoringData>) -> Self {
self.monitor = Some(value);
self
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyMonitoringReportRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("monitor");
if let Some(value) = &self.monitor {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyMonitoringReportRequest {}
impl Request for NotifyMonitoringReportRequest {
type Action = Action;
const ACTION: Action = Action::NotifyMonitoringReport;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyMonitoringReportResponse;
}
impl Confirmed for NotifyMonitoringReportRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyMonitoringReportResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyMonitoringReportResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyMonitoringReportResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyMonitoringReportResponse {}
impl Response for NotifyMonitoringReportResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct NotifyReportRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "generatedAt")]
pub generated_at: crate::types::DateTime,
#[serde(rename = "seqNo")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub seq_no: i32,
#[serde(rename = "reportData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub report_data: Option<Vec<ReportData>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyReportRequest {
#[must_use]
pub fn new(
request_id: i32,
generated_at: impl Into<crate::types::DateTime>,
seq_no: i32,
) -> Self {
Self {
request_id,
generated_at: generated_at.into(),
seq_no,
report_data: None,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_report_data(mut self, value: Vec<ReportData>) -> Self {
self.report_data = Some(value);
self
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyReportRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("reportData");
if let Some(value) = &self.report_data {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyReportRequest {}
impl Request for NotifyReportRequest {
type Action = Action;
const ACTION: Action = Action::NotifyReport;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = NotifyReportResponse;
}
impl Confirmed for NotifyReportRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct NotifyReportResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl NotifyReportResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for NotifyReportResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for NotifyReportResponse {}
impl Response for NotifyReportResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PublishFirmwareRequest {
pub location: String,
pub checksum: String,
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retries: Option<i32>,
#[serde(rename = "retryInterval")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retry_interval: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl PublishFirmwareRequest {
#[must_use]
pub fn new(location: impl Into<String>, checksum: impl Into<String>, request_id: i32) -> Self {
Self {
location: location.into(),
checksum: checksum.into(),
request_id,
retries: None,
retry_interval: None,
custom_data: None,
}
}
#[must_use]
pub fn with_retries(mut self, value: i32) -> Self {
self.retries = Some(value);
self
}
#[must_use]
pub fn with_retry_interval(mut self, value: i32) -> Self {
self.retry_interval = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for PublishFirmwareRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("location");
validate::string(self.location.as_str(), None, Some(512), path, out);
path.pop();
path.push_key("checksum");
validate::string(self.checksum.as_str(), None, Some(32), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for PublishFirmwareRequest {}
impl Request for PublishFirmwareRequest {
type Action = Action;
const ACTION: Action = Action::PublishFirmware;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = PublishFirmwareResponse;
}
impl Confirmed for PublishFirmwareRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PublishFirmwareResponse {
pub status: GenericStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl PublishFirmwareResponse {
#[must_use]
pub fn new(status: GenericStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for PublishFirmwareResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for PublishFirmwareResponse {}
impl Response for PublishFirmwareResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PublishFirmwareStatusNotificationRequest {
pub status: PublishFirmwareStatus,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub location: Option<Vec<String>>,
#[serde(rename = "requestId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub request_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl PublishFirmwareStatusNotificationRequest {
#[must_use]
pub fn new(status: PublishFirmwareStatus) -> Self {
Self {
status,
location: None,
request_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_location(mut self, value: impl IntoIterator<Item = impl Into<String>>) -> Self {
self.location = Some(value.into_iter().map(Into::into).collect());
self
}
#[must_use]
pub fn with_request_id(mut self, value: i32) -> Self {
self.request_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for PublishFirmwareStatusNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("location");
if let Some(value) = &self.location {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
validate::string(item.as_str(), None, Some(512), path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for PublishFirmwareStatusNotificationRequest {}
impl Request for PublishFirmwareStatusNotificationRequest {
type Action = Action;
const ACTION: Action = Action::PublishFirmwareStatusNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = PublishFirmwareStatusNotificationResponse;
}
impl Confirmed for PublishFirmwareStatusNotificationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct PublishFirmwareStatusNotificationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl PublishFirmwareStatusNotificationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for PublishFirmwareStatusNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for PublishFirmwareStatusNotificationResponse {}
impl Response for PublishFirmwareStatusNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReportChargingProfilesRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
#[serde(rename = "chargingLimitSource")]
pub charging_limit_source: ChargingLimitSource,
#[serde(rename = "chargingProfile")]
pub charging_profile: Vec<ChargingProfile>,
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tbc: Option<bool>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReportChargingProfilesRequest {
#[must_use]
pub fn new(
request_id: i32,
charging_limit_source: ChargingLimitSource,
charging_profile: Vec<ChargingProfile>,
evse_id: i32,
) -> Self {
Self {
request_id,
charging_limit_source,
charging_profile,
evse_id,
tbc: None,
custom_data: None,
}
}
#[must_use]
pub fn with_tbc(mut self, value: bool) -> Self {
self.tbc = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReportChargingProfilesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingLimitSource");
Validate::validate_at(&self.charging_limit_source, path, out);
path.pop();
path.push_key("chargingProfile");
validate::list_len(self.charging_profile.len(), Some(1), None, path, out);
for (index, item) in self.charging_profile.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReportChargingProfilesRequest {}
impl Request for ReportChargingProfilesRequest {
type Action = Action;
const ACTION: Action = Action::ReportChargingProfiles;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = ReportChargingProfilesResponse;
}
impl Confirmed for ReportChargingProfilesRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ReportChargingProfilesResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReportChargingProfilesResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReportChargingProfilesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReportChargingProfilesResponse {}
impl Response for ReportChargingProfilesResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestStartTransactionRequest {
#[serde(rename = "idToken")]
pub id_token: IdToken,
#[serde(rename = "remoteStartId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub remote_start_id: i32,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "groupIdToken")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub group_id_token: Option<IdToken>,
#[serde(rename = "chargingProfile")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub charging_profile: Option<ChargingProfile>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl RequestStartTransactionRequest {
#[must_use]
pub fn new(id_token: IdToken, remote_start_id: i32) -> Self {
Self {
id_token,
remote_start_id,
evse_id: None,
group_id_token: None,
charging_profile: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_group_id_token(mut self, value: IdToken) -> Self {
self.group_id_token = Some(value);
self
}
#[must_use]
pub fn with_charging_profile(mut self, value: ChargingProfile) -> Self {
self.charging_profile = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for RequestStartTransactionRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("idToken");
Validate::validate_at(&self.id_token, path, out);
path.pop();
path.push_key("groupIdToken");
if let Some(value) = &self.group_id_token {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("chargingProfile");
if let Some(value) = &self.charging_profile {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for RequestStartTransactionRequest {}
impl Request for RequestStartTransactionRequest {
type Action = Action;
const ACTION: Action = Action::RequestStartTransaction;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = RequestStartTransactionResponse;
}
impl Confirmed for RequestStartTransactionRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestStartTransactionResponse {
pub status: RequestStartStopStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "transactionId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub transaction_id: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl RequestStartTransactionResponse {
#[must_use]
pub fn new(status: RequestStartStopStatus) -> Self {
Self {
status,
status_info: None,
transaction_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_transaction_id(mut self, value: impl Into<String>) -> Self {
self.transaction_id = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for RequestStartTransactionResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("transactionId");
if let Some(value) = &self.transaction_id {
validate::string(value.as_str(), None, Some(36), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for RequestStartTransactionResponse {}
impl Response for RequestStartTransactionResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestStopTransactionRequest {
#[serde(rename = "transactionId")]
pub transaction_id: String,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl RequestStopTransactionRequest {
#[must_use]
pub fn new(transaction_id: impl Into<String>) -> Self {
Self {
transaction_id: transaction_id.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for RequestStopTransactionRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("transactionId");
validate::string(self.transaction_id.as_str(), None, Some(36), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for RequestStopTransactionRequest {}
impl Request for RequestStopTransactionRequest {
type Action = Action;
const ACTION: Action = Action::RequestStopTransaction;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = RequestStopTransactionResponse;
}
impl Confirmed for RequestStopTransactionRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct RequestStopTransactionResponse {
pub status: RequestStartStopStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl RequestStopTransactionResponse {
#[must_use]
pub fn new(status: RequestStartStopStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for RequestStopTransactionResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for RequestStopTransactionResponse {}
impl Response for RequestStopTransactionResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReservationStatusUpdateRequest {
#[serde(rename = "reservationId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub reservation_id: i32,
#[serde(rename = "reservationUpdateStatus")]
pub reservation_update_status: ReservationUpdateStatus,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReservationStatusUpdateRequest {
#[must_use]
pub fn new(reservation_id: i32, reservation_update_status: ReservationUpdateStatus) -> Self {
Self {
reservation_id,
reservation_update_status,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReservationStatusUpdateRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("reservationUpdateStatus");
Validate::validate_at(&self.reservation_update_status, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReservationStatusUpdateRequest {}
impl Request for ReservationStatusUpdateRequest {
type Action = Action;
const ACTION: Action = Action::ReservationStatusUpdate;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = ReservationStatusUpdateResponse;
}
impl Confirmed for ReservationStatusUpdateRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ReservationStatusUpdateResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReservationStatusUpdateResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReservationStatusUpdateResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReservationStatusUpdateResponse {}
impl Response for ReservationStatusUpdateResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReserveNowRequest {
#[serde(deserialize_with = "crate::types::integer::one")]
pub id: i32,
#[serde(rename = "expiryDateTime")]
pub expiry_date_time: crate::types::DateTime,
#[serde(rename = "idToken")]
pub id_token: IdToken,
#[serde(rename = "connectorType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub connector_type: Option<Connector>,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "groupIdToken")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub group_id_token: Option<IdToken>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReserveNowRequest {
#[must_use]
pub fn new(
id: i32,
expiry_date_time: impl Into<crate::types::DateTime>,
id_token: IdToken,
) -> Self {
Self {
id,
expiry_date_time: expiry_date_time.into(),
id_token,
connector_type: None,
evse_id: None,
group_id_token: None,
custom_data: None,
}
}
#[must_use]
pub fn with_connector_type(mut self, value: Connector) -> Self {
self.connector_type = Some(value);
self
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_group_id_token(mut self, value: IdToken) -> Self {
self.group_id_token = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReserveNowRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("idToken");
Validate::validate_at(&self.id_token, path, out);
path.pop();
path.push_key("connectorType");
if let Some(value) = &self.connector_type {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("groupIdToken");
if let Some(value) = &self.group_id_token {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReserveNowRequest {}
impl Request for ReserveNowRequest {
type Action = Action;
const ACTION: Action = Action::ReserveNow;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ReserveNowResponse;
}
impl Confirmed for ReserveNowRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReserveNowResponse {
pub status: ReserveNowStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ReserveNowResponse {
#[must_use]
pub fn new(status: ReserveNowStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ReserveNowResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ReserveNowResponse {}
impl Response for ReserveNowResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResetRequest {
pub r#type: ResetEnum,
#[serde(rename = "evseId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub evse_id: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ResetRequest {
#[must_use]
pub fn new(r#type: ResetEnum) -> Self {
Self {
r#type,
evse_id: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse_id(mut self, value: i32) -> Self {
self.evse_id = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ResetRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("type");
Validate::validate_at(&self.r#type, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ResetRequest {}
impl Request for ResetRequest {
type Action = Action;
const ACTION: Action = Action::Reset;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = ResetResponse;
}
impl Confirmed for ResetRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResetResponse {
pub status: ResetStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl ResetResponse {
#[must_use]
pub fn new(status: ResetStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for ResetResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for ResetResponse {}
impl Response for ResetResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SecurityEventNotificationRequest {
pub r#type: String,
pub timestamp: crate::types::DateTime,
#[serde(rename = "techInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tech_info: Option<String>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SecurityEventNotificationRequest {
#[must_use]
pub fn new(r#type: impl Into<String>, timestamp: impl Into<crate::types::DateTime>) -> Self {
Self {
r#type: r#type.into(),
timestamp: timestamp.into(),
tech_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_tech_info(mut self, value: impl Into<String>) -> Self {
self.tech_info = Some(value.into());
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SecurityEventNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("type");
validate::string(self.r#type.as_str(), None, Some(50), path, out);
path.pop();
path.push_key("techInfo");
if let Some(value) = &self.tech_info {
validate::string(value.as_str(), None, Some(255), path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SecurityEventNotificationRequest {}
impl Request for SecurityEventNotificationRequest {
type Action = Action;
const ACTION: Action = Action::SecurityEventNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = SecurityEventNotificationResponse;
}
impl Confirmed for SecurityEventNotificationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct SecurityEventNotificationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SecurityEventNotificationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SecurityEventNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SecurityEventNotificationResponse {}
impl Response for SecurityEventNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendLocalListRequest {
#[serde(rename = "versionNumber")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub version_number: i32,
#[serde(rename = "updateType")]
pub update_type: Update,
#[serde(rename = "localAuthorizationList")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub local_authorization_list: Option<Vec<AuthorizationData>>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SendLocalListRequest {
#[must_use]
pub fn new(version_number: i32, update_type: Update) -> Self {
Self {
version_number,
update_type,
local_authorization_list: None,
custom_data: None,
}
}
#[must_use]
pub fn with_local_authorization_list(mut self, value: Vec<AuthorizationData>) -> Self {
self.local_authorization_list = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SendLocalListRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("updateType");
Validate::validate_at(&self.update_type, path, out);
path.pop();
path.push_key("localAuthorizationList");
if let Some(value) = &self.local_authorization_list {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SendLocalListRequest {}
impl Request for SendLocalListRequest {
type Action = Action;
const ACTION: Action = Action::SendLocalList;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SendLocalListResponse;
}
impl Confirmed for SendLocalListRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SendLocalListResponse {
pub status: SendLocalListStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SendLocalListResponse {
#[must_use]
pub fn new(status: SendLocalListStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SendLocalListResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SendLocalListResponse {}
impl Response for SendLocalListResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetChargingProfileRequest {
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "chargingProfile")]
pub charging_profile: ChargingProfile,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetChargingProfileRequest {
#[must_use]
pub fn new(evse_id: i32, charging_profile: ChargingProfile) -> Self {
Self {
evse_id,
charging_profile,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetChargingProfileRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("chargingProfile");
Validate::validate_at(&self.charging_profile, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetChargingProfileRequest {}
impl Request for SetChargingProfileRequest {
type Action = Action;
const ACTION: Action = Action::SetChargingProfile;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetChargingProfileResponse;
}
impl Confirmed for SetChargingProfileRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetChargingProfileResponse {
pub status: ChargingProfileStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetChargingProfileResponse {
#[must_use]
pub fn new(status: ChargingProfileStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetChargingProfileResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetChargingProfileResponse {}
impl Response for SetChargingProfileResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetDisplayMessageRequest {
pub message: MessageInfo,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetDisplayMessageRequest {
#[must_use]
pub fn new(message: MessageInfo) -> Self {
Self {
message,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetDisplayMessageRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("message");
Validate::validate_at(&self.message, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetDisplayMessageRequest {}
impl Request for SetDisplayMessageRequest {
type Action = Action;
const ACTION: Action = Action::SetDisplayMessage;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetDisplayMessageResponse;
}
impl Confirmed for SetDisplayMessageRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetDisplayMessageResponse {
pub status: DisplayMessageStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetDisplayMessageResponse {
#[must_use]
pub fn new(status: DisplayMessageStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetDisplayMessageResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetDisplayMessageResponse {}
impl Response for SetDisplayMessageResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetMonitoringBaseRequest {
#[serde(rename = "monitoringBase")]
pub monitoring_base: MonitoringBase,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetMonitoringBaseRequest {
#[must_use]
pub fn new(monitoring_base: MonitoringBase) -> Self {
Self {
monitoring_base,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetMonitoringBaseRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("monitoringBase");
Validate::validate_at(&self.monitoring_base, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetMonitoringBaseRequest {}
impl Request for SetMonitoringBaseRequest {
type Action = Action;
const ACTION: Action = Action::SetMonitoringBase;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetMonitoringBaseResponse;
}
impl Confirmed for SetMonitoringBaseRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetMonitoringBaseResponse {
pub status: GenericDeviceModelStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetMonitoringBaseResponse {
#[must_use]
pub fn new(status: GenericDeviceModelStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetMonitoringBaseResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetMonitoringBaseResponse {}
impl Response for SetMonitoringBaseResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetMonitoringLevelRequest {
#[serde(deserialize_with = "crate::types::integer::one")]
pub severity: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetMonitoringLevelRequest {
#[must_use]
pub fn new(severity: i32) -> Self {
Self {
severity,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetMonitoringLevelRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetMonitoringLevelRequest {}
impl Request for SetMonitoringLevelRequest {
type Action = Action;
const ACTION: Action = Action::SetMonitoringLevel;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetMonitoringLevelResponse;
}
impl Confirmed for SetMonitoringLevelRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetMonitoringLevelResponse {
pub status: GenericStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetMonitoringLevelResponse {
#[must_use]
pub fn new(status: GenericStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetMonitoringLevelResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetMonitoringLevelResponse {}
impl Response for SetMonitoringLevelResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetNetworkProfileRequest {
#[serde(rename = "configurationSlot")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub configuration_slot: i32,
#[serde(rename = "connectionData")]
pub connection_data: NetworkConnectionProfile,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetNetworkProfileRequest {
#[must_use]
pub fn new(configuration_slot: i32, connection_data: NetworkConnectionProfile) -> Self {
Self {
configuration_slot,
connection_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetNetworkProfileRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("connectionData");
Validate::validate_at(&self.connection_data, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetNetworkProfileRequest {}
impl Request for SetNetworkProfileRequest {
type Action = Action;
const ACTION: Action = Action::SetNetworkProfile;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetNetworkProfileResponse;
}
impl Confirmed for SetNetworkProfileRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetNetworkProfileResponse {
pub status: SetNetworkProfileStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetNetworkProfileResponse {
#[must_use]
pub fn new(status: SetNetworkProfileStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetNetworkProfileResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetNetworkProfileResponse {}
impl Response for SetNetworkProfileResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetVariableMonitoringRequest {
#[serde(rename = "setMonitoringData")]
pub set_monitoring_data: Vec<SetMonitoringData>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetVariableMonitoringRequest {
#[must_use]
pub fn new(set_monitoring_data: Vec<SetMonitoringData>) -> Self {
Self {
set_monitoring_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetVariableMonitoringRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("setMonitoringData");
validate::list_len(self.set_monitoring_data.len(), Some(1), None, path, out);
for (index, item) in self.set_monitoring_data.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetVariableMonitoringRequest {}
impl Request for SetVariableMonitoringRequest {
type Action = Action;
const ACTION: Action = Action::SetVariableMonitoring;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetVariableMonitoringResponse;
}
impl Confirmed for SetVariableMonitoringRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetVariableMonitoringResponse {
#[serde(rename = "setMonitoringResult")]
pub set_monitoring_result: Vec<SetMonitoringResult>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetVariableMonitoringResponse {
#[must_use]
pub fn new(set_monitoring_result: Vec<SetMonitoringResult>) -> Self {
Self {
set_monitoring_result,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetVariableMonitoringResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("setMonitoringResult");
validate::list_len(self.set_monitoring_result.len(), Some(1), None, path, out);
for (index, item) in self.set_monitoring_result.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetVariableMonitoringResponse {}
impl Response for SetVariableMonitoringResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetVariablesRequest {
#[serde(rename = "setVariableData")]
pub set_variable_data: Vec<SetVariableData>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetVariablesRequest {
#[must_use]
pub fn new(set_variable_data: Vec<SetVariableData>) -> Self {
Self {
set_variable_data,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetVariablesRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("setVariableData");
validate::list_len(self.set_variable_data.len(), Some(1), None, path, out);
for (index, item) in self.set_variable_data.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetVariablesRequest {}
impl Request for SetVariablesRequest {
type Action = Action;
const ACTION: Action = Action::SetVariables;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = SetVariablesResponse;
}
impl Confirmed for SetVariablesRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetVariablesResponse {
#[serde(rename = "setVariableResult")]
pub set_variable_result: Vec<SetVariableResult>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SetVariablesResponse {
#[must_use]
pub fn new(set_variable_result: Vec<SetVariableResult>) -> Self {
Self {
set_variable_result,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SetVariablesResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("setVariableResult");
validate::list_len(self.set_variable_result.len(), Some(1), None, path, out);
for (index, item) in self.set_variable_result.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SetVariablesResponse {}
impl Response for SetVariablesResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SignCertificateRequest {
pub csr: String,
#[serde(rename = "certificateType")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub certificate_type: Option<CertificateSigningUse>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SignCertificateRequest {
#[must_use]
pub fn new(csr: impl Into<String>) -> Self {
Self {
csr: csr.into(),
certificate_type: None,
custom_data: None,
}
}
#[must_use]
pub fn with_certificate_type(mut self, value: CertificateSigningUse) -> Self {
self.certificate_type = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SignCertificateRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("csr");
validate::string(self.csr.as_str(), None, Some(5500), path, out);
path.pop();
path.push_key("certificateType");
if let Some(value) = &self.certificate_type {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SignCertificateRequest {}
impl Request for SignCertificateRequest {
type Action = Action;
const ACTION: Action = Action::SignCertificate;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = SignCertificateResponse;
}
impl Confirmed for SignCertificateRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SignCertificateResponse {
pub status: GenericStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl SignCertificateResponse {
#[must_use]
pub fn new(status: GenericStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for SignCertificateResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for SignCertificateResponse {}
impl Response for SignCertificateResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct StatusNotificationRequest {
pub timestamp: crate::types::DateTime,
#[serde(rename = "connectorStatus")]
pub connector_status: ConnectorStatus,
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "connectorId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub connector_id: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl StatusNotificationRequest {
#[must_use]
pub fn new(
timestamp: impl Into<crate::types::DateTime>,
connector_status: ConnectorStatus,
evse_id: i32,
connector_id: i32,
) -> Self {
Self {
timestamp: timestamp.into(),
connector_status,
evse_id,
connector_id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for StatusNotificationRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("connectorStatus");
Validate::validate_at(&self.connector_status, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for StatusNotificationRequest {}
impl Request for StatusNotificationRequest {
type Action = Action;
const ACTION: Action = Action::StatusNotification;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = StatusNotificationResponse;
}
impl Confirmed for StatusNotificationRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct StatusNotificationResponse {
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl StatusNotificationResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for StatusNotificationResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for StatusNotificationResponse {}
impl Response for StatusNotificationResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionEventRequest {
#[serde(rename = "eventType")]
pub event_type: TransactionEventEnum,
pub timestamp: crate::types::DateTime,
#[serde(rename = "triggerReason")]
pub trigger_reason: TriggerReason,
#[serde(rename = "seqNo")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub seq_no: i32,
#[serde(rename = "transactionInfo")]
pub transaction_info: Transaction,
#[serde(rename = "meterValue")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub meter_value: Option<Vec<MeterValue>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub offline: Option<bool>,
#[serde(rename = "numberOfPhasesUsed")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub number_of_phases_used: Option<i32>,
#[serde(rename = "cableMaxCurrent")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub cable_max_current: Option<i32>,
#[serde(rename = "reservationId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub reservation_id: Option<i32>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub evse: Option<EVSE>,
#[serde(rename = "idToken")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id_token: Option<IdToken>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl TransactionEventRequest {
#[must_use]
pub fn new(
event_type: TransactionEventEnum,
timestamp: impl Into<crate::types::DateTime>,
trigger_reason: TriggerReason,
seq_no: i32,
transaction_info: Transaction,
) -> Self {
Self {
event_type,
timestamp: timestamp.into(),
trigger_reason,
seq_no,
transaction_info,
meter_value: None,
offline: None,
number_of_phases_used: None,
cable_max_current: None,
reservation_id: None,
evse: None,
id_token: None,
custom_data: None,
}
}
#[must_use]
pub fn with_meter_value(mut self, value: Vec<MeterValue>) -> Self {
self.meter_value = Some(value);
self
}
#[must_use]
pub fn with_offline(mut self, value: bool) -> Self {
self.offline = Some(value);
self
}
#[must_use]
pub fn with_number_of_phases_used(mut self, value: i32) -> Self {
self.number_of_phases_used = Some(value);
self
}
#[must_use]
pub fn with_cable_max_current(mut self, value: i32) -> Self {
self.cable_max_current = Some(value);
self
}
#[must_use]
pub fn with_reservation_id(mut self, value: i32) -> Self {
self.reservation_id = Some(value);
self
}
#[must_use]
pub fn with_evse(mut self, value: EVSE) -> Self {
self.evse = Some(value);
self
}
#[must_use]
pub fn with_id_token(mut self, value: IdToken) -> Self {
self.id_token = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for TransactionEventRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("eventType");
Validate::validate_at(&self.event_type, path, out);
path.pop();
path.push_key("triggerReason");
Validate::validate_at(&self.trigger_reason, path, out);
path.pop();
path.push_key("transactionInfo");
Validate::validate_at(&self.transaction_info, path, out);
path.pop();
path.push_key("meterValue");
if let Some(value) = &self.meter_value {
validate::list_len(value.len(), Some(1), None, path, out);
for (index, item) in value.iter().enumerate() {
path.push_index(index);
Validate::validate_at(item, path, out);
path.pop();
}
}
path.pop();
path.push_key("evse");
if let Some(value) = &self.evse {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("idToken");
if let Some(value) = &self.id_token {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for TransactionEventRequest {}
impl Request for TransactionEventRequest {
type Action = Action;
const ACTION: Action = Action::TransactionEvent;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::ChargingStation;
type Response = TransactionEventResponse;
}
impl Confirmed for TransactionEventRequest {}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct TransactionEventResponse {
#[serde(rename = "totalCost")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub total_cost: Option<crate::types::Decimal>,
#[serde(rename = "chargingPriority")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub charging_priority: Option<i32>,
#[serde(rename = "idTokenInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id_token_info: Option<IdTokenInfo>,
#[serde(rename = "updatedPersonalMessage")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub updated_personal_message: Option<MessageContent>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl TransactionEventResponse {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub fn with_total_cost(mut self, value: impl Into<crate::types::Decimal>) -> Self {
self.total_cost = Some(value.into());
self
}
#[must_use]
pub fn with_charging_priority(mut self, value: i32) -> Self {
self.charging_priority = Some(value);
self
}
#[must_use]
pub fn with_id_token_info(mut self, value: IdTokenInfo) -> Self {
self.id_token_info = Some(value);
self
}
#[must_use]
pub fn with_updated_personal_message(mut self, value: MessageContent) -> Self {
self.updated_personal_message = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for TransactionEventResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("idTokenInfo");
if let Some(value) = &self.id_token_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("updatedPersonalMessage");
if let Some(value) = &self.updated_personal_message {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for TransactionEventResponse {}
impl Response for TransactionEventResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TriggerMessageRequest {
#[serde(rename = "requestedMessage")]
pub requested_message: MessageTrigger,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub evse: Option<EVSE>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl TriggerMessageRequest {
#[must_use]
pub fn new(requested_message: MessageTrigger) -> Self {
Self {
requested_message,
evse: None,
custom_data: None,
}
}
#[must_use]
pub fn with_evse(mut self, value: EVSE) -> Self {
self.evse = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for TriggerMessageRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("requestedMessage");
Validate::validate_at(&self.requested_message, path, out);
path.pop();
path.push_key("evse");
if let Some(value) = &self.evse {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for TriggerMessageRequest {}
impl Request for TriggerMessageRequest {
type Action = Action;
const ACTION: Action = Action::TriggerMessage;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = TriggerMessageResponse;
}
impl Confirmed for TriggerMessageRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TriggerMessageResponse {
pub status: TriggerMessageStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl TriggerMessageResponse {
#[must_use]
pub fn new(status: TriggerMessageStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for TriggerMessageResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for TriggerMessageResponse {}
impl Response for TriggerMessageResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnlockConnectorRequest {
#[serde(rename = "evseId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub evse_id: i32,
#[serde(rename = "connectorId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub connector_id: i32,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UnlockConnectorRequest {
#[must_use]
pub fn new(evse_id: i32, connector_id: i32) -> Self {
Self {
evse_id,
connector_id,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UnlockConnectorRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UnlockConnectorRequest {}
impl Request for UnlockConnectorRequest {
type Action = Action;
const ACTION: Action = Action::UnlockConnector;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = UnlockConnectorResponse;
}
impl Confirmed for UnlockConnectorRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnlockConnectorResponse {
pub status: UnlockStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UnlockConnectorResponse {
#[must_use]
pub fn new(status: UnlockStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UnlockConnectorResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UnlockConnectorResponse {}
impl Response for UnlockConnectorResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnpublishFirmwareRequest {
pub checksum: String,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UnpublishFirmwareRequest {
#[must_use]
pub fn new(checksum: impl Into<String>) -> Self {
Self {
checksum: checksum.into(),
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UnpublishFirmwareRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("checksum");
validate::string(self.checksum.as_str(), None, Some(32), path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UnpublishFirmwareRequest {}
impl Request for UnpublishFirmwareRequest {
type Action = Action;
const ACTION: Action = Action::UnpublishFirmware;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = UnpublishFirmwareResponse;
}
impl Confirmed for UnpublishFirmwareRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UnpublishFirmwareResponse {
pub status: UnpublishFirmwareStatus,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UnpublishFirmwareResponse {
#[must_use]
pub fn new(status: UnpublishFirmwareStatus) -> Self {
Self {
status,
custom_data: None,
}
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UnpublishFirmwareResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UnpublishFirmwareResponse {}
impl Response for UnpublishFirmwareResponse {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateFirmwareRequest {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "crate::types::integer::one")]
pub request_id: i32,
pub firmware: Firmware,
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retries: Option<i32>,
#[serde(rename = "retryInterval")]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(deserialize_with = "crate::types::integer::option")]
pub retry_interval: Option<i32>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UpdateFirmwareRequest {
#[must_use]
pub fn new(request_id: i32, firmware: Firmware) -> Self {
Self {
request_id,
firmware,
retries: None,
retry_interval: None,
custom_data: None,
}
}
#[must_use]
pub fn with_retries(mut self, value: i32) -> Self {
self.retries = Some(value);
self
}
#[must_use]
pub fn with_retry_interval(mut self, value: i32) -> Self {
self.retry_interval = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UpdateFirmwareRequest {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("firmware");
Validate::validate_at(&self.firmware, path, out);
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UpdateFirmwareRequest {}
impl Request for UpdateFirmwareRequest {
type Action = Action;
const ACTION: Action = Action::UpdateFirmware;
const KIND: MessageKind = MessageKind::Call;
const ORIGIN: Origin = Origin::Csms;
type Response = UpdateFirmwareResponse;
}
impl Confirmed for UpdateFirmwareRequest {}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateFirmwareResponse {
pub status: UpdateFirmwareStatus,
#[serde(rename = "statusInfo")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status_info: Option<StatusInfo>,
#[serde(rename = "customData")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub custom_data: Option<crate::types::CustomData>,
}
impl UpdateFirmwareResponse {
#[must_use]
pub fn new(status: UpdateFirmwareStatus) -> Self {
Self {
status,
status_info: None,
custom_data: None,
}
}
#[must_use]
pub fn with_status_info(mut self, value: StatusInfo) -> Self {
self.status_info = Some(value);
self
}
#[must_use]
pub fn with_custom_data(mut self, value: crate::types::CustomData) -> Self {
self.custom_data = Some(value);
self
}
}
impl Validate for UpdateFirmwareResponse {
fn validate_at(&self, path: &mut ValidationPath, out: &mut Violations) {
path.push_key("status");
Validate::validate_at(&self.status, path, out);
path.pop();
path.push_key("statusInfo");
if let Some(value) = &self.status_info {
Validate::validate_at(value, path, out);
}
path.pop();
path.push_key("customData");
if let Some(value) = &self.custom_data {
Validate::validate_at(value, path, out);
}
path.pop();
}
}
impl Sealed for UpdateFirmwareResponse {}
impl Response for UpdateFirmwareResponse {}