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 datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemCompletion:
resource_completion_id: Optional[int] = None
resource_progress_id: Optional[int] = None
progress_on_completion: Optional[int] = None
resource_id: Optional[str] = None
resource_name: Optional[str] = None
resource_type: Optional[str] = None
completion_date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemCompletionResponse:
member_id: Optional[int] = None
start_date: Optional[datetime.datetime] = None
end_date: Optional[datetime.datetime] = None
total_completions: Optional[int] = None
retrieval_amount: Optional[int] = None
resource_completions: Optional[List[ResourceItemCompletion]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemCompletionRequest:
member_id: Optional[int] = None
start_date: Optional[datetime.datetime] = None
end_date: Optional[datetime.datetime] = None
resource_type: Optional[str] = None
retrieval_amount: Optional[int] = None
Python ResourceItemCompletionRequest 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 /memberResourceCompletions/{MemberId}/{StartDate}/{EndDate} HTTP/1.1 Host: resourcelibrary.api.ashcompanies.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ResourceItemCompletionResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.ServiceModels"> <EndDate>0001-01-01T00:00:00</EndDate> <MemberId>0</MemberId> <ResourceCompletions xmlns:d2p1="http://schemas.datacontract.org/2004/07/ASH.ResourceLibrary.Interfaces.Models"> <d2p1:ResourceItemCompletion> <d2p1:CompletionDate>0001-01-01T00:00:00</d2p1:CompletionDate> <d2p1:ProgressOnCompletion>0</d2p1:ProgressOnCompletion> <d2p1:ResourceCompletionId>0</d2p1:ResourceCompletionId> <d2p1:ResourceId>String</d2p1:ResourceId> <d2p1:ResourceName>String</d2p1:ResourceName> <d2p1:ResourceProgressId>0</d2p1:ResourceProgressId> <d2p1:ResourceType>String</d2p1:ResourceType> </d2p1:ResourceItemCompletion> </ResourceCompletions> <RetrievalAmount>0</RetrievalAmount> <StartDate>0001-01-01T00:00:00</StartDate> <TotalCompletions>0</TotalCompletions> </ResourceItemCompletionResponse>