GET | /storage/list |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class MediaContent implements IConvertible
{
String? fileName;
String? contentType;
Uint8List? file;
Uri? uri;
MediaContent({this.fileName,this.contentType,this.file,this.uri});
MediaContent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
fileName = json['fileName'];
contentType = json['contentType'];
file = JsonConverters.fromJson(json['file'],'Uint8List',context!);
uri = JsonConverters.fromJson(json['uri'],'Uri',context!);
return this;
}
Map<String, dynamic> toJson() => {
'fileName': fileName,
'contentType': contentType,
'file': JsonConverters.toJson(file,'Uint8List',context!),
'uri': JsonConverters.toJson(uri,'Uri',context!)
};
getTypeName() => "MediaContent";
TypeContext? context = _ctx;
}
class StorageResponse implements IConvertible
{
List<MediaContent>? mediaList;
StorageResponse({this.mediaList});
StorageResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
mediaList = JsonConverters.fromJson(json['mediaList'],'List<MediaContent>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'mediaList': JsonConverters.toJson(mediaList,'List<MediaContent>',context!)
};
getTypeName() => "StorageResponse";
TypeContext? context = _ctx;
}
class StorageGetListReq implements IConvertible
{
StorageGetListReq();
StorageGetListReq.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "StorageGetListReq";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
'MediaContent': TypeInfo(TypeOf.Class, create:() => MediaContent()),
'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
'Uri': TypeInfo(TypeOf.Class, create:() => Uri()),
'StorageResponse': TypeInfo(TypeOf.Class, create:() => StorageResponse()),
'List<MediaContent>': TypeInfo(TypeOf.Class, create:() => <MediaContent>[]),
'StorageGetListReq': TypeInfo(TypeOf.Class, create:() => StorageGetListReq()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /storage/list HTTP/1.1 Host: hcbtas-q-albamfs-api.azurewebsites.net Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"mediaList":[{"fileName":"String","contentType":"String"}]}