BokaMera.API.Host

<back to all web services

ResetDemoAccounts

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/superadmin/demoaccounts/resetReset all demo accountsSuperAdmin-only. Runs the demo-account reset on demand (the same EXEC dbo.P_ResetDemoAccounts the daily background job performs): wipes and reinstalls every demo tenant. Destructive by design.
import 'package:servicestack/servicestack.dart';

class ResetDemoAccountsResponse implements IConvertible
{
    bool Success;
    String Message = "";
    ResponseStatus ResponseStatus;

    ResetDemoAccountsResponse({this.Success,this.Message,this.ResponseStatus});
    ResetDemoAccountsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Success = json['Success'];
        Message = json['Message'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Success': Success,
        'Message': Message,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class ResetDemoAccounts implements IConvertible
{
    ResetDemoAccounts();
    ResetDemoAccounts.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "ResetDemoAccounts";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'ResetDemoAccountsResponse': TypeInfo(TypeOf.Class, create:() => ResetDemoAccountsResponse()),
    'ResetDemoAccounts': TypeInfo(TypeOf.Class, create:() => ResetDemoAccounts()),
});

Dart ResetDemoAccounts DTOs

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

HTTP + CSV

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

POST /superadmin/demoaccounts/reset HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Success":false,"Message":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}