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: 'api.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 .xml suffix or ?format=xml

HTTP + XML

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: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateUserEmail xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Realm>BookMore</Realm>
  <Token>String</Token>
</UpdateUserEmail>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<UpdateUserEmailResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Email>String</Email>
  <ResponseStatus />
  <UserId>00000000-0000-0000-0000-000000000000</UserId>
</UpdateUserEmailResponse>