BokaMera.API.Host

<back to all web services

UpdateUserEmail

The following routes are available for this service:
POST/users/confirmemailConfirm my new email
import 'package:servicestack/servicestack.dart';

class UpdateUserEmailResponse implements IConvertible
{
    dynamic? ResponseStatus;
    String? UserId;
    String? Email;

    UpdateUserEmailResponse({this.ResponseStatus,this.UserId,this.Email});
    UpdateUserEmailResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

enum KeyCloakRealm
{
    BookMore,
    BookMoreAdmin,
    SuperAdmin,
}

// @ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)
// @ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)
class UpdateUserEmail implements IConvertible
{
    // @ApiMember(IsRequired=true)
    String? Token;

    /**
    * The user realm for identity server.  BookMore = 1, BookMoreAdmin = 2 
    */
    // @ApiMember(Description="The user realm for identity server.  BookMore = 1, BookMoreAdmin = 2 ", IsRequired=true)
    KeyCloakRealm? Realm;

    UpdateUserEmail({this.Token,this.Realm});
    UpdateUserEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Token': Token,
        'Realm': JsonConverters.toJson(Realm,'KeyCloakRealm',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'UpdateUserEmailResponse': TypeInfo(TypeOf.Class, create:() => UpdateUserEmailResponse()),
    'KeyCloakRealm': TypeInfo(TypeOf.Enum, enumValues:KeyCloakRealm.values),
    'UpdateUserEmail': TypeInfo(TypeOf.Class, create:() => UpdateUserEmail()),
});

Dart UpdateUserEmail DTOs

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

HTTP + JSV

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

POST /users/confirmemail HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Token: String,
	Realm: BookMore
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: {},
	UserId: 00000000-0000-0000-0000-000000000000,
	Email: String
}