| GET | /api/v1/devices |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
// @DataContract
class Device implements IConvertible
{
// @DataMember(Name="Guid")
String? Guid;
// @DataMember(Name="Geraetenummer")
String? Geraetenummer;
// @DataMember(Name="Bezeichnung")
String? Bezeichnung;
// @DataMember(Name="Beschreibung")
String? Beschreibung;
// @DataMember(Name="Einbaudatum")
DateTime? Einbaudatum;
// @DataMember(Name="Ausbaudatum")
DateTime? Ausbaudatum;
// @DataMember(Name="Eichdatum")
DateTime? Eichdatum;
// @DataMember(Name="Einheit")
String? Einheit;
// @DataMember(Name="Memo")
String? Memo;
// @DataMember(Name="DeviceCatalogGuid")
String? DeviceCatalogGuid;
Device({this.Guid,this.Geraetenummer,this.Bezeichnung,this.Beschreibung,this.Einbaudatum,this.Ausbaudatum,this.Eichdatum,this.Einheit,this.Memo,this.DeviceCatalogGuid});
Device.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Guid = json['guid'];
Geraetenummer = json['number'];
Bezeichnung = json['label'];
Beschreibung = json['description'];
Einbaudatum = JsonConverters.fromJson(json['installationDate'],'DateTime',context!);
Ausbaudatum = JsonConverters.fromJson(json['deinstallationDate'],'DateTime',context!);
Eichdatum = JsonConverters.fromJson(json['calibrationDate'],'DateTime',context!);
Einheit = json['unit'];
Memo = json['note'];
DeviceCatalogGuid = json['deviceCatalogGuid'];
return this;
}
Map<String, dynamic> toJson() => {
'guid': Guid,
'geraetenummer': Geraetenummer,
'bezeichnung': Bezeichnung,
'beschreibung': Beschreibung,
'einbaudatum': JsonConverters.toJson(Einbaudatum,'DateTime',context!),
'ausbaudatum': JsonConverters.toJson(Ausbaudatum,'DateTime',context!),
'eichdatum': JsonConverters.toJson(Eichdatum,'DateTime',context!),
'einheit': Einheit,
'memo': Memo,
'deviceCatalogGuid': DeviceCatalogGuid
};
getTypeName() => "Device";
TypeContext? context = _ctx;
}
class GetDeviceListResponse implements IConvertible
{
List<Device>? deviceList;
ResponseStatus? responseStatus;
GetDeviceListResponse({this.deviceList,this.responseStatus});
GetDeviceListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
deviceList = JsonConverters.fromJson(json['deviceList'],'List<Device>',context!);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'deviceList': JsonConverters.toJson(deviceList,'List<Device>',context!),
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "GetDeviceListResponse";
TypeContext? context = _ctx;
}
class GetDeviceList implements IHasBearerToken, IConvertible
{
// @ApiMember(IsRequired=true, ParameterType="query")
String? bearerToken;
/**
* Optional! Follow the format : /api/v1/devices?filter[ObjektGuid]=*
*/
// @DataMember(Name="filter[ObjektGuid]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/devices?filter[ObjektGuid]=*", ParameterType="query")
String? filter_ObjektGuid_;
/**
* Optional! Follow the format : /api/v1/devices?filter[NutzerGuid]=*
*/
// @DataMember(Name="filter[NutzerGuid]")
// @ApiMember(Description="Optional! Follow the format : /api/v1/devices?filter[NutzerGuid]=*", ParameterType="query")
String? filter_NutzerGuid_;
GetDeviceList({this.bearerToken,this.filter_ObjektGuid_,this.filter_NutzerGuid_});
GetDeviceList.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
bearerToken = json['bearerToken'];
filter_ObjektGuid_ = json['filterByObjektGuid'];
filter_NutzerGuid_ = json['filterByNutzeinheitGuid'];
return this;
}
Map<String, dynamic> toJson() => {
'bearerToken': bearerToken,
'filter_ObjektGuid_': filter_ObjektGuid_,
'filter_NutzerGuid_': filter_NutzerGuid_
};
getTypeName() => "GetDeviceList";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'mitchell_servdesk.eras_online.de', types: <String, TypeInfo> {
'Device': TypeInfo(TypeOf.Class, create:() => Device()),
'GetDeviceListResponse': TypeInfo(TypeOf.Class, create:() => GetDeviceListResponse()),
'List<Device>': TypeInfo(TypeOf.Class, create:() => <Device>[]),
'GetDeviceList': TypeInfo(TypeOf.Class, create:() => GetDeviceList()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/v1/devices HTTP/1.1 Host: mitchell-servdesk.eras-online.de Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetDeviceListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Get">
<DeviceList xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eras2Web.Service.Desktop.Server.ServiceModel.Eras2WebExt.Models" i:nil="true" />
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</GetDeviceListResponse>