Mercedes.VehicleManagement.API

<back to all web services

DashboardReportRequest

Reports
Requires Authentication
The following routes are available for this service:
POST/v1/reportsRetrieve Report by ReportName and Filters
import 'package:servicestack/servicestack.dart';

class DashboardReportResult implements IConvertible
{
    int? totalCount;
    List<dynamic>? reportResult;

    DashboardReportResult({this.totalCount,this.reportResult});
    DashboardReportResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        totalCount = json['totalCount'];
        reportResult = JsonConverters.fromJson(json['reportResult'],'List<dynamic>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'totalCount': totalCount,
        'reportResult': JsonConverters.toJson(reportResult,'List<dynamic>',context!)
    };

    getTypeName() => "DashboardReportResult";
    TypeContext? context = _ctx;
}

enum ReportFilterType
{
    list,
    list_like,
    date,
    range,
}

class ReportFilter implements IConvertible
{
    ReportFilterType? type;
    List<String>? values;
    DateTime? start;
    DateTime? end;
    int? higherThan;
    int? lowerThan;

    ReportFilter({this.type,this.values,this.start,this.end,this.higherThan,this.lowerThan});
    ReportFilter.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        type = JsonConverters.fromJson(json['type'],'ReportFilterType',context!);
        values = JsonConverters.fromJson(json['values'],'List<String>',context!);
        start = JsonConverters.fromJson(json['start'],'DateTime',context!);
        end = JsonConverters.fromJson(json['end'],'DateTime',context!);
        higherThan = json['higherThan'];
        lowerThan = json['lowerThan'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'type': JsonConverters.toJson(type,'ReportFilterType',context!),
        'values': JsonConverters.toJson(values,'List<String>',context!),
        'start': JsonConverters.toJson(start,'DateTime',context!),
        'end': JsonConverters.toJson(end,'DateTime',context!),
        'higherThan': higherThan,
        'lowerThan': lowerThan
    };

    getTypeName() => "ReportFilter";
    TypeContext? context = _ctx;
}

class ReportsPaging implements IConvertible
{
    int? page;
    int? pageSize;

    ReportsPaging({this.page,this.pageSize});
    ReportsPaging.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        page = json['page'];
        pageSize = json['pageSize'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'page': page,
        'pageSize': pageSize
    };

    getTypeName() => "ReportsPaging";
    TypeContext? context = _ctx;
}

enum ReportSortType
{
    asc,
    desc,
}

class DashboardReportRequest implements IPost, IConvertible
{
    /**
    * Report Name
    */
    // @ApiMember(Description="Report Name", IsRequired=true, ParameterType="body")
    String? reportName;

    /**
    * Filters
    */
    // @ApiMember(Description="Filters", IsRequired=true, ParameterType="body")
    Map<String,ReportFilter?>? filters = {};

    /**
    * Paging
    */
    // @ApiMember(Description="Paging", ParameterType="body")
    ReportsPaging? paging;

    /**
    * Sorting
    */
    // @ApiMember(Description="Sorting", ParameterType="body")
    Map<String,ReportSortType?>? sorting = {};

    DashboardReportRequest({this.reportName,this.filters,this.paging,this.sorting});
    DashboardReportRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        reportName = json['reportName'];
        filters = JsonConverters.fromJson(json['filters'],'Map<String,ReportFilter?>',context!);
        paging = JsonConverters.fromJson(json['paging'],'ReportsPaging',context!);
        sorting = JsonConverters.fromJson(json['sorting'],'Map<String,ReportSortType?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'reportName': reportName,
        'filters': JsonConverters.toJson(filters,'Map<String,ReportFilter?>',context!),
        'paging': JsonConverters.toJson(paging,'ReportsPaging',context!),
        'sorting': JsonConverters.toJson(sorting,'Map<String,ReportSortType?>',context!)
    };

    getTypeName() => "DashboardReportRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'uat_api_vehicle_mgt_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
    'DashboardReportResult': TypeInfo(TypeOf.Class, create:() => DashboardReportResult()),
    'List<dynamic>': TypeInfo(TypeOf.Class, create:() => <dynamic>[]),
    'ReportFilterType': TypeInfo(TypeOf.Enum, enumValues:ReportFilterType.values),
    'ReportFilter': TypeInfo(TypeOf.Class, create:() => ReportFilter()),
    'ReportsPaging': TypeInfo(TypeOf.Class, create:() => ReportsPaging()),
    'ReportSortType': TypeInfo(TypeOf.Enum, enumValues:ReportSortType.values),
    'DashboardReportRequest': TypeInfo(TypeOf.Class, create:() => DashboardReportRequest()),
    'Map<String,ReportFilter?>': TypeInfo(TypeOf.Class, create:() => Map<String,ReportFilter?>()),
    'Map<String,ReportSortType?>': TypeInfo(TypeOf.Class, create:() => Map<String,ReportSortType?>()),
});

Dart DashboardReportRequest DTOs

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

HTTP + XML

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

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

<DashboardReportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.ServiceModel">
  <Filters xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringReportFilterI2Pv2xeL>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value xmlns:d4p1="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO">
        <d4p1:End>0001-01-01T00:00:00</d4p1:End>
        <d4p1:HigherThan>0</d4p1:HigherThan>
        <d4p1:LowerThan>0</d4p1:LowerThan>
        <d4p1:Start>0001-01-01T00:00:00</d4p1:Start>
        <d4p1:Type>list</d4p1:Type>
        <d4p1:Values i:nil="true" />
      </d2p1:Value>
    </d2p1:KeyValueOfstringReportFilterI2Pv2xeL>
  </Filters>
  <Paging xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO">
    <d2p1:Page>0</d2p1:Page>
    <d2p1:PageSize>0</d2p1:PageSize>
  </Paging>
  <ReportName>String</ReportName>
  <Sorting xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringReportSortTypeI2Pv2xeL>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>asc</d2p1:Value>
    </d2p1:KeyValueOfstringReportSortTypeI2Pv2xeL>
  </Sorting>
</DashboardReportRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DashboardReportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO">
  <ReportResult xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
  <TotalCount>0</TotalCount>
</DashboardReportResult>