GET | /searchResults | Use to search 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 ResourceItemSearchRequest(BasicResourceLibraryRequest):
request: Optional[str] = None
tags: Optional[List[str]] = None
category_id: Optional[str] = None
offset: Optional[int] = None
limit: Optional[int] = None
digital_fitness: Optional[bool] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemForSearch:
id: Optional[str] = None
type: Optional[str] = None
categories: Optional[List[str]] = None
category_indexes: Optional[List[str]] = None
title: Optional[str] = None
description: Optional[str] = None
description_summary: Optional[str] = None
content: Optional[str] = None
tags: Optional[List[str]] = None
is_complete: Optional[bool] = None
is_favorite: Optional[bool] = None
is_implicitly_complete: Optional[bool] = None
transcript: Optional[str] = None
thumbnail: Optional[str] = None
difficulty: Optional[str] = None
duration: Optional[str] = None
media_path: Optional[str] = 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 SearchResult:
id: Optional[str] = None
resource_items: Optional[List[ResourceItemForSearch]] = None
search_items: Optional[List[ResourceItemForSearch]] = None
tags: Optional[List[Tag]] = None
item_count: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemSearchResponse:
search_results: Optional[SearchResult] = None
Python ResourceItemSearchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"searchResults":{"id":"String","resourceItems":[{"id":"String","type":"String","categories":["String"],"categoryIndexes":["String"],"title":"String","description":"String","descriptionSummary":"String","content":"String","tags":["String"],"isComplete":false,"isFavorite":false,"isImplicitlyComplete":false,"transcript":"String","thumbnail":"String","difficulty":"String","duration":"String","mediaPath":"String"}],"searchItems":[{"id":"String","type":"String","categories":["String"],"categoryIndexes":["String"],"title":"String","description":"String","descriptionSummary":"String","content":"String","tags":["String"],"isComplete":false,"isFavorite":false,"isImplicitlyComplete":false,"transcript":"String","thumbnail":"String","difficulty":"String","duration":"String","mediaPath":"String"}],"tags":[{"id":"String","title":"String"}],"itemCount":0}}