Mercedes.VehicleManagement.API

<back to all web services

DashboardCsvReportsRequest

Reports
Requires Authentication
The following routes are available for this service:
POST/v1/reports/CsvRetrieve Report by ReportName and Filters and return as CSV
#![allow(
    dead_code,
    non_camel_case_types,
    non_snake_case,
    clippy::upper_case_acronyms
)]

use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct DashboardReportResult {
    #[serde(rename = "totalCount")]
    pub total_count: i32,
    #[serde(rename = "reportResult")]
    pub report_result: Vec<Value>,
}

#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
pub enum ReportFilterType {
    #[default]
    #[serde(rename = "list")]
    list,
    #[serde(rename = "list_like")]
    list_like,
    #[serde(rename = "date")]
    date,
    #[serde(rename = "range")]
    range,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct ReportFilter {
    pub r#type: ReportFilterType,
    pub values: Vec<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub start: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub end: Option<String>,
    #[serde(rename = "higherThan")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub higher_than: Option<i32>,
    #[serde(rename = "lowerThan")]
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lower_than: Option<i32>,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct DashboardCsvReportsRequest {
    /// Report Name
    // ApiMember(Description="Report Name", IsRequired=true, ParameterType="body")
    #[serde(rename = "reportName")]
    pub report_name: String,
    /// Filters
    // ApiMember(Description="Filters", IsRequired=true, ParameterType="body")
    pub filters: HashMap<String, ReportFilter>,
}

Rust DashboardCsvReportsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/reports/Csv HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"reportName":"String","filters":{"String":{"type":"list","start":"\/Date(-62135596800000-0000)\/","end":"\/Date(-62135596800000-0000)\/","higherThan":0,"lowerThan":0}}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"totalCount":0}