GET,POST | /favorites | Use to get a list 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 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 ScreenshotItem implements IConvertible
{
String? largeFilepathS3;
String? thumbFilepathS3;
double? order;
String? description;
ScreenshotItem({this.largeFilepathS3,this.thumbFilepathS3,this.order,this.description});
ScreenshotItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
largeFilepathS3 = json['largeFilepathS3'];
thumbFilepathS3 = json['thumbFilepathS3'];
order = JsonConverters.toDouble(json['order']);
description = json['description'];
return this;
}
Map<String, dynamic> toJson() => {
'largeFilepathS3': largeFilepathS3,
'thumbFilepathS3': thumbFilepathS3,
'order': order,
'description': description
};
getTypeName() => "ScreenshotItem";
TypeContext? context = _ctx;
}
class ResourceCard implements IConvertible
{
String? id;
String? title;
String? description;
String? descriptionSummary;
String? type;
String? content;
bool? isComplete;
bool? isFavorite;
bool? isImplicitlyComplete;
String? mediaPath;
bool? isConfirmable;
bool? isWcagCompliant;
String? duration;
String? preview;
int? calories;
String? instructor;
String? thumbnail;
String? difficulty;
List<Tag>? tags;
String? subtitles;
List<ScreenshotItem>? screenshots;
bool? drmEncrypted;
ResourceCard({this.id,this.title,this.description,this.descriptionSummary,this.type,this.content,this.isComplete,this.isFavorite,this.isImplicitlyComplete,this.mediaPath,this.isConfirmable,this.isWcagCompliant,this.duration,this.preview,this.calories,this.instructor,this.thumbnail,this.difficulty,this.tags,this.subtitles,this.screenshots,this.drmEncrypted});
ResourceCard.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
description = json['description'];
descriptionSummary = json['descriptionSummary'];
type = json['type'];
content = json['content'];
isComplete = json['isComplete'];
isFavorite = json['isFavorite'];
isImplicitlyComplete = json['isImplicitlyComplete'];
mediaPath = json['mediaPath'];
isConfirmable = json['isConfirmable'];
isWcagCompliant = json['isWcagCompliant'];
duration = json['duration'];
preview = json['preview'];
calories = json['calories'];
instructor = json['instructor'];
thumbnail = json['thumbnail'];
difficulty = json['difficulty'];
tags = JsonConverters.fromJson(json['tags'],'List<Tag>',context!);
subtitles = json['subtitles'];
screenshots = JsonConverters.fromJson(json['screenshots'],'List<ScreenshotItem>',context!);
drmEncrypted = json['drmEncrypted'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'title': title,
'description': description,
'descriptionSummary': descriptionSummary,
'type': type,
'content': content,
'isComplete': isComplete,
'isFavorite': isFavorite,
'isImplicitlyComplete': isImplicitlyComplete,
'mediaPath': mediaPath,
'isConfirmable': isConfirmable,
'isWcagCompliant': isWcagCompliant,
'duration': duration,
'preview': preview,
'calories': calories,
'instructor': instructor,
'thumbnail': thumbnail,
'difficulty': difficulty,
'tags': JsonConverters.toJson(tags,'List<Tag>',context!),
'subtitles': subtitles,
'screenshots': JsonConverters.toJson(screenshots,'List<ScreenshotItem>',context!),
'drmEncrypted': drmEncrypted
};
getTypeName() => "ResourceCard";
TypeContext? context = _ctx;
}
class Meta implements IConvertible
{
int? resourceCount;
String? title;
Meta({this.resourceCount,this.title});
Meta.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
resourceCount = json['resourceCount'];
title = json['title'];
return this;
}
Map<String, dynamic> toJson() => {
'resourceCount': resourceCount,
'title': title
};
getTypeName() => "Meta";
TypeContext? context = _ctx;
}
class ResourceItemsLiteResponse implements IResourceItemsLiteResponse, IConvertible
{
List<ResourceCard>? resourceItems;
Meta? meta;
ResourceItemsLiteResponse({this.resourceItems,this.meta});
ResourceItemsLiteResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
resourceItems = JsonConverters.fromJson(json['resourceItems'],'List<ResourceCard>',context!);
meta = JsonConverters.fromJson(json['meta'],'Meta',context!);
return this;
}
Map<String, dynamic> toJson() => {
'resourceItems': JsonConverters.toJson(resourceItems,'List<ResourceCard>',context!),
'meta': JsonConverters.toJson(meta,'Meta',context!)
};
getTypeName() => "ResourceItemsLiteResponse";
TypeContext? context = _ctx;
}
class FavoritesRequest extends BasicResourceLibraryRequest implements IConvertible
{
/**
* Set it to true if requesting saved resources only from digital library
*/
// @ApiMember(Description="Set it to true if requesting saved resources only from digital library")
bool? digitalFitness;
/**
* Set it to true if requesting saved resources only from health library
*/
// @ApiMember(Description="Set it to true if requesting saved resources only from health library")
bool? healthLibrary;
/**
* Set it to true if requesting saved resources only from vptr
*/
// @ApiMember(Description="Set it to true if requesting saved resources only from vptr")
bool? vptr;
/**
* Set it to true if requesting saved resources only from wellbeing
*/
// @ApiMember(Description="Set it to true if requesting saved resources only from wellbeing")
bool? wellbeing;
/**
* Set it to true if requesting saved resources only from health
*/
// @ApiMember(Description="Set it to true if requesting saved resources only from health")
bool? health;
String? limit;
String? offset;
FavoritesRequest({this.digitalFitness,this.healthLibrary,this.vptr,this.wellbeing,this.health,this.limit,this.offset});
FavoritesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
digitalFitness = json['digitalFitness'];
healthLibrary = json['healthLibrary'];
vptr = json['vptr'];
wellbeing = json['wellbeing'];
health = json['health'];
limit = json['limit'];
offset = json['offset'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'digitalFitness': digitalFitness,
'healthLibrary': healthLibrary,
'vptr': vptr,
'wellbeing': wellbeing,
'health': health,
'limit': limit,
'offset': offset
});
getTypeName() => "FavoritesRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'resourcelibrary.api.ashcompanies.com', types: <String, TypeInfo> {
'BasicResourceLibraryRequest': TypeInfo(TypeOf.Class, create:() => BasicResourceLibraryRequest()),
'Tag': TypeInfo(TypeOf.Class, create:() => Tag()),
'ScreenshotItem': TypeInfo(TypeOf.Class, create:() => ScreenshotItem()),
'ResourceCard': TypeInfo(TypeOf.Class, create:() => ResourceCard()),
'List<Tag>': TypeInfo(TypeOf.Class, create:() => <Tag>[]),
'List<ScreenshotItem>': TypeInfo(TypeOf.Class, create:() => <ScreenshotItem>[]),
'Meta': TypeInfo(TypeOf.Class, create:() => Meta()),
'ResourceItemsLiteResponse': TypeInfo(TypeOf.Class, create:() => ResourceItemsLiteResponse()),
'List<ResourceCard>': TypeInfo(TypeOf.Class, create:() => <ResourceCard>[]),
'FavoritesRequest': TypeInfo(TypeOf.Class, create:() => FavoritesRequest()),
});
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.
POST /favorites HTTP/1.1
Host: resourcelibrary.api.ashcompanies.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<FavoritesRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.ServiceModels">
<ResourceLibraryMemberId>0</ResourceLibraryMemberId>
<DigitalFitness>false</DigitalFitness>
<Health>false</Health>
<HealthLibrary>false</HealthLibrary>
<Limit>String</Limit>
<Offset>String</Offset>
<Vptr>false</Vptr>
<Wellbeing>false</Wellbeing>
</FavoritesRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ResourceItemsLiteResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.ServiceModels"> <Meta xmlns:d2p1="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.Models"> <d2p1:ResourceCount>0</d2p1:ResourceCount> <d2p1:Title>String</d2p1:Title> </Meta> <ResourceItems xmlns:d2p1="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.Models"> <d2p1:ResourceCard> <d2p1:Calories>0</d2p1:Calories> <d2p1:Content>String</d2p1:Content> <d2p1:Description>String</d2p1:Description> <d2p1:DescriptionSummary>String</d2p1:DescriptionSummary> <d2p1:Difficulty>String</d2p1:Difficulty> <d2p1:DrmEncrypted>false</d2p1:DrmEncrypted> <d2p1:Duration>String</d2p1:Duration> <d2p1:Id>String</d2p1:Id> <d2p1:Instructor>String</d2p1:Instructor> <d2p1:IsComplete>false</d2p1:IsComplete> <d2p1:IsConfirmable>false</d2p1:IsConfirmable> <d2p1:IsFavorite>false</d2p1:IsFavorite> <d2p1:IsImplicitlyComplete>false</d2p1:IsImplicitlyComplete> <d2p1:IsWcagCompliant>false</d2p1:IsWcagCompliant> <d2p1:MediaPath>String</d2p1:MediaPath> <d2p1:Preview>String</d2p1:Preview> <d2p1:Screenshots> <d2p1:ScreenshotItem> <d2p1:Description>String</d2p1:Description> <d2p1:LargeFilepathS3>String</d2p1:LargeFilepathS3> <d2p1:Order>0</d2p1:Order> <d2p1:ThumbFilepathS3>String</d2p1:ThumbFilepathS3> </d2p1:ScreenshotItem> </d2p1:Screenshots> <d2p1:Subtitles>String</d2p1:Subtitles> <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> <d2p1:Thumbnail>String</d2p1:Thumbnail> <d2p1:Title>String</d2p1:Title> <d2p1:Type>String</d2p1:Type> </d2p1:ResourceCard> </ResourceItems> </ResourceItemsLiteResponse>