| GET | /{Workspace}/Search |
|---|
import 'package:servicestack/servicestack.dart';
class NamedItem implements IConvertible
{
String? Workspace;
String? ObjectId;
String? Class;
String? VersionId;
String? Name;
String? LastUpdated;
NamedItem({this.Workspace,this.ObjectId,this.Class,this.VersionId,this.Name,this.LastUpdated});
NamedItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
ObjectId = json['ObjectId'];
Class = json['Class'];
VersionId = json['VersionId'];
Name = json['Name'];
LastUpdated = json['LastUpdated'];
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'ObjectId': ObjectId,
'Class': Class,
'VersionId': VersionId,
'Name': Name,
'LastUpdated': LastUpdated
};
getTypeName() => "NamedItem";
TypeContext? context = _ctx;
}
/**
* This service needs to be called with a query filter. It will fail otherwise. Usage is /{Workspace}/Search?QUERY=John Smith (where John Smith is the text query to use for the search). CLASSES=classlist (where classlist is an optional comma separated list of classes to search. i.e. Document,Task,Contact,Feedback If this parameter is not specified, all classes are searched.
*/
class Search implements IConvertible
{
String? Workspace;
String? DateGenerated;
List<NamedItem>? Results;
Search({this.Workspace,this.DateGenerated,this.Results});
Search.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Workspace = json['Workspace'];
DateGenerated = json['DateGenerated'];
Results = JsonConverters.fromJson(json['Results'],'List<NamedItem>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Workspace': Workspace,
'DateGenerated': DateGenerated,
'Results': JsonConverters.toJson(Results,'List<NamedItem>',context!)
};
getTypeName() => "Search";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'NamedItem': TypeInfo(TypeOf.Class, create:() => NamedItem()),
'Search': TypeInfo(TypeOf.Class, create:() => Search()),
'List<NamedItem>': TypeInfo(TypeOf.Class, create:() => <NamedItem>[]),
});
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 /{Workspace}/Search HTTP/1.1
Host: dev.fieldsquared.com
Accept: text/csv