GET | /RestApi/apiservice/services |
---|
import 'package:servicestack/servicestack.dart';
class GetServices implements IConvertible
{
bool? Types;
GetServices({this.Types});
GetServices.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Types = json['Types'];
return this;
}
Map<String, dynamic> toJson() => {
'Types': Types
};
getTypeName() => "GetServices";
TypeContext? context = _ctx;
}
class ServicesResponse implements IConvertible
{
List<ServicesProxy>? Services;
String? ErrorMessage;
ServicesResponse({this.Services,this.ErrorMessage});
ServicesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Services = JsonConverters.fromJson(json['Services'],'List<ServicesProxy>',context!);
ErrorMessage = json['ErrorMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'Services': JsonConverters.toJson(Services,'List<ServicesProxy>',context!),
'ErrorMessage': ErrorMessage
};
getTypeName() => "ServicesResponse";
TypeContext? context = _ctx;
}
class PropertiesProxy implements IConvertible
{
String? Name;
String? PropertyType;
bool? IsPersistent;
bool? AllowSort;
bool? AllowFilter;
bool? IsKey;
PropertiesProxy({this.Name,this.PropertyType,this.IsPersistent,this.AllowSort,this.AllowFilter,this.IsKey});
PropertiesProxy.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
PropertyType = json['PropertyType'];
IsPersistent = json['IsPersistent'];
AllowSort = json['AllowSort'];
AllowFilter = json['AllowFilter'];
IsKey = json['IsKey'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'PropertyType': PropertyType,
'IsPersistent': IsPersistent,
'AllowSort': AllowSort,
'AllowFilter': AllowFilter,
'IsKey': IsKey
};
getTypeName() => "PropertiesProxy";
TypeContext? context = _ctx;
}
class ContentsProxy implements IConvertible
{
String? Name;
bool? ReadOnly;
String? UrlKey;
String? ClrType;
String? Access;
List<PropertiesProxy>? Properties;
List<ContentsProxy>? Children;
bool? AutogenerateProperties;
String? parentId;
ContentsProxy({this.Name,this.ReadOnly,this.UrlKey,this.ClrType,this.Access,this.Properties,this.Children,this.AutogenerateProperties,this.parentId});
ContentsProxy.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
ReadOnly = json['ReadOnly'];
UrlKey = json['UrlKey'];
ClrType = json['ClrType'];
Access = json['Access'];
Properties = JsonConverters.fromJson(json['Properties'],'List<PropertiesProxy>',context!);
Children = JsonConverters.fromJson(json['Children'],'List<ContentsProxy>',context!);
AutogenerateProperties = json['AutogenerateProperties'];
parentId = json['parentId'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'ReadOnly': ReadOnly,
'UrlKey': UrlKey,
'ClrType': ClrType,
'Access': Access,
'Properties': JsonConverters.toJson(Properties,'List<PropertiesProxy>',context!),
'Children': JsonConverters.toJson(Children,'List<ContentsProxy>',context!),
'AutogenerateProperties': AutogenerateProperties,
'parentId': parentId
};
getTypeName() => "ContentsProxy";
TypeContext? context = _ctx;
}
class ServicesProxy implements IConvertible
{
String? Name;
String? Route;
String? UrlName;
bool? Enabled;
String? Access;
String? ApiKey;
String? AccessControlAllowOrigin;
bool? AutogenerateTypes;
List<ContentsProxy>? Types;
String? Protocol;
String? ErrorMessage;
ServicesProxy({this.Name,this.Route,this.UrlName,this.Enabled,this.Access,this.ApiKey,this.AccessControlAllowOrigin,this.AutogenerateTypes,this.Types,this.Protocol,this.ErrorMessage});
ServicesProxy.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
Route = json['Route'];
UrlName = json['UrlName'];
Enabled = json['Enabled'];
Access = json['Access'];
ApiKey = json['ApiKey'];
AccessControlAllowOrigin = json['AccessControlAllowOrigin'];
AutogenerateTypes = json['AutogenerateTypes'];
Types = JsonConverters.fromJson(json['Types'],'List<ContentsProxy>',context!);
Protocol = json['Protocol'];
ErrorMessage = json['ErrorMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'Route': Route,
'UrlName': UrlName,
'Enabled': Enabled,
'Access': Access,
'ApiKey': ApiKey,
'AccessControlAllowOrigin': AccessControlAllowOrigin,
'AutogenerateTypes': AutogenerateTypes,
'Types': JsonConverters.toJson(Types,'List<ContentsProxy>',context!),
'Protocol': Protocol,
'ErrorMessage': ErrorMessage
};
getTypeName() => "ServicesProxy";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'GetServices': TypeInfo(TypeOf.Class, create:() => GetServices()),
'ServicesResponse': TypeInfo(TypeOf.Class, create:() => ServicesResponse()),
'List<ServicesProxy>': TypeInfo(TypeOf.Class, create:() => <ServicesProxy>[]),
'ServicesProxy': TypeInfo(TypeOf.Class, create:() => ServicesProxy()),
'PropertiesProxy': TypeInfo(TypeOf.Class, create:() => PropertiesProxy()),
'ContentsProxy': TypeInfo(TypeOf.Class, create:() => ContentsProxy()),
'List<PropertiesProxy>': TypeInfo(TypeOf.Class, create:() => <PropertiesProxy>[]),
'List<ContentsProxy>': TypeInfo(TypeOf.Class, create:() => <ContentsProxy>[]),
});
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.
GET /RestApi/apiservice/services HTTP/1.1 Host: www.asg.com.au Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Services":[{"Name":"String","Route":"String","UrlName":"String","Enabled":false,"Access":"String","ApiKey":"String","AccessControlAllowOrigin":"String","AutogenerateTypes":false,"Types":null,"Protocol":"String","ErrorMessage":"String"}],"ErrorMessage":"String"}