GET | /searchResults | Use to search Resource Items |
---|
import 'package:servicestack/servicestack.dart';
class BasicResourceLibraryRequest implements IConvertible
{
int? resourceLibraryMemberId;
BasicResourceLibraryRequest({this.resourceLibraryMemberId});
BasicResourceLibraryRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
resourceLibraryMemberId = json['resourceLibraryMemberId'];
return this;
}
Map<String, dynamic> toJson() => {
'resourceLibraryMemberId': resourceLibraryMemberId
};
getTypeName() => "BasicResourceLibraryRequest";
TypeContext? context = _ctx;
}
class ResourceItemSearchRequest extends BasicResourceLibraryRequest implements IConvertible
{
String? request;
List<String>? tags;
String? categoryId;
int? offset;
int? limit;
bool? digitalFitness;
ResourceItemSearchRequest({this.request,this.tags,this.categoryId,this.offset,this.limit,this.digitalFitness});
ResourceItemSearchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
request = json['request'];
tags = JsonConverters.fromJson(json['tags'],'List<String>',context!);
categoryId = json['categoryId'];
offset = json['offset'];
limit = json['limit'];
digitalFitness = json['digitalFitness'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'request': request,
'tags': JsonConverters.toJson(tags,'List<String>',context!),
'categoryId': categoryId,
'offset': offset,
'limit': limit,
'digitalFitness': digitalFitness
});
getTypeName() => "ResourceItemSearchRequest";
TypeContext? context = _ctx;
}
class ResourceItemForSearch implements IConvertible
{
String? id;
String? type;
List<String>? categories;
List<String>? categoryIndexes;
String? title;
String? description;
String? descriptionSummary;
String? content;
List<String>? tags;
bool? isComplete;
bool? isFavorite;
bool? isImplicitlyComplete;
String? transcript;
String? thumbnail;
String? difficulty;
String? duration;
String? mediaPath;
ResourceItemForSearch({this.id,this.type,this.categories,this.categoryIndexes,this.title,this.description,this.descriptionSummary,this.content,this.tags,this.isComplete,this.isFavorite,this.isImplicitlyComplete,this.transcript,this.thumbnail,this.difficulty,this.duration,this.mediaPath});
ResourceItemForSearch.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
categories = JsonConverters.fromJson(json['categories'],'List<String>',context!);
categoryIndexes = JsonConverters.fromJson(json['categoryIndexes'],'List<String>',context!);
title = json['title'];
description = json['description'];
descriptionSummary = json['descriptionSummary'];
content = json['content'];
tags = JsonConverters.fromJson(json['tags'],'List<String>',context!);
isComplete = json['isComplete'];
isFavorite = json['isFavorite'];
isImplicitlyComplete = json['isImplicitlyComplete'];
transcript = json['transcript'];
thumbnail = json['thumbnail'];
difficulty = json['difficulty'];
duration = json['duration'];
mediaPath = json['mediaPath'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'type': type,
'categories': JsonConverters.toJson(categories,'List<String>',context!),
'categoryIndexes': JsonConverters.toJson(categoryIndexes,'List<String>',context!),
'title': title,
'description': description,
'descriptionSummary': descriptionSummary,
'content': content,
'tags': JsonConverters.toJson(tags,'List<String>',context!),
'isComplete': isComplete,
'isFavorite': isFavorite,
'isImplicitlyComplete': isImplicitlyComplete,
'transcript': transcript,
'thumbnail': thumbnail,
'difficulty': difficulty,
'duration': duration,
'mediaPath': mediaPath
};
getTypeName() => "ResourceItemForSearch";
TypeContext? context = _ctx;
}
class Tag implements IConvertible
{
String? id;
String? title;
Tag({this.id,this.title});
Tag.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'title': title
};
getTypeName() => "Tag";
TypeContext? context = _ctx;
}
class SearchResult implements IConvertible
{
String? id;
List<ResourceItemForSearch>? resourceItems;
List<ResourceItemForSearch>? searchItems;
List<Tag>? tags;
int? itemCount;
SearchResult({this.id,this.resourceItems,this.searchItems,this.tags,this.itemCount});
SearchResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
resourceItems = JsonConverters.fromJson(json['resourceItems'],'List<ResourceItemForSearch>',context!);
searchItems = JsonConverters.fromJson(json['searchItems'],'List<ResourceItemForSearch>',context!);
tags = JsonConverters.fromJson(json['tags'],'List<Tag>',context!);
itemCount = json['itemCount'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'resourceItems': JsonConverters.toJson(resourceItems,'List<ResourceItemForSearch>',context!),
'searchItems': JsonConverters.toJson(searchItems,'List<ResourceItemForSearch>',context!),
'tags': JsonConverters.toJson(tags,'List<Tag>',context!),
'itemCount': itemCount
};
getTypeName() => "SearchResult";
TypeContext? context = _ctx;
}
class ResourceItemSearchResponse implements IConvertible
{
SearchResult? searchResults;
ResourceItemSearchResponse({this.searchResults});
ResourceItemSearchResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
searchResults = JsonConverters.fromJson(json['searchResults'],'SearchResult',context!);
return this;
}
Map<String, dynamic> toJson() => {
'searchResults': JsonConverters.toJson(searchResults,'SearchResult',context!)
};
getTypeName() => "ResourceItemSearchResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'resourcelibrary.api.ashcompanies.com', types: <String, TypeInfo> {
'BasicResourceLibraryRequest': TypeInfo(TypeOf.Class, create:() => BasicResourceLibraryRequest()),
'ResourceItemSearchRequest': TypeInfo(TypeOf.Class, create:() => ResourceItemSearchRequest()),
'ResourceItemForSearch': TypeInfo(TypeOf.Class, create:() => ResourceItemForSearch()),
'Tag': TypeInfo(TypeOf.Class, create:() => Tag()),
'SearchResult': TypeInfo(TypeOf.Class, create:() => SearchResult()),
'List<ResourceItemForSearch>': TypeInfo(TypeOf.Class, create:() => <ResourceItemForSearch>[]),
'List<Tag>': TypeInfo(TypeOf.Class, create:() => <Tag>[]),
'ResourceItemSearchResponse': TypeInfo(TypeOf.Class, create:() => ResourceItemSearchResponse()),
});
Dart ResourceItemSearchRequest DTOs
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 /searchResults HTTP/1.1 Host: resourcelibrary.api.ashcompanies.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ResourceItemSearchResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.ServiceModels"> <SearchResults xmlns:d2p1="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.Models"> <d2p1:Id>String</d2p1:Id> <d2p1:ItemCount>0</d2p1:ItemCount> <d2p1:ResourceItems> <d2p1:ResourceItemForSearch> <d2p1:Categories xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:Categories> <d2p1:CategoryIndexes xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:CategoryIndexes> <d2p1:Content>String</d2p1:Content> <d2p1:Description>String</d2p1:Description> <d2p1:DescriptionSummary>String</d2p1:DescriptionSummary> <d2p1:Difficulty>String</d2p1:Difficulty> <d2p1:Duration>String</d2p1:Duration> <d2p1:Id>String</d2p1:Id> <d2p1:IsComplete>false</d2p1:IsComplete> <d2p1:IsFavorite>false</d2p1:IsFavorite> <d2p1:IsImplicitlyComplete>false</d2p1:IsImplicitlyComplete> <d2p1:MediaPath>String</d2p1:MediaPath> <d2p1:Tags xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:Tags> <d2p1:Thumbnail>String</d2p1:Thumbnail> <d2p1:Title>String</d2p1:Title> <d2p1:Transcript>String</d2p1:Transcript> <d2p1:Type>String</d2p1:Type> </d2p1:ResourceItemForSearch> </d2p1:ResourceItems> <d2p1:SearchItems> <d2p1:ResourceItemForSearch> <d2p1:Categories xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:Categories> <d2p1:CategoryIndexes xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:CategoryIndexes> <d2p1:Content>String</d2p1:Content> <d2p1:Description>String</d2p1:Description> <d2p1:DescriptionSummary>String</d2p1:DescriptionSummary> <d2p1:Difficulty>String</d2p1:Difficulty> <d2p1:Duration>String</d2p1:Duration> <d2p1:Id>String</d2p1:Id> <d2p1:IsComplete>false</d2p1:IsComplete> <d2p1:IsFavorite>false</d2p1:IsFavorite> <d2p1:IsImplicitlyComplete>false</d2p1:IsImplicitlyComplete> <d2p1:MediaPath>String</d2p1:MediaPath> <d2p1:Tags xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:string>String</d5p1:string> </d2p1:Tags> <d2p1:Thumbnail>String</d2p1:Thumbnail> <d2p1:Title>String</d2p1:Title> <d2p1:Transcript>String</d2p1:Transcript> <d2p1:Type>String</d2p1:Type> </d2p1:ResourceItemForSearch> </d2p1:SearchItems> <d2p1:Tags> <d2p1:Tag> <d2p1:_x003C_Id_x003E_k__BackingField>String</d2p1:_x003C_Id_x003E_k__BackingField> <d2p1:_x003C_Title_x003E_k__BackingField>String</d2p1:_x003C_Title_x003E_k__BackingField> </d2p1:Tag> </d2p1:Tags> </SearchResults> </ResourceItemSearchResponse>