Cochrane+ App API

<back to all web services

Test

The following routes are available for this service:
GET/testSimple test method to confirm the services are working
import 'package:servicestack/servicestack.dart';

class TestResult implements IConvertible
{
    bool? wasSuccessful;
    String? description;

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

    fromMap(Map<String, dynamic> json) {
        wasSuccessful = json['wasSuccessful'];
        description = json['description'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'wasSuccessful': wasSuccessful,
        'description': description
    };

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

class TestResponse implements IConvertible
{
    String? environment;
    Map<String,TestResult?>? tests;
    bool? wasSuccessful;
    String? db;

    TestResponse({this.environment,this.tests,this.wasSuccessful,this.db});
    TestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        environment = json['environment'];
        tests = JsonConverters.fromJson(json['tests'],'Map<String,TestResult?>',context!);
        wasSuccessful = json['wasSuccessful'];
        db = json['db'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'environment': environment,
        'tests': JsonConverters.toJson(tests,'Map<String,TestResult?>',context!),
        'wasSuccessful': wasSuccessful,
        'db': db
    };

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

class Test implements IConvertible
{
    /**
    * An email address a test email will be sent to
    */
    // @ApiMember(Description="An email address a test email will be sent to")
    String? smtp;

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

    fromMap(Map<String, dynamic> json) {
        smtp = json['smtp'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'smtp': smtp
    };

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

TypeContext _ctx = TypeContext(library: 'cochraneplus_api_dev.happen.zone', types: <String, TypeInfo> {
    'TestResult': TypeInfo(TypeOf.Class, create:() => TestResult()),
    'TestResponse': TypeInfo(TypeOf.Class, create:() => TestResponse()),
    'Map<String,TestResult?>': TypeInfo(TypeOf.Class, create:() => Map<String,TestResult?>()),
    'Test': TypeInfo(TypeOf.Class, create:() => Test()),
});

Dart Test DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /test HTTP/1.1 
Host: cochraneplus-api-dev.happen.zone 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"environment":"String","tests":{"String":{"wasSuccessful":false,"description":"String"}},"wasSuccessful":false,"db":"String"}