import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
abstract class ILanguage
{
// @DataMember
String? LanguageCodeShort;
// @DataMember
String? LanguageCodeLong;
// @DataMember
String? PropertyForILanguage;
}
// @DataContract
class GetLanguagesResponse implements IConvertible
{
// @DataMember
List<ILanguage>? Languages;
GetLanguagesResponse({this.Languages});
GetLanguagesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Languages = JsonConverters.fromJson(json['Languages'],'List<ILanguage>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Languages': JsonConverters.toJson(Languages,'List<ILanguage>',context!)
};
getTypeName() => "GetLanguagesResponse";
TypeContext? context = _ctx;
}
class GetLanguages implements IConvertible
{
List<ILanguage>? Languages;
GetLanguages({this.Languages});
GetLanguages.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Languages = JsonConverters.fromJson(json['Languages'],'List<ILanguage>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Languages': JsonConverters.toJson(Languages,'List<ILanguage>',context!)
};
getTypeName() => "GetLanguages";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'digiofficeapigateway.deltares.nl', types: <String, TypeInfo> {
'ILanguage': TypeInfo(TypeOf.Interface),
'GetLanguagesResponse': TypeInfo(TypeOf.Class, create:() => GetLanguagesResponse()),
'List<ILanguage>': TypeInfo(TypeOf.Class, create:() => <ILanguage>[]),
'GetLanguages': TypeInfo(TypeOf.Class, create:() => GetLanguages()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/GetLanguages HTTP/1.1
Host: digiofficeapigateway.deltares.nl
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Languages":[{}]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Languages":[{}]}