Richemont.Booster2.PublicApi

<back to all web services

CreateUserAuth

Requires Authentication
The following routes are available for this service:
POST/user/{brand}/{userId}/authorizeCreate the authorization for the given external user and for the given POS CodesThe 'CreateUserAuth' API is not implemented for internal users
import 'package:servicestack/servicestack.dart';

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

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

class AuthRequest implements IConvertible
{
    /**
    * POS Code (only for external users)
    */
    // @ApiMember(Description="POS Code (only for external users)", IsRequired=true)
    String? posCode;

    /**
    * Roles for users (GUIDs). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'
    */
    // @ApiMember(Description="Roles for users (GUIDs). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'", IsRequired=true)
    List<String>? roles;

    AuthRequest({this.posCode,this.roles});
    AuthRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'posCode': posCode,
        'roles': JsonConverters.toJson(roles,'List<String>',context!)
    };

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

class CreateUserAuth implements IConvertible
{
    /**
    * User's UserID (GUID). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'
    */
    // @ApiMember(Description="User's UserID (GUID). E.g. '731cd7f3-a781-48bf-b43d-310273895ce2'", IsRequired=true)
    String? userId;

    /**
    * Brand Trigram, e.g. CAR, IWC, VAC
    */
    // @ApiMember(Description="Brand Trigram, e.g. CAR, IWC, VAC", IsRequired=true)
    String? brand;

    /**
    * Authorization requests for the provided user
    */
    // @ApiMember(Description="Authorization requests for the provided user", IsRequired=true)
    List<AuthRequest>? authRequests;

    CreateUserAuth({this.userId,this.brand,this.authRequests});
    CreateUserAuth.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        userId = json['userId'];
        brand = json['brand'];
        authRequests = JsonConverters.fromJson(json['authRequests'],'List<AuthRequest>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'userId': userId,
        'brand': brand,
        'authRequests': JsonConverters.toJson(authRequests,'List<AuthRequest>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
    'CreateUserAuthResponse': TypeInfo(TypeOf.Class, create:() => CreateUserAuthResponse()),
    'AuthRequest': TypeInfo(TypeOf.Class, create:() => AuthRequest()),
    'CreateUserAuth': TypeInfo(TypeOf.Class, create:() => CreateUserAuth()),
    'List<AuthRequest>': TypeInfo(TypeOf.Class, create:() => <AuthRequest>[]),
});

Dart CreateUserAuth 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.

POST /user/{brand}/{userId}/authorize HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"userId":"String","brand":"String","authRequests":[{"posCode":"String","roles":["00000000000000000000000000000000"]}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}