ASH.ResourceLibrary.WebApi

<back to all web services

ResourceItemsRequest

Requires Authentication
The following routes are available for this service:
GET,POST/resourceItemsUse to get a list Resource Items
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 BasicResourceLibraryRequest:
    resource_library_member_id: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Tag:
    id: Optional[str] = None
    title: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ScreenshotItem:
    large_filepath_s3: Optional[str] = None
    thumb_filepath_s3: Optional[str] = None
    order: Optional[Decimal] = None
    description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceCard:
    id: Optional[str] = None
    title: Optional[str] = None
    description: Optional[str] = None
    description_summary: Optional[str] = None
    type: Optional[str] = None
    content: Optional[str] = None
    is_complete: Optional[bool] = None
    is_favorite: Optional[bool] = None
    is_implicitly_complete: Optional[bool] = None
    media_path: Optional[str] = None
    is_confirmable: Optional[bool] = None
    is_wcag_compliant: Optional[bool] = None
    duration: Optional[str] = None
    preview: Optional[str] = None
    calories: Optional[int] = None
    instructor: Optional[str] = None
    thumbnail: Optional[str] = None
    difficulty: Optional[str] = None
    tags: Optional[List[Tag]] = None
    subtitles: Optional[str] = None
    screenshots: Optional[List[ScreenshotItem]] = None
    drm_encrypted: Optional[bool] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SubTopic:
    id: Optional[str] = None
    title: Optional[str] = None
    resource_count: Optional[int] = None
    resource_items: Optional[List[ResourceItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Category:
    id: Optional[str] = None
    subtopic_items: Optional[List[SubTopic]] = None
    resource_items: Optional[List[ResourceItem]] = None
    title: Optional[str] = None
    is_visible: Optional[str] = None
    resource_count: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ActivityItem:
    name: Optional[str] = None
    id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SeriesItem:
    id: Optional[str] = None
    title: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AltMediaPaths:
    webm: Optional[str] = None
    ogv: Optional[str] = None
    mp4_low: Optional[str] = None
    mp4_high: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItem(ResourceCard):
    content: Optional[str] = None
    credit: Optional[str] = None
    references: Optional[str] = None
    disclaimer: Optional[str] = None
    header_image: Optional[str] = None
    origin: Optional[str] = None
    origin_id: Optional[str] = None
    tags: Optional[List[Tag]] = None
    categories: Optional[List[Category]] = None
    index: Optional[int] = None
    activity_level: Optional[str] = None
    activity_details: Optional[str] = None
    transcript: Optional[str] = None
    is_archived: Optional[bool] = None
    activities: Optional[List[ActivityItem]] = None
    series_items: Optional[List[SeriesItem]] = None
    video_id: Optional[str] = None
    focus: Optional[str] = None
    series: Optional[str] = None
    series_url: Optional[str] = None
    category: Optional[str] = None
    equipments: Optional[List[str]] = None
    duration_range: Optional[str] = None
    provider_name: Optional[str] = None
    upload_date: Optional[str] = None
    completion_date: Optional[datetime.datetime] = None
    level: Optional[str] = None
    body_focus: Optional[str] = None
    alt_media_paths: Optional[AltMediaPaths] = None
    subtitles: Optional[str] = None
    drm_encrypted: Optional[bool] = None
    screenshots: Optional[List[ScreenshotItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemsResponse(IResourceItemsLiteResponse):
    resource_items: Optional[List[ResourceItem]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemsRequest(BasicResourceLibraryRequest):
    include_completion_status: Optional[bool] = None
    include_content: Optional[bool] = None
    is_favorite: Optional[bool] = None
    is_digital_workout_featured: Optional[bool] = None
    multiple_d_w_featured_resources: Optional[bool] = None
    workout_category_id: Optional[str] = None
    resource_item_ids: Optional[List[str]] = None
    # @ApiMember(Description="Set it to true if requesting resources only from digital library")
    digital_fitness: Optional[bool] = None
    """
    Set it to true if requesting resources only from digital library
    """


    # @ApiMember(Description="Set it to true if requesting resources only from health library")
    health_library: Optional[bool] = None
    """
    Set it to true if requesting resources only from health library
    """


    limit: Optional[str] = None
    offset: Optional[str] = None

Python ResourceItemsRequest 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.

POST /resourceItems HTTP/1.1 
Host: resourcelibrary.api.ashcompanies.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"includeCompletionStatus":false,"includeContent":false,"isFavorite":false,"isDigitalWorkoutFeatured":false,"multipleDWFeaturedResources":false,"workoutCategoryId":"String","resourceItemIds":["String"],"digitalFitness":false,"healthLibrary":false,"limit":"String","offset":"String","resourceLibraryMemberId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"resourceItems":[{"content":"String","credit":"String","references":"String","disclaimer":"String","headerImage":"String","origin":"String","originId":"String","tags":[{"id":"String","title":"String"}],"categories":[{"id":"String","subtopicItems":null,"resourceItems":null,"title":"String","isVisible":"String","resourceCount":0}],"index":0,"activityLevel":"String","activityDetails":"String","transcript":"String","isArchived":false,"activities":[{"name":"String","id":"String"}],"seriesItems":[{"id":"String","title":"String"}],"videoId":"String","focus":"String","series":"String","seriesUrl":"String","category":"String","equipments":["String"],"durationRange":"String","providerName":"String","uploadDate":"String","completionDate":"0001-01-01T00:00:00.0000000","level":"String","bodyFocus":"String","altMediaPaths":{"webm":"String","ogv":"String","mp4Low":"String","mp4High":"String"},"subtitles":"String","drmEncrypted":false,"screenshots":[{"largeFilepathS3":"String","thumbFilepathS3":"String","order":0,"description":"String"}],"id":"String","title":"String","description":"String","descriptionSummary":"String","type":"String","isComplete":false,"isFavorite":false,"isImplicitlyComplete":false,"mediaPath":"String","isConfirmable":false,"isWcagCompliant":false,"duration":"String","preview":"String","calories":0,"instructor":"String","thumbnail":"String","difficulty":"String"}]}