Cochrane+ App API

<back to all web services

TemplateApprovalList

Requires Authentication
The following routes are available for this service:
GET/template-approval/list
import 'package:servicestack/servicestack.dart';

class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, IConvertible
{
    /**
    * The API Key required for authentication
    */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    String? apiKey;

    /**
    * Latitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Latitude of the user making this request")
    double? latitude;

    /**
    * Longitude of the user making this request
    */
    // @ApiMember(DataType="double", Description="Longitude of the user making this request")
    double? longitude;

    ApiServiceRequest({this.apiKey,this.latitude,this.longitude});
    ApiServiceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        apiKey = json['apiKey'];
        latitude = JsonConverters.toDouble(json['latitude']);
        longitude = JsonConverters.toDouble(json['longitude']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'apiKey': apiKey,
        'latitude': latitude,
        'longitude': longitude
    };

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

class ApiServiceResponse implements IServiceResponse, IConvertible
{
    String? description;
    String? heading;
    bool? wasSuccessful;
    dynamic? modelState;

    ApiServiceResponse({this.description,this.heading,this.wasSuccessful,this.modelState});
    ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        description = json['description'];
        heading = json['heading'];
        wasSuccessful = json['wasSuccessful'];
        modelState = JsonConverters.fromJson(json['modelState'],'dynamic',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'description': description,
        'heading': heading,
        'wasSuccessful': wasSuccessful,
        'modelState': JsonConverters.toJson(modelState,'dynamic',context!)
    };

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

class TemplateApprovalStatus
{
    static const TemplateApprovalStatus AwaitingApproval = const TemplateApprovalStatus._(0);
    static const TemplateApprovalStatus Rejected = const TemplateApprovalStatus._(1);
    static const TemplateApprovalStatus Approved = const TemplateApprovalStatus._(2);

    final int _value;
    const TemplateApprovalStatus._(this._value);
    int get value => _value;
    static List<TemplateApprovalStatus> get values => const [AwaitingApproval,Rejected,Approved];
}

class TemplateType
{
    static const TemplateType Introductory = const TemplateType._(0);
    static const TemplateType Refresher = const TemplateType._(1);

    final int _value;
    const TemplateType._(this._value);
    int get value => _value;
    static List<TemplateType> get values => const [Introductory,Refresher];
}

class SectionTitle
{
    static const SectionTitle Welcome = const SectionTitle._(0);
    static const SectionTitle Cochrane = const SectionTitle._(1);
    static const SectionTitle Iconic = const SectionTitle._(2);
    static const SectionTitle OurBestWork = const SectionTitle._(3);
    static const SectionTitle RealityOfRisk = const SectionTitle._(4);
    static const SectionTitle ProductRange = const SectionTitle._(5);
    static const SectionTitle ProductDeployments = const SectionTitle._(6);
    static const SectionTitle Industries = const SectionTitle._(7);
    static const SectionTitle ClearVu = const SectionTitle._(8);
    static const SectionTitle CaseStudies = const SectionTitle._(9);
    static const SectionTitle Expertise = const SectionTitle._(10);
    static const SectionTitle Media = const SectionTitle._(11);
    static const SectionTitle ThankYou = const SectionTitle._(12);
    static const SectionTitle ClearVuRange = const SectionTitle._(13);
    static const SectionTitle Presentations = const SectionTitle._(14);
    static const SectionTitle LegacyVideos = const SectionTitle._(15);

    final int _value;
    const SectionTitle._(this._value);
    int get value => _value;
    static List<SectionTitle> get values => const [Welcome,Cochrane,Iconic,OurBestWork,RealityOfRisk,ProductRange,ProductDeployments,Industries,ClearVu,CaseStudies,Expertise,Media,ThankYou,ClearVuRange,Presentations,LegacyVideos];
}

class SectionSummary implements IConvertible
{
    SectionTitle? title;
    String? titleString;
    int? sectionId;
    String? sectionName;

    SectionSummary({this.title,this.titleString,this.sectionId,this.sectionName});
    SectionSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        title = JsonConverters.fromJson(json['title'],'SectionTitle',context!);
        titleString = json['titleString'];
        sectionId = json['sectionId'];
        sectionName = json['sectionName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'title': JsonConverters.toJson(title,'SectionTitle',context!),
        'titleString': titleString,
        'sectionId': sectionId,
        'sectionName': sectionName
    };

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

class TemplateApprovalListItem implements IConvertible
{
    String? userCrmId;
    String? approvalDate;
    int? templateApprovalId;
    TemplateApprovalStatus? approvalStatus;
    String? approvalStatusString;
    TemplateType? templateType;
    String? templateTypeString;
    String? templateName;
    String? systemUserName;
    List<SectionSummary>? templateChangeDetail;
    List<SectionSummary>? templateDetail;
    String? content;

    TemplateApprovalListItem({this.userCrmId,this.approvalDate,this.templateApprovalId,this.approvalStatus,this.approvalStatusString,this.templateType,this.templateTypeString,this.templateName,this.systemUserName,this.templateChangeDetail,this.templateDetail,this.content});
    TemplateApprovalListItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        userCrmId = json['userCrmId'];
        approvalDate = json['approvalDate'];
        templateApprovalId = json['templateApprovalId'];
        approvalStatus = JsonConverters.fromJson(json['approvalStatus'],'TemplateApprovalStatus',context!);
        approvalStatusString = json['approvalStatusString'];
        templateType = JsonConverters.fromJson(json['templateType'],'TemplateType',context!);
        templateTypeString = json['templateTypeString'];
        templateName = json['templateName'];
        systemUserName = json['systemUserName'];
        templateChangeDetail = JsonConverters.fromJson(json['templateChangeDetail'],'List<SectionSummary>',context!);
        templateDetail = JsonConverters.fromJson(json['templateDetail'],'List<SectionSummary>',context!);
        content = json['content'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'userCrmId': userCrmId,
        'approvalDate': approvalDate,
        'templateApprovalId': templateApprovalId,
        'approvalStatus': JsonConverters.toJson(approvalStatus,'TemplateApprovalStatus',context!),
        'approvalStatusString': approvalStatusString,
        'templateType': JsonConverters.toJson(templateType,'TemplateType',context!),
        'templateTypeString': templateTypeString,
        'templateName': templateName,
        'systemUserName': systemUserName,
        'templateChangeDetail': JsonConverters.toJson(templateChangeDetail,'List<SectionSummary>',context!),
        'templateDetail': JsonConverters.toJson(templateDetail,'List<SectionSummary>',context!),
        'content': content
    };

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

class TemplateApprovalListResponse extends ApiServiceResponse implements IConvertible
{
    List<TemplateApprovalListItem>? templates;

    TemplateApprovalListResponse({this.templates});
    TemplateApprovalListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        templates = JsonConverters.fromJson(json['templates'],'List<TemplateApprovalListItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'templates': JsonConverters.toJson(templates,'List<TemplateApprovalListItem>',context!)
    });

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

class TemplateApprovalList extends ApiServiceRequest implements IConvertible
{
    TemplateApprovalList();
    TemplateApprovalList.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "TemplateApprovalList";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'cochraneplus_api_dev.happen.zone', types: <String, TypeInfo> {
    'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
    'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
    'TemplateApprovalStatus': TypeInfo(TypeOf.Enum, enumValues:TemplateApprovalStatus.values),
    'TemplateType': TypeInfo(TypeOf.Enum, enumValues:TemplateType.values),
    'SectionTitle': TypeInfo(TypeOf.Enum, enumValues:SectionTitle.values),
    'SectionSummary': TypeInfo(TypeOf.Class, create:() => SectionSummary()),
    'TemplateApprovalListItem': TypeInfo(TypeOf.Class, create:() => TemplateApprovalListItem()),
    'List<SectionSummary>': TypeInfo(TypeOf.Class, create:() => <SectionSummary>[]),
    'TemplateApprovalListResponse': TypeInfo(TypeOf.Class, create:() => TemplateApprovalListResponse()),
    'List<TemplateApprovalListItem>': TypeInfo(TypeOf.Class, create:() => <TemplateApprovalListItem>[]),
    'TemplateApprovalList': TypeInfo(TypeOf.Class, create:() => TemplateApprovalList()),
});

Dart TemplateApprovalList 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 /template-approval/list HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"templates":[{}],"description":"String","heading":"String","wasSuccessful":false,"modelState":{}}