| GET | /template-approval/list |
|---|
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 ApiServiceRequest(IServiceRequest, IHasApiKey, IHasDeviceInfo):
# @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
api_key: Optional[str] = None
"""
The API Key required for authentication
"""
# @ApiMember(DataType="double", Description="Latitude of the user making this request")
latitude: float = 0.0
"""
Latitude of the user making this request
"""
# @ApiMember(DataType="double", Description="Longitude of the user making this request")
longitude: float = 0.0
"""
Longitude of the user making this request
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ApiServiceResponse(IServiceResponse):
description: Optional[str] = None
heading: Optional[str] = None
was_successful: bool = False
model_state: Optional[Object] = None
class TemplateApprovalStatus(IntEnum):
AWAITING_APPROVAL = 0
REJECTED = 1
APPROVED = 2
class TemplateType(IntEnum):
INTRODUCTORY = 0
REFRESHER = 1
class SectionTitle(IntEnum):
WELCOME = 0
COCHRANE = 1
ICONIC = 2
OUR_BEST_WORK = 3
REALITY_OF_RISK = 4
PRODUCT_RANGE = 5
PRODUCT_DEPLOYMENTS = 6
INDUSTRIES = 7
CLEAR_VU = 8
CASE_STUDIES = 9
EXPERTISE = 10
MEDIA = 11
THANK_YOU = 12
CLEAR_VU_RANGE = 13
PRESENTATIONS = 14
LEGACY_VIDEOS = 15
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SectionSummary:
title: Optional[SectionTitle] = None
title_string: Optional[str] = None
section_id: int = 0
section_name: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TemplateApprovalListItem:
user_crm_id: Optional[str] = None
approval_date: Optional[str] = None
template_approval_id: int = 0
approval_status: Optional[TemplateApprovalStatus] = None
approval_status_string: Optional[str] = None
template_type: Optional[TemplateType] = None
template_type_string: Optional[str] = None
template_name: Optional[str] = None
system_user_name: Optional[str] = None
template_change_detail: Optional[List[SectionSummary]] = None
template_detail: Optional[List[SectionSummary]] = None
content: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TemplateApprovalListResponse(ApiServiceResponse):
templates: Optional[List[TemplateApprovalListItem]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TemplateApprovalList(ApiServiceRequest):
pass
Python TemplateApprovalList DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /template-approval/list HTTP/1.1 Host: cochraneplus-api-dev.happen.zone Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"templates":[{}],"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}