ASH.ResourceLibrary.WebApi

<back to all web services

ResourceItemCompletionRequest

Requires Authentication
The following routes are available for this service:
GET/memberResourceCompletions/{MemberId}/{StartDate}/{EndDate}Retrieves all completion records of all types for the member and the given date range.
GET/memberResourceCompletions/{MemberId}/{StartDate}/{EndDate}/{ResourceType}Retrieves all completion records for the specified type and date range of the member.
GET/memberResourceCompletions/{MemberId}/{StartDate}/{EndDate}/{ResourceType}/{RetrievalAmount}Retrieves member completions based on date range and resource type. If no resource type is specified it will return all completions.
import 'package:servicestack/servicestack.dart';

class ResourceItemCompletion implements IConvertible
{
    int? resourceCompletionId;
    int? resourceProgressId;
    int? progressOnCompletion;
    String? resourceId;
    String? resourceName;
    String? resourceType;
    DateTime? completionDate;

    ResourceItemCompletion({this.resourceCompletionId,this.resourceProgressId,this.progressOnCompletion,this.resourceId,this.resourceName,this.resourceType,this.completionDate});
    ResourceItemCompletion.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        resourceCompletionId = json['resourceCompletionId'];
        resourceProgressId = json['resourceProgressId'];
        progressOnCompletion = json['progressOnCompletion'];
        resourceId = json['resourceId'];
        resourceName = json['resourceName'];
        resourceType = json['resourceType'];
        completionDate = JsonConverters.fromJson(json['completionDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'resourceCompletionId': resourceCompletionId,
        'resourceProgressId': resourceProgressId,
        'progressOnCompletion': progressOnCompletion,
        'resourceId': resourceId,
        'resourceName': resourceName,
        'resourceType': resourceType,
        'completionDate': JsonConverters.toJson(completionDate,'DateTime',context!)
    };

    getTypeName() => "ResourceItemCompletion";
    TypeContext? context = _ctx;
}

class ResourceItemCompletionResponse implements IConvertible
{
    int? memberId;
    DateTime? startDate;
    DateTime? endDate;
    int? totalCompletions;
    int? retrievalAmount;
    List<ResourceItemCompletion>? resourceCompletions;

    ResourceItemCompletionResponse({this.memberId,this.startDate,this.endDate,this.totalCompletions,this.retrievalAmount,this.resourceCompletions});
    ResourceItemCompletionResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        memberId = json['memberId'];
        startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
        endDate = JsonConverters.fromJson(json['endDate'],'DateTime',context!);
        totalCompletions = json['totalCompletions'];
        retrievalAmount = json['retrievalAmount'];
        resourceCompletions = JsonConverters.fromJson(json['resourceCompletions'],'List<ResourceItemCompletion>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'memberId': memberId,
        'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
        'endDate': JsonConverters.toJson(endDate,'DateTime',context!),
        'totalCompletions': totalCompletions,
        'retrievalAmount': retrievalAmount,
        'resourceCompletions': JsonConverters.toJson(resourceCompletions,'List<ResourceItemCompletion>',context!)
    };

    getTypeName() => "ResourceItemCompletionResponse";
    TypeContext? context = _ctx;
}

class ResourceItemCompletionRequest implements IConvertible
{
    int? memberId;
    DateTime? startDate;
    DateTime? endDate;
    String? resourceType;
    int? retrievalAmount;

    ResourceItemCompletionRequest({this.memberId,this.startDate,this.endDate,this.resourceType,this.retrievalAmount});
    ResourceItemCompletionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        memberId = json['memberId'];
        startDate = JsonConverters.fromJson(json['startDate'],'DateTime',context!);
        endDate = JsonConverters.fromJson(json['endDate'],'DateTime',context!);
        resourceType = json['resourceType'];
        retrievalAmount = json['retrievalAmount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'memberId': memberId,
        'startDate': JsonConverters.toJson(startDate,'DateTime',context!),
        'endDate': JsonConverters.toJson(endDate,'DateTime',context!),
        'resourceType': resourceType,
        'retrievalAmount': retrievalAmount
    };

    getTypeName() => "ResourceItemCompletionRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'resourcelibrary.api.ashcompanies.com', types: <String, TypeInfo> {
    'ResourceItemCompletion': TypeInfo(TypeOf.Class, create:() => ResourceItemCompletion()),
    'ResourceItemCompletionResponse': TypeInfo(TypeOf.Class, create:() => ResourceItemCompletionResponse()),
    'List<ResourceItemCompletion>': TypeInfo(TypeOf.Class, create:() => <ResourceItemCompletion>[]),
    'ResourceItemCompletionRequest': TypeInfo(TypeOf.Class, create:() => ResourceItemCompletionRequest()),
});

Dart ResourceItemCompletionRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /memberResourceCompletions/{MemberId}/{StartDate}/{EndDate} HTTP/1.1 
Host: resourcelibrary.api.ashcompanies.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"memberId":0,"startDate":"0001-01-01T00:00:00.0000000","endDate":"0001-01-01T00:00:00.0000000","totalCompletions":0,"retrievalAmount":0,"resourceCompletions":[{"resourceCompletionId":0,"resourceProgressId":0,"progressOnCompletion":0,"resourceId":"String","resourceName":"String","resourceType":"String","completionDate":"0001-01-01T00:00:00.0000000"}]}